Overseas access: www.kdjingpai.com
Bookmark Us

Qwen Code is an open source command-line tool based on Google's Gemini CLI Developed specifically for Alibaba Cloud's Qwen3-Coder Model optimization. It helps developers accomplish code generation, editing, and repository management tasks from the command line. qwen-code supports Qwen3-Coder-480B-A35B model with 480 billion parameters and 35 billion parameters activated during inference, using the Mixed Expert Architecture (MoE). It supports 256K long contexts natively, and can be scaled up to 1M with YaRN technology, making it suitable for handling large code bases. The tool offers code completion, refactoring, Git commit analysis, and open source features that allow the community to expand and developers to contribute via GitHub.

Reviews:Qwen Code in-depth review: can it replace Claude as the new development workhorse?

Dependency modeling:Qwen3-Coder: open source code generation and intelligent programming assistant

Free API:Qwen3-Code Free User's Guide: Configuring the ModelScope API and Qwen CLI

 

Function List

  • Supports the Qwen3-Coder model, providing code completion, repair and refactoring.
  • Query and edit large code bases, breaking the traditional context length limitations and supporting 256K to 1M contexts.
  • Automate Git commit analysis, grouped by function or team member to optimize team collaboration.
  • Support for more than 40 programming languages, such as Python, JavaScript, Haskell, and more.
  • Provides a command line interface to simplify code development and project management processes.
  • Compatible with OpenAI API for seamlessly calling Qwen3-Coder models.
  • Automate workflows such as handling pull requests (PRs) and complex variable base operations.
  • Generate JSDoc comments, unit tests and API documentation to improve code quality.

Using Help

Installation process

qwen-code supports installation via npm or source code for Linux, macOS and Windows. Here are the steps:

Install via npm

  1. Make sure Node.js (version 20 or higher) is installed. Node.js can be installed with the following command:
    curl -qL https://www.npmjs.com/install.sh | sh
    
  2. Install qwen-code globally:
    npm install -g @qwen-code/qwen-code
    
  3. Verify the installation:
    qwen --version
    

    If the version number is displayed, the installation was successful.

Installation via source code

  1. Clone a GitHub repository:
    git clone https://github.com/QwenLM/qwen-code.git
    
  2. Go to the project catalog:
    cd qwen-code
    
  3. Install dependencies and deploy globally:
    npm install
    npm install -g .
    
  4. Verify the installation:
    qwen --version
    

Configuring API Keys

qwen-code needs Qwen3-Coder's API key to invoke model functions:

  1. Register for an Alibaba Cloud account and activate the Model Studio service.
  2. Generate an API key in the Alibaba Cloud console.
  3. Configure environment variables or create them in the project root directory. .env file, add the following:
    OPENAI_API_KEY=your_api_key_here
    OPENAI_BASE_URL=https://dashscope-intl.aliyuncs.com/compatible-mode/v1
    OPENAI_MODEL=qwen3-coder-plus
    
  4. If using environment variables, run:
    export OPENAI_API_KEY="your_api_key_here"
    export OPENAI_BASE_URL="https://dashscope-intl.aliyuncs.com/compatible-mode/v1"
    export OPENAI_MODEL="qwen3-coder-plus"
    

Usage

After the installation is complete, type in the terminal qwen The tool can be launched. The following is a detailed procedure for the main functions:

code completion

qwen-code supports code completion based on Qwen3-Coder. For example, completing the Python quick sort algorithm:

  1. Go to the project catalog:
    cd your-project
    
  2. importation qwen, then enter the code snippet:
    def quicksort(arr): if len(arr) <= 1: return arr pivot = arr[len(arr) // 2]
    
  3. qwen-code will return complementary code, for example:
    left = [x for x in arr if x < pivot]
    middle = [x for x in arr if x == pivot]
    right = [x for x in arr if x > pivot]
    return quicksort(left) + middle + quicksort(right)
    

code refactoring

Optimize code readability and performance:

  1. Enter the command:
    qwen > Refactor this function to improve readability and performance
    
  2. Paste in the code that needs refactoring and qwen-code will return the optimized version. For example, refactoring a lengthy loop into a more concise list derivation.

Git Commit Analysis

Analyze project submission records:

  1. Go to the project catalog:
    cd your-project
    
  2. Input:
    qwen > Analyze git commits from the last 7 days, grouped by feature and team member
    
  3. qwen-code returns submission details grouped by feature and team member for easy team review.

Codebase Search

Query the project architecture or core logic:

  1. Input:
    qwen > Describe the main pieces of this system's architecture
    
  2. qwen-code will analyze the code base and return a description of the system architecture.

Automated workflows

Handle pull requests (PRs) or complex variable bases:

  1. Input:
    qwen > Automate the process of handling pull requests
    
  2. qwen-code generates PR processing scripts or suggested procedures.

Documentation and Testing

Generate JSDoc comments or unit tests:

  1. Input:
    qwen > Generate comprehensive JSDoc comments for this function
    
  2. Paste the function code, qwen-code will return the code with comments.
  3. Similarly, enter qwen > Write unit tests for this component Test code can be generated.

Image format conversion

Batch convert images in a catalog:

  1. Input:
    qwen > Convert all images in this directory to PNG format
    
  2. qwen-code performs the conversion and returns the result.

caveat

  • Ensure that your network is stable to access Qwen3-Coder's API.
  • Qwen3-Coder-480B-A35B does not support thinking mode, no setup required. enable_thinking=FalseThe
  • In case of installation problems, check the Node.js version or refer to the troubleshooting guide(Located in docs/troubleshooting.md).
  • The open source community can be reached through the CONTRIBUTING.md Participate in development by submitting new features or fixing bugs.

application scenario

  1. Quick code debugging
    Individual developers can use qwen-code to patch or fix code. For example, enter some Python code and qwen-code will automatically complete the logic, making it suitable for rapid prototyping.
  2. Team code review
    Development teams can quickly understand recent code changes through Git commit analysis, grouping them by function or member to improve review efficiency.
  3. Large-scale project management
    qwen-code supports 256K to 1M contexts, which is suitable for handling large code bases, query architectures or optimization modules to meet the needs of enterprise-level development.
  4. multilingual development
    Supporting more than 40 programming languages, developers can easily handle code tasks in Python, JavaScript, Haskell and other languages, reducing the difficulty of cross-language development.
  5. Document Generation
    qwen-code generates JSDoc comments, API documentation, or unit tests for development scenarios that require rapid generation of high-quality documentation.

QA

  1. Is qwen-code free?
    qwen-code is an open source tool and is free to use. However, calling the Qwen3-Coder model requires an Alibaba Cloud API key, which may incur a fee, for specific pricing please visit https://dashscope.aliyuncs.comThe
  2. How do I fix an installation failure?
    Ensure that Node.js version is 20 or higher, check your network connection, and re-run the npm install. If it still fails, refer to docs/troubleshooting.mdThe
  3. What programming languages does qwen-code support?
    More than 40 languages are supported, including Python, JavaScript, Haskell, and more, with performance as described in the McEval or SWE-Bench Verified benchmarks.
  4. Does it support offline use?
    qwen-code relies on cloud APIs and cannot be fully offline. You need to deploy local Qwen3-Coder model to realize some offline functions, refer to the official documentation.
  5. What are the advantages over Claude Code?
    qwen-code is open source and free, and supports Qwen3-Coder's very long contexts and powerful agent capabilities, with performance close to that of Claude Sonnet 4, and adapted to the domestic network environment.
0Bookmarked
1kudos

Recommended

Can't find AI tools? Try here!

Just type in the keyword Accessibility Bing SearchYou can quickly find all the AI tools on this site.

Top

en_USEnglish