2025-08-26 18:55:06 +00:00
2025-12-13 20:56:18 +08:00
2025-12-17 16:47:37 +08:00
2025-12-15 09:47:03 +08:00
2025-07-22 23:26:01 +08:00
2025-07-22 23:26:01 +08:00
2025-07-22 23:26:01 +08:00
2025-12-09 20:16:03 +08:00
2025-08-08 20:45:54 +08:00
2025-07-22 23:26:01 +08:00
2025-09-29 14:31:14 +08:00
2025-10-29 12:25:50 +08:00
2025-10-23 09:27:04 +08:00
2025-12-15 20:48:02 +08:00

Qwen Code

Qwen Code Screenshot

npm version License Node.js Version Downloads

AI-powered command-line workflow tool for developers

InstallationQuick StartFeaturesDocumentationContributing

Qwen Code is a powerful command-line AI workflow tool adapted from Gemini CLI, specifically optimized for Qwen3-Coder models. It enhances your development workflow with advanced code understanding, automated tasks, and intelligent assistance.

📌 Why Qwen Code

🌱 Seamless Integration & Immediate Setup

  • Free & Open Source: Completely free to use with generous daily quotas (up to 2,000 requests/day)
  • Quick Start in 30 Seconds: One-click authentication with Qwen OAuth, no complex configuration needed

🧠 Advanced Code Intelligence

  • Deep Code Understanding: Grasp complex codebases beyond traditional context limits, instantly understanding architecture, dependencies, and data flows
  • Multi-Language Support and Smart Refactoring: Optimize, debug, and refactor code with AI-powered insights that follow industry standards

🔧 Comprehensive Development Assistance

  • Error Debugging Made Easy: Paste error logs directly for instant root cause analysis and actionable solutions
  • Git Workflow Enhancement: Generate standardized commit messages, explain Git commands, and assist with code reviews
  • Documentation & Testing: Automatically generate comprehensive documentation, JSDoc comments, and unit tests with edge cases

💼 Professional VS Code Integration

  • Sidebar Companion: Install the VS Code extension for seamless integration with native diffing, interactive chat, and file system operations
  • Context-Aware Assistance: Get AI-powered help without leaving your preferred development environment

🌐 Flexible Authentication

  • Multiple Free Tiers: Access regional free options (Mainland China: ModelScope, International: OpenRouter) with up to 2,000 free API calls per day
  • OpenAI-Compatible: Use existing API keys from various providers (Alibaba Cloud, OpenRouter, etc.)

👉 Know more workflows

📦 The extension is currently in development. For installation, features, and development guide, see the VS Code Extension README.

How to use Qwen Code?

Prerequisites

Ensure you have Node.js version 20 or higher installed.

curl -qL https://www.npmjs.com/install.sh | sh

Install from npm

npm install -g @qwen-code/qwen-code@latest

🚀 Quick Start

# Start Qwen Code
qwen

# Example commands
> What does this project do?
> Explain this codebase structure
> Help me refactor this function
> Generate unit tests for this module

Usage Examples

If you want to learn more about common workflows, click Common Workflows to view.

🔍 Explore Codebases

cd your-project/
qwen

# Architecture analysis
> Describe the main pieces of this system's architecture
> What are the key dependencies and how do they interact?
> Find all API endpoints and their authentication methods

💻 Code Development

# Refactoring
> Refactor this function to improve readability and performance
> Convert this class to use dependency injection
> Split this large module into smaller, focused components

# Code generation
> Create a REST API endpoint for user management
> Generate unit tests for the authentication module
> Add error handling to all database operations

🔄 Automate Workflows

# Git automation
> Analyze git commits from the last 7 days, grouped by feature
> Create a changelog from recent commits
> Find all TODO comments and create GitHub issues

# File operations
> Convert all images in this directory to PNG format
> Rename all test files to follow the *.test.ts pattern
> Find and remove all console.log statements

🐛 Debugging & Analysis

# Performance analysis
> Identify performance bottlenecks in this React component
> Find all N+1 query problems in the codebase

# Security audit
> Check for potential SQL injection vulnerabilities
> Find all hardcoded credentials or API keys

📚 Understand New Codebases

> What are the core business logic components?
> What security mechanisms are in place?
> How does the data flow through the system?
> What are the main design patterns used?
> Generate a dependency graph for this module

🔨 Code Refactoring & Optimization

> What parts of this module can be optimized?
> Help me refactor this class to follow SOLID principles
> Add proper error handling and logging
> Convert callbacks to async/await pattern
> Implement caching for expensive operations

📝 Documentation & Testing

> Generate comprehensive JSDoc comments for all public APIs
> Write unit tests with edge cases for this component
> Create API documentation in OpenAPI format
> Add inline comments explaining complex algorithms
> Generate a README for this module

🚀 Development Acceleration

> Set up a new Express server with authentication
> Create a React component with TypeScript and tests
> Implement a rate limiter middleware
> Add database migrations for new schema
> Configure CI/CD pipeline for this project

Commands & Shortcuts

Session Commands

  • /help - Display available commands
  • /clear - Clear conversation history
  • /compress - Compress history to save tokens
  • /stats - Show current session information
  • /exit or /quit - Exit Qwen Code

Keyboard Shortcuts

  • Ctrl+C - Cancel current operation
  • Ctrl+D - Exit (on empty line)
  • Up/Down - Navigate command history

💬 Session Management

Control your token usage with configurable session limits to optimize costs and performance.

Configure Session Token Limit

Create or edit .qwen/settings.json in your home directory:

{
  "sessionTokenLimit": 32000
}

Session Commands

  • /compress - Compress conversation history to continue within token limits
  • /clear - Clear all conversation history and start fresh
  • /stats - Check current token usage and limits

Note

📝 Note: Session token limit applies to a single conversation, not cumulative API calls.

Vision Model Configuration

Qwen Code includes intelligent vision model auto-switching that detects images in your input and can automatically switch to vision-capable models for multimodal analysis. This feature is enabled by default - when you include images in your queries, you'll see a dialog asking how you'd like to handle the vision model switch.

Skip the Switch Dialog (Optional)

If you don't want to see the interactive dialog each time, configure the default behavior in your .qwen/settings.json:

{
  "experimental": {
    "vlmSwitchMode": "once"
  }
}

Available modes:

  • "once" - Switch to vision model for this query only, then revert
  • "session" - Switch to vision model for the entire session
  • "persist" - Continue with current model (no switching)
  • Not set - Show interactive dialog each time (default)

Command Line Override

You can also set the behavior via command line:

# Switch once per query
qwen --vlm-switch-mode once

# Switch for entire session
qwen --vlm-switch-mode session

# Never switch automatically
qwen --vlm-switch-mode persist

Disable Vision Models (Optional)

To completely disable vision model support, add to your .qwen/settings.json:

{
  "experimental": {
    "visionModelPreview": false
  }
}

👉 Know more about Commands

💡 Tip: In YOLO mode (--yolo), vision switching happens automatically without prompts when images are detected. Know more about Approval Mode

Benchmark Results

Terminal-Bench Performance

Agent Model Accuracy
Qwen Code Qwen3-Coder-480A35 37.5%
Qwen Code Qwen3-Coder-30BA3B 31.3%

Development & Contributing

See CONTRIBUTING.md to learn how to contribute to the project.

For detailed authentication setup, see the authentication guide.

Troubleshooting

If you encounter issues, check the troubleshooting guide.

Acknowledgments

This project is based on Google Gemini CLI. We acknowledge and appreciate the excellent work of the Gemini CLI team. Our main contribution focuses on parser-level adaptations to better support Qwen-Coder models.

License

LICENSE

Star History

Star History Chart

Description
Qwen Code is a coding agent that lives in the digital world.
Readme Apache-2.0 56 MiB
Languages
TypeScript 95.7%
JavaScript 3.8%
CSS 0.4%