Skip to main content

Qwen + Claude Code Router bootstrapper

Project description

This is looking like a high-quality production tool. Since this is now a public package on PyPI, I’ve updated the README.md to prioritize the standard installation method while keeping the technical details that make your project look professional.


🚀 Qwen-Claude Bridge

PyPI version Python Version License: MIT

Qwen-Claude is a high-performance automation CLI that bridges the gap between Qwen’s authentication and the Claude Code Router (CCR). It automates the extraction of OAuth tokens and manages configuration synchronization, allowing you to use Qwen models within Claude Code seamlessly.

✨ Features

  • 🔄 Automated Token Sync: Extracts the latest Qwen OAuth access token and injects it directly into your CCR configuration.
  • 🛡️ Smart Schema Validation: Ensures your config.json is always valid and correctly points to the Qwen portal.
  • ⚡ Dependency Guard: Automatically verifies that qwen, ccr, and claude CLIs are installed and accessible in your PATH.
  • 🪟 Windows Optimized: Built-in support for Windows execution logic, handling .ps1, .bat, and .cmd wrappers natively.
  • 🤖 Intelligent Fallback: Detects expired sessions, triggers an interactive login when needed, and resumes the workflow.

🛠️ Installation

Install the package directly from PyPI:

pip install qwen-claude

Required Global Tools

The bridge coordinates with the following Node.js-based tools. Ensure they are installed on your system:

Tool Purpose Install Command
Qwen CLI Auth Provider npm install -g @qwen-code/qwen-code@latest
CCR Router Engine npm install -g @musistudio/claude-code-router
Claude AI Interface npm install -g @anthropic-ai/claude-code

🚀 Usage

Launch the bridge using the qc command. This will validate your environment, refresh tokens if necessary, and start your Claude Code session:

qc

Checking Version

To check your current version of the bridge:

qc -v
# OR
qc --version

Workflow Overview

  1. Verify: Checks for the presence of required global binaries.
  2. Validate: Ensures ~/.claude-code-router/config.json matches the standard schema.
  3. Refresh: If the token expires in < 120 seconds, it triggers a refresh via the Qwen CLI.
  4. Inject: Updates the CCR configuration with the new access_token.
  5. Execute: Restarts the CCR service and enters the Claude Code environment.

⚙️ Configuration

The bridge initializes your router using a pre-defined schema optimized for Qwen 3 Coder:

{
  "Providers": [
    {
      "name": "qwen",
      "api_base_url": "https://portal.qwen.ai/v1/chat/completions",
      "models": ["qwen3-coder-plus"]
    }
  ],
  "Router": {
    "default": "qwen,qwen3-coder-plus",
    "think": "qwen,qwen3-coder-plus"
  }
}

📁 Project Structure

QWEN_CLAUDE
├── .github/
│   └── workflows/
│       └── publish.yml    # CI/CD Pipeline
├── src/
│   └── qwen_claude/
│       ├── __init__.py    # Version metadata
│       ├── cli.py         # Automation logic
│       └── schema.json    # Default CCR configuration
├── CODE_OF_CONDUCT.md     # Community standards
├── CONTRIBUTING.md        # Contribution guidelines
├── LICENSE                # MIT License
├── pyproject.toml         # Build & Entry points
└── README.md              # Documentation

🤝 Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make to Qwen-Claude are greatly appreciated.

To maintain a high standard of code and community health, please follow these steps:

  1. Read the Guidelines: Before starting, please review our CONTRIBUTING.md for technical instructions and our CODE_OF_CONDUCT.md to understand our community standards.
  2. Fork & Clone: Fork the repository to your own GitHub account and clone it locally.
  3. Create a Branch: Dedicated to your fix or feature (git checkout -b feature/AmazingFeature).
  4. Develop & Test: Make your changes and ensure the logic remains robust.
  5. Commit & Push: Commit your changes with clear messages (git commit -m 'Add some AmazingFeature') and push to your fork.
  6. Open a Pull Request: Submit your PR against the main branch. We will review it as soon as possible!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qwen_claude-0.1.2.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qwen_claude-0.1.2-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file qwen_claude-0.1.2.tar.gz.

File metadata

  • Download URL: qwen_claude-0.1.2.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qwen_claude-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7eff73be8817842b07ac45d861da26d5a79c4c0e8f8cf41961c7750f61f76a82
MD5 b185b27eff37731f9ad4d7241264485a
BLAKE2b-256 5cba61f700070f738b19343a21c3f8122b42e8f0ed91de1e87c12bf59b7026ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for qwen_claude-0.1.2.tar.gz:

Publisher: publish.yml on SaadKamran0804/qwen-claude

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qwen_claude-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: qwen_claude-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for qwen_claude-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2b422da9f034d19f02363dcd90fe6c1ae51b8663d328569cfd6b0e70050a6f81
MD5 d2848d97239ff7e4a6b7d2fca61caabb
BLAKE2b-256 822e2bb1b35cf42c44577a0bdb2593db1adf5e24624c8062e86fe920887eda76

See more details on using hashes here.

Provenance

The following attestation bundles were made for qwen_claude-0.1.2-py3-none-any.whl:

Publisher: publish.yml on SaadKamran0804/qwen-claude

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page