From 629cd14fad5a3e76161d1dd9ea8ac6d0bef9f1f5 Mon Sep 17 00:00:00 2001 From: bl-ue <54780737+bl-ue@users.noreply.github.com> Date: Mon, 11 Aug 2025 11:17:37 -0600 Subject: [PATCH 01/14] Add a link to Gemini Desktop for Qwen Code users who prefer graphical UIs --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5790f693..f5d8b503 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,9 @@ Qwen Code is a powerful command-line AI workflow tool adapted from [**Gemini CLI**](https://github.com/google-gemini/gemini-cli) ([details](./README.gemini.md)), specifically optimized for [Qwen3-Coder](https://github.com/QwenLM/Qwen3-Coder) models. It enhances your development workflow with advanced code understanding, automated tasks, and intelligent assistance. +> [!NOTE] +> 🖥️ There is also a powerful **desktop/web/mobile** UI for Qwen Coder/Gemini CLI called [**Gemini Desktop**](https://github.com/Piebald-AI). + ## 💡 Free Options Available Get started with Qwen Code at no cost using any of these free options: @@ -101,7 +104,7 @@ Create or edit `.qwen/settings.json` in your home directory: - **`/compress`** - Compress conversation history to continue within token limits - **`/clear`** - Clear all conversation history and start fresh -- **`/stats`** - Check current token usage and limits +- **`/status`** - Check current token usage and limits > 📝 **Note**: Session token limit applies to a single conversation, not cumulative API calls. @@ -310,7 +313,7 @@ qwen - `/help` - Display available commands - `/clear` - Clear conversation history - `/compress` - Compress history to save tokens -- `/stats` - Show current session information +- `/status` - Show current session information - `/exit` or `/quit` - Exit Qwen Code ### Keyboard Shortcuts From 51b82771da8d52ee31fb71c82c5fae38338ec2fa Mon Sep 17 00:00:00 2001 From: bl-ue <54780737+bl-ue@users.noreply.github.com> Date: Mon, 11 Aug 2025 18:25:32 -0600 Subject: [PATCH 02/14] Revert unintentional readme change --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f5d8b503..f071ad61 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ Create or edit `.qwen/settings.json` in your home directory: - **`/compress`** - Compress conversation history to continue within token limits - **`/clear`** - Clear all conversation history and start fresh -- **`/status`** - Check current token usage and limits +- **`/stats`** - Check current token usage and limits > 📝 **Note**: Session token limit applies to a single conversation, not cumulative API calls. @@ -313,7 +313,7 @@ qwen - `/help` - Display available commands - `/clear` - Clear conversation history - `/compress` - Compress history to save tokens -- `/status` - Show current session information +- `/stats` - Show current session information - `/exit` or `/quit` - Exit Qwen Code ### Keyboard Shortcuts From 387be44866952a81c8ae981a4841cf32f41340a9 Mon Sep 17 00:00:00 2001 From: bl-ue <54780737+bl-ue@users.noreply.github.com> Date: Fri, 15 Aug 2025 11:22:28 -0600 Subject: [PATCH 03/14] Fix link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f071ad61..b607dea1 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Qwen Code is a powerful command-line AI workflow tool adapted from [**Gemini CLI**](https://github.com/google-gemini/gemini-cli) ([details](./README.gemini.md)), specifically optimized for [Qwen3-Coder](https://github.com/QwenLM/Qwen3-Coder) models. It enhances your development workflow with advanced code understanding, automated tasks, and intelligent assistance. > [!NOTE] -> 🖥️ There is also a powerful **desktop/web/mobile** UI for Qwen Coder/Gemini CLI called [**Gemini Desktop**](https://github.com/Piebald-AI). +> 🖥️ There is also a powerful **desktop/web/mobile** UI for Qwen Coder/Gemini CLI called [**Gemini Desktop**](https://github.com/Piebald-AI/gemini-desktop). ## 💡 Free Options Available From fa6ae0a324ac753e412c42530626be6638d1a7a3 Mon Sep 17 00:00:00 2001 From: bl-ue <54780737+bl-ue@users.noreply.github.com> Date: Tue, 19 Aug 2025 07:53:09 -0600 Subject: [PATCH 04/14] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b607dea1..00901414 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Qwen Code is a powerful command-line AI workflow tool adapted from [**Gemini CLI**](https://github.com/google-gemini/gemini-cli) ([details](./README.gemini.md)), specifically optimized for [Qwen3-Coder](https://github.com/QwenLM/Qwen3-Coder) models. It enhances your development workflow with advanced code understanding, automated tasks, and intelligent assistance. > [!NOTE] -> 🖥️ There is also a powerful **desktop/web/mobile** UI for Qwen Coder/Gemini CLI called [**Gemini Desktop**](https://github.com/Piebald-AI/gemini-desktop). +> 🖥️ There is also a powerful **desktop/web/mobile** UI for Qwen Code/Gemini CLI called [**Gemini Desktop**](https://github.com/Piebald-AI/gemini-desktop). ## 💡 Free Options Available From 2f0fa267c8fa29a8c50ca755e4fbd4be4c8c725a Mon Sep 17 00:00:00 2001 From: bl-ue <54780737+bl-ue@users.noreply.github.com> Date: Wed, 5 Nov 2025 17:06:13 -0700 Subject: [PATCH 05/14] Fix name --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 00901414..d60d5df2 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ Qwen Code is a powerful command-line AI workflow tool adapted from [**Gemini CLI**](https://github.com/google-gemini/gemini-cli) ([details](./README.gemini.md)), specifically optimized for [Qwen3-Coder](https://github.com/QwenLM/Qwen3-Coder) models. It enhances your development workflow with advanced code understanding, automated tasks, and intelligent assistance. > [!NOTE] -> 🖥️ There is also a powerful **desktop/web/mobile** UI for Qwen Code/Gemini CLI called [**Gemini Desktop**](https://github.com/Piebald-AI/gemini-desktop). +> 🖥️ There is also a powerful **desktop/web/mobile** UI for Qwen Code/Gemini CLI called [**Gemini CLI Desktop**](https://github.com/Piebald-AI/gemini-cli-desktop). ## 💡 Free Options Available From 93b30cca29e803388cc8d09f73c1c69f934be6c8 Mon Sep 17 00:00:00 2001 From: joeytoday Date: Thu, 18 Dec 2025 15:06:47 +0800 Subject: [PATCH 06/14] docs: restructured the README and added new content, including screenshots of the startup page and a quick-start video. --- README.md | 339 +++++++++++++++++++----------------------------------- 1 file changed, 119 insertions(+), 220 deletions(-) diff --git a/README.md b/README.md index b277d4dd..6857e7dc 100644 --- a/README.md +++ b/README.md @@ -27,36 +27,49 @@ Qwen Code is a powerful command-line AI workflow tool adapted from [**Gemini CLI**](https://github.com/google-gemini/gemini-cli), specifically optimized for [Qwen3-Coder](https://github.com/QwenLM/Qwen3-Coder) models. It enhances your development workflow with advanced code understanding, automated tasks, and intelligent assistance. -## 💡 Free Options Available +![](https://gw.alicdn.com/imgextra/i1/O1CN01D2DviS1wwtEtMwIzJ_!!6000000006373-2-tps-1600-900.png) -Get started with Qwen Code at no cost using any of these free options: -### 🔥 Qwen OAuth (Recommended) +## 📌 Why Qwen Code? -- **2,000 requests per day** with no token limits -- **60 requests per minute** rate limit -- Simply run `qwen` and authenticate with your qwen.ai account -- Automatic credential management and refresh -- Use `/auth` command to switch to Qwen OAuth if you have initialized with OpenAI compatible mode +**🌱 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 -### 🌏 Regional Free Tiers +**🧠 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 -- **Mainland China**: ModelScope offers **2,000 free API calls per day** -- **International**: OpenRouter provides **up to 1,000 free API calls per day** worldwide +**🔧 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 -For detailed setup instructions, see [Authorization](#authorization). +**💼 Professional [VS Code Integration](https://qwenlm.github.io/qwen-code-docs/en/users/integration-vscode/)** + - 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 -> [!WARNING] -> **Token Usage Notice**: Qwen Code may issue multiple API calls per cycle, resulting in higher token usage (similar to Claude Code). We're actively optimizing API efficiency. +**🌐 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.) -## Key Features +>👉 Know more [workflows](https://qwenlm.github.io/qwen-code-docs/en/users/common-workflow/) +> +> 📦 The extension is currently in development. For installation, features, and development guide, see the [VS Code Extension README](./packages/vscode-ide-companion/README.md). -- **Code Understanding & Editing** - Query and edit large codebases beyond traditional context window limits -- **Workflow Automation** - Automate operational tasks like handling pull requests and complex rebases -- **Enhanced Parser** - Adapted parser specifically optimized for Qwen-Coder models -- **Vision Model Support** - Automatically detect images in your input and seamlessly switch to vision-capable models for multimodal analysis -## Installation +## ❓ How to use Qwen Code? ### Prerequisites @@ -70,220 +83,28 @@ curl -qL https://www.npmjs.com/install.sh | sh ```bash npm install -g @qwen-code/qwen-code@latest -qwen --version ``` -### Install from source - -```bash -git clone https://github.com/QwenLM/qwen-code.git -cd qwen-code -npm install -npm install -g . -``` - -### Install globally with Homebrew (macOS/Linux) - -```bash -brew install qwen-code -``` - -## VS Code Extension - -In addition to the CLI tool, Qwen Code also provides a **VS Code extension** that brings AI-powered coding assistance directly into your editor with features like file system operations, native diffing, interactive chat, and more. - -> 📦 The extension is currently in development. For installation, features, and development guide, see the [VS Code Extension README](./packages/vscode-ide-companion/README.md). - -## Quick Start +## 🚀 Quick Start ```bash # 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 ``` -### Session Management +![](https://cloud.video.taobao.com/vod/B40FS7f_HDyM_Zn0rI5-4eazHeRzYtG-EYJnHAqtzkQ.mp4) -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: - -```json -{ - "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**: 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`: - -```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: - -```bash -# 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`: - -```json -{ - "experimental": { - "visionModelPreview": false - } -} -``` - -> 💡 **Tip**: In YOLO mode (`--yolo`), vision switching happens automatically without prompts when images are detected. - -### Authorization - -Choose your preferred authentication method based on your needs: - -#### 1. Qwen OAuth (🚀 Recommended - Start in 30 seconds) - -The easiest way to get started - completely free with generous quotas: - -```bash -# Just run this command and follow the browser authentication -qwen -``` - -**What happens:** - -1. **Instant Setup**: CLI opens your browser automatically -2. **One-Click Login**: Authenticate with your qwen.ai account -3. **Automatic Management**: Credentials cached locally for future use -4. **No Configuration**: Zero setup required - just start coding! - -**Free Tier Benefits:** - -- ✅ **2,000 requests/day** (no token counting needed) -- ✅ **60 requests/minute** rate limit -- ✅ **Automatic credential refresh** -- ✅ **Zero cost** for individual users -- ℹ️ **Note**: Model fallback may occur to maintain service quality - -#### 2. OpenAI-Compatible API - -Use API keys for OpenAI or other compatible providers: - -**Configuration Methods:** - -1. **Environment Variables** - - ```bash - export OPENAI_API_KEY="your_api_key_here" - export OPENAI_BASE_URL="your_api_endpoint" - export OPENAI_MODEL="your_model_choice" - ``` - -2. **Project `.env` File** - Create a `.env` file in your project root: - ```env - OPENAI_API_KEY=your_api_key_here - OPENAI_BASE_URL=your_api_endpoint - OPENAI_MODEL=your_model_choice - ``` - -**API Provider Options** - -> ⚠️ **Regional Notice:** -> -> - **Mainland China**: Use Alibaba Cloud Bailian or ModelScope -> - **International**: Use Alibaba Cloud ModelStudio or OpenRouter - -
-🇨🇳 For Users in Mainland China - -**Option 1: Alibaba Cloud Bailian** ([Apply for API Key](https://bailian.console.aliyun.com/)) - -```bash -export OPENAI_API_KEY="your_api_key_here" -export OPENAI_BASE_URL="https://dashscope.aliyuncs.com/compatible-mode/v1" -export OPENAI_MODEL="qwen3-coder-plus" -``` - -**Option 2: ModelScope (Free Tier)** ([Apply for API Key](https://modelscope.cn/docs/model-service/API-Inference/intro)) - -- ✅ **2,000 free API calls per day** -- ⚠️ Connect your Aliyun account to avoid authentication errors - -```bash -export OPENAI_API_KEY="your_api_key_here" -export OPENAI_BASE_URL="https://api-inference.modelscope.cn/v1" -export OPENAI_MODEL="Qwen/Qwen3-Coder-480B-A35B-Instruct" -``` - -
- -
-🌍 For International Users - -**Option 1: Alibaba Cloud ModelStudio** ([Apply for API Key](https://modelstudio.console.alibabacloud.com/)) - -```bash -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" -``` - -**Option 2: OpenRouter (Free Tier Available)** ([Apply for API Key](https://openrouter.ai/)) - -```bash -export OPENAI_API_KEY="your_api_key_here" -export OPENAI_BASE_URL="https://openrouter.ai/api/v1" -export OPENAI_MODEL="qwen/qwen3-coder:free" -``` - -
## Usage Examples +If you want to learn more about common workflows, click [Common Workflows](https://qwenlm.github.io/qwen-code-docs/en/users/common-workflow/) to view. + ### 🔍 Explore Codebases ```bash @@ -394,6 +215,84 @@ qwen - `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: + +```json +{ + "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`: + +```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: + +```bash +# 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`: + +```json +{ + "experimental": { + "visionModelPreview": false + } +} +``` + +> 👉 Know more about [Commands](https://qwenlm.github.io/qwen-code-docs/en/users/features/commands/) +> +> 💡 **Tip**: In YOLO mode (`--yolo`), vision switching happens automatically without prompts when images are detected. Know more about [Approval Mode](https://qwenlm.github.io/qwen-code-docs/en/users/features/approval-mode/) + ## Benchmark Results ### Terminal-Bench Performance @@ -405,13 +304,13 @@ qwen ## Development & Contributing -See [CONTRIBUTING.md](./CONTRIBUTING.md) to learn how to contribute to the project. +See [CONTRIBUTING.md](https://qwenlm.github.io/qwen-code-docs/en/developers/contributing/) to learn how to contribute to the project. -For detailed authentication setup, see the [authentication guide](./docs/cli/authentication.md). +For detailed authentication setup, see the [authentication guide](https://qwenlm.github.io/qwen-code-docs/en/users/configuration/auth/). ## Troubleshooting -If you encounter issues, check the [troubleshooting guide](docs/troubleshooting.md). +If you encounter issues, check the [troubleshooting guide](https://qwenlm.github.io/qwen-code-docs/en/users/support/troubleshooting/). ## Acknowledgments From 235159216e3a62378c5dd0c8724ac4a0c7c4273e Mon Sep 17 00:00:00 2001 From: joeytoday Date: Thu, 18 Dec 2025 15:11:31 +0800 Subject: [PATCH 07/14] docs: updated REA --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6857e7dc..f8c0e47d 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ qwen > Generate unit tests for this module ``` -![](https://cloud.video.taobao.com/vod/B40FS7f_HDyM_Zn0rI5-4eazHeRzYtG-EYJnHAqtzkQ.mp4) +![](https://gw.alicdn.com/imgextra/i2/O1CN01bgnQbj1XcrWfFWeNc_!!6000000002945-1-tps-852-480.gif) ## Usage Examples From e610578eccf2dd0463c05c21b711aa7ab4cadbb4 Mon Sep 17 00:00:00 2001 From: joeytoday Date: Thu, 18 Dec 2025 16:51:45 +0800 Subject: [PATCH 08/14] docs: updated README, deleted session management and check inline links, shorter why --- README.md | 130 ++++++------------------------------------------------ 1 file changed, 13 insertions(+), 117 deletions(-) diff --git a/README.md b/README.md index f8c0e47d..afbb6506 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@
-![Qwen Code Screenshot](./docs/assets/qwen-screenshot.png) +![](https://gw.alicdn.com/imgextra/i1/O1CN01D2DviS1wwtEtMwIzJ_!!6000000006373-2-tps-1600-900.png) [![npm version](https://img.shields.io/npm/v/@qwen-code/qwen-code.svg)](https://www.npmjs.com/package/@qwen-code/qwen-code) [![License](https://img.shields.io/github/license/QwenLM/qwen-code.svg)](./LICENSE) @@ -11,58 +11,29 @@ **AI-powered command-line workflow tool for developers** -[Installation](#installation) • [Quick Start](#quick-start) • [Features](#key-features) • [Documentation](./docs/) • [Contributing](./CONTRIBUTING.md) - -
- -
- + 中文 | Deutsch | français | 日本語 | - Русский | - 中文 - + Русский + +[Installation](#install-from-npm) • [Quick Start](#-quick-start) • [Features](#-why-qwen-code) • [Documentation](https://qwenlm.github.io/qwen-code-docs/en/users/overview/) • [Contributing](https://qwenlm.github.io/qwen-code-docs/en/developers/contributing/) + +
Qwen Code is a powerful command-line AI workflow tool adapted from [**Gemini CLI**](https://github.com/google-gemini/gemini-cli), specifically optimized for [Qwen3-Coder](https://github.com/QwenLM/Qwen3-Coder) models. It enhances your development workflow with advanced code understanding, automated tasks, and intelligent assistance. -![](https://gw.alicdn.com/imgextra/i1/O1CN01D2DviS1wwtEtMwIzJ_!!6000000006373-2-tps-1600-900.png) ## 📌 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](https://qwenlm.github.io/qwen-code-docs/en/users/integration-vscode/)** - - 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.) +- 🎯 Free Access Available: Get started with 2,000 free requests per day via Qwen OAuth. +- 🧠 Code Understanding & Editing - Query and edit large codebases beyond traditional context window limits +- 🤖 Workflow Automation - Automate operational tasks like handling pull requests and complex rebases +- 💻 Terminal-first: Designed for developers who live in the command line. +- 🧰 VS Code: Install the VS Code extension to seamlessly integrate into your existing workflow. +- 📦 Simple Setup: Easy installation with npm, Homebrew, or source for quick deployment. >👉 Know more [workflows](https://qwenlm.github.io/qwen-code-docs/en/users/common-workflow/) > @@ -157,8 +128,6 @@ qwen > Find all hardcoded credentials or API keys ``` -## Popular Tasks - ### 📚 Understand New Codebases ```text @@ -215,79 +184,6 @@ qwen - `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: - -```json -{ - "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`: - -```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: - -```bash -# 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`: - -```json -{ - "experimental": { - "visionModelPreview": false - } -} -``` > 👉 Know more about [Commands](https://qwenlm.github.io/qwen-code-docs/en/users/features/commands/) > From b8df689e319d623e95516a1faf40d18dac656789 Mon Sep 17 00:00:00 2001 From: joeytoday Date: Fri, 19 Dec 2025 10:22:17 +0800 Subject: [PATCH 09/14] docs: rewrite README#Use-examples, add 4 methods to start qwen code --- README.md | 96 ++++++++++--------------------------------------------- 1 file changed, 16 insertions(+), 80 deletions(-) diff --git a/README.md b/README.md index afbb6506..cad682e3 100644 --- a/README.md +++ b/README.md @@ -74,99 +74,35 @@ qwen ## Usage Examples -If you want to learn more about common workflows, click [Common Workflows](https://qwenlm.github.io/qwen-code-docs/en/users/common-workflow/) to view. - -### 🔍 Explore Codebases +### 1️⃣ Interactive Mode ```bash 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 +Navigate to your project folder and type `qwen` to launch Qwen Code. Start a conversation and use `@` to reference files within the folder. + +If you want to learn more about common workflows, click [Common Workflows](https://qwenlm.github.io/qwen-code-docs/en/users/common-workflow/) to view. + +### 2️⃣ Headless Mode ```bash -# 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 +cd your-project/ +qwen -p "your question" ``` +[Headless mode](https://qwenlm.github.io/qwen-code-docs/en/users/features/headless) allows you to run Qwen Code programmatically from command line scripts and automation tools without any interactive UI. This is ideal for scripting, automation, CI/CD pipelines, and building AI-powered tools. -### 🔄 Automate Workflows +### 3️⃣ Use in IDE +If you prefer to integrate Qwen Code into your current editor, we now support VS Code and Zed. For details, please refer to: -```bash -# 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 +- [Use in VS Code](https://qwenlm.github.io/qwen-code-docs/en/users/integration-vscode/) +- [Use in Zed](https://qwenlm.github.io/qwen-code-docs/en/users/integration-zed/) -# 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 -``` +### 4️⃣ SDK +Qwen Code now supports an SDK designed to simplify integration with the Qwen Code platform. It provides a set of easy-to-use APIs and tools enabling developers to efficiently build, test, and deploy applications. For details, please refer to: -### 🐛 Debugging & Analysis - -```bash -# 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 - -```text -> 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 - -```text -> 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 - -```text -> 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 - -```text -> 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 -``` +- [Use the Qwen Code SDK](./packages/sdk-typescript/README.md) ## Commands & Shortcuts From abd9ee2a7bbf20c2bd168a228b2779dab2fdb866 Mon Sep 17 00:00:00 2001 From: joeytoday Date: Fri, 19 Dec 2025 10:28:07 +0800 Subject: [PATCH 10/14] docs: updated quick start video --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cad682e3..a9ab94ec 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,7 @@ qwen > Generate unit tests for this module ``` -![](https://gw.alicdn.com/imgextra/i2/O1CN01bgnQbj1XcrWfFWeNc_!!6000000002945-1-tps-852-480.gif) +[![qwencode-start](https://img.alicdn.com/imgextra/i3/6000000004682/O1CN01cSWkqj1kSPUZPj68h_!!6000000004682-0-tbvideo.jpg)](https://cloud.video.taobao.com/vod/HLfyppnCHplRV9Qhz2xSqeazHeRzYtG-EYJnHAqtzkQ.mp4) ## Usage Examples From 80bb2890df4d191cf5d990e7452323982b2f1d57 Mon Sep 17 00:00:00 2001 From: joeytoday Date: Fri, 19 Dec 2025 10:33:20 +0800 Subject: [PATCH 11/14] docs: Enhanced Video Playback Guidance --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index a9ab94ec..0e978cbc 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,8 @@ qwen > Generate unit tests for this module ``` +👇 Click to play video + [![qwencode-start](https://img.alicdn.com/imgextra/i3/6000000004682/O1CN01cSWkqj1kSPUZPj68h_!!6000000004682-0-tbvideo.jpg)](https://cloud.video.taobao.com/vod/HLfyppnCHplRV9Qhz2xSqeazHeRzYtG-EYJnHAqtzkQ.mp4) From 50e03f2dd6b45baaa21bf1a4984a6beb5528fa57 Mon Sep 17 00:00:00 2001 From: pomelo-nwu Date: Mon, 22 Dec 2025 21:11:33 +0800 Subject: [PATCH 12/14] feat: update docs --- CONTRIBUTING.md | 110 ++++++++++++++++++++++++------------------------ Makefile | 10 ++--- 2 files changed, 61 insertions(+), 59 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a8f053ee..84aa5520 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,27 +2,6 @@ We would love to accept your patches and contributions to this project. -## Before you begin - -### Sign our Contributor License Agreement - -Contributions to this project must be accompanied by a -[Contributor License Agreement](https://cla.developers.google.com/about) (CLA). -You (or your employer) retain the copyright to your contribution; this simply -gives us permission to use and redistribute your contributions as part of the -project. - -If you or your current employer have already signed the Google CLA (even if it -was for a different project), you probably don't need to do it again. - -Visit to see your current agreements or to -sign a new one. - -### Review our Community Guidelines - -This project follows [Google's Open Source Community -Guidelines](https://opensource.google/conduct/). - ## Contribution Process ### Code Reviews @@ -74,12 +53,6 @@ Your PR should have a clear, descriptive title and a detailed description of the In the PR description, explain the "why" behind your changes and link to the relevant issue (e.g., `Fixes #123`). -## Forking - -If you are forking the repository you will be able to run the Build, Test and Integration test workflows. However in order to make the integration tests run you'll need to add a [GitHub Repository Secret](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-a-repository) with a value of `GEMINI_API_KEY` and set that to a valid API key that you have available. Your key and secret are private to your repo; no one without access can see your key and you cannot see any secrets related to this repo. - -Additionally you will need to click on the `Actions` tab and enable workflows for your repository, you'll find it's the large blue button in the center of the screen. - ## Development Setup and Workflow This section guides contributors on how to build, modify, and understand the development setup of this project. @@ -98,8 +71,8 @@ This section guides contributors on how to build, modify, and understand the dev To clone the repository: ```bash -git clone https://github.com/google-gemini/gemini-cli.git # Or your fork's URL -cd gemini-cli +git clone https://github.com/QwenLM/qwen-code.git # Or your fork's URL +cd qwen-code ``` To install dependencies defined in `package.json` as well as root dependencies: @@ -118,9 +91,9 @@ This command typically compiles TypeScript to JavaScript, bundles assets, and pr ### Enabling Sandboxing -[Sandboxing](#sandboxing) is highly recommended and requires, at a minimum, setting `GEMINI_SANDBOX=true` in your `~/.env` and ensuring a sandboxing provider (e.g. `macOS Seatbelt`, `docker`, or `podman`) is available. See [Sandboxing](#sandboxing) for details. +[Sandboxing](#sandboxing) is highly recommended and requires, at a minimum, setting `QWEN_SANDBOX=true` in your `~/.env` and ensuring a sandboxing provider (e.g. `macOS Seatbelt`, `docker`, or `podman`) is available. See [Sandboxing](#sandboxing) for details. -To build both the `gemini` CLI utility and the sandbox container, run `build:all` from the root directory: +To build both the `qwen-code` CLI utility and the sandbox container, run `build:all` from the root directory: ```bash npm run build:all @@ -130,13 +103,13 @@ To skip building the sandbox container, you can use `npm run build` instead. ### Running -To start the Gemini CLI from the source code (after building), run the following command from the root directory: +To start the Qwen Code application from the source code (after building), run the following command from the root directory: ```bash npm start ``` -If you'd like to run the source build outside of the gemini-cli folder, you can utilize `npm link path/to/gemini-cli/packages/cli` (see: [docs](https://docs.npmjs.com/cli/v9/commands/npm-link)) or `alias gemini="node path/to/gemini-cli/packages/cli"` to run with `gemini` +If you'd like to run the source build outside of the qwen-code folder, you can utilize `npm link path/to/qwen-code/packages/cli` (see: [docs](https://docs.npmjs.com/cli/v9/commands/npm-link)) to run with `qwen-code` ### Running Tests @@ -154,7 +127,7 @@ This will run tests located in the `packages/core` and `packages/cli` directorie #### Integration Tests -The integration tests are designed to validate the end-to-end functionality of the Gemini CLI. They are not run as part of the default `npm run test` command. +The integration tests are designed to validate the end-to-end functionality of Qwen Code. They are not run as part of the default `npm run test` command. To run the integration tests, use the following command: @@ -209,19 +182,61 @@ npm run lint ### Coding Conventions - Please adhere to the coding style, patterns, and conventions used throughout the existing codebase. -- Consult [QWEN.md](https://github.com/QwenLM/qwen-code/blob/main/QWEN.md) (typically found in the project root) for specific instructions related to AI-assisted development, including conventions for React, comments, and Git usage. - **Imports:** Pay special attention to import paths. The project uses ESLint to enforce restrictions on relative imports between packages. ### Project Structure - `packages/`: Contains the individual sub-packages of the project. - `cli/`: The command-line interface. - - `core/`: The core backend logic for the Gemini CLI. + - `core/`: The core backend logic for Qwen Code. - `docs/`: Contains all project documentation. - `scripts/`: Utility scripts for building, testing, and development tasks. For more detailed architecture, see `docs/architecture.md`. +## Documentation Development + +This section describes how to develop and preview the documentation locally. + +### Prerequisites + +1. Ensure you have Node.js (version 18+) installed +2. Have npm or yarn available + +### Setup Documentation Site Locally + +To work on the documentation and preview changes locally: + +1. Navigate to the `docs-site` directory: + + ```bash + cd docs-site + ``` + +2. Install dependencies: + + ```bash + npm install + ``` + +3. Link the documentation content from the main `docs` directory: + + ```bash + npm run link + ``` + + This creates a symbolic link from `../docs` to `content` in the docs-site project, allowing the documentation content to be served by the Next.js site. + +4. Start the development server: + + ```bash + npm run dev + ``` + +5. Open [http://localhost:3000](http://localhost:3000) in your browser to see the documentation site with live updates as you make changes. + +Any changes made to the documentation files in the main `docs` directory will be reflected immediately in the documentation site. + ## Debugging ### VS Code: @@ -231,7 +246,7 @@ For more detailed architecture, see `docs/architecture.md`. ```bash npm run debug ``` - This command runs `node --inspect-brk dist/gemini.js` within the `packages/cli` directory, pausing execution until a debugger attaches. You can then open `chrome://inspect` in your Chrome browser to connect to the debugger. + This command runs `node --inspect-brk dist/index.js` within the `packages/cli` directory, pausing execution until a debugger attaches. You can then open `chrome://inspect` in your Chrome browser to connect to the debugger. 2. In VS Code, use the "Attach" launch configuration (found in `.vscode/launch.json`). Alternatively, you can use the "Launch Program" configuration in VS Code if you prefer to launch the currently open file directly, but 'F5' is generally recommended. @@ -239,16 +254,16 @@ Alternatively, you can use the "Launch Program" configuration in VS Code if you To hit a breakpoint inside the sandbox container run: ```bash -DEBUG=1 gemini +DEBUG=1 qwen-code ``` -**Note:** If you have `DEBUG=true` in a project's `.env` file, it won't affect gemini-cli due to automatic exclusion. Use `.gemini/.env` files for gemini-cli specific debug settings. +**Note:** If you have `DEBUG=true` in a project's `.env` file, it won't affect qwen-code due to automatic exclusion. Use `.qwen-code/.env` files for qwen-code specific debug settings. ### React DevTools To debug the CLI's React-based UI, you can use React DevTools. Ink, the library used for the CLI's interface, is compatible with React DevTools version 4.x. -1. **Start the Gemini CLI in development mode:** +1. **Start the Qwen Code application in development mode:** ```bash DEV=true npm start @@ -270,23 +285,10 @@ To debug the CLI's React-based UI, you can use React DevTools. Ink, the library ``` Your running CLI application should then connect to React DevTools. - ![](/docs/assets/connected_devtools.png) ## Sandboxing -### macOS Seatbelt - -On macOS, `qwen` uses Seatbelt (`sandbox-exec`) under a `permissive-open` profile (see `packages/cli/src/utils/sandbox-macos-permissive-open.sb`) that restricts writes to the project folder but otherwise allows all other operations and outbound network traffic ("open") by default. You can switch to a `restrictive-closed` profile (see `packages/cli/src/utils/sandbox-macos-restrictive-closed.sb`) that declines all operations and outbound network traffic ("closed") by default by setting `SEATBELT_PROFILE=restrictive-closed` in your environment or `.env` file. Available built-in profiles are `{permissive,restrictive}-{open,closed,proxied}` (see below for proxied networking). You can also switch to a custom profile `SEATBELT_PROFILE=` if you also create a file `.qwen/sandbox-macos-.sb` under your project settings directory `.qwen`. - -### Container-based Sandboxing (All Platforms) - -For stronger container-based sandboxing on macOS or other platforms, you can set `GEMINI_SANDBOX=true|docker|podman|` in your environment or `.env` file. The specified command (or if `true` then either `docker` or `podman`) must be installed on the host machine. Once enabled, `npm run build:all` will build a minimal container ("sandbox") image and `npm start` will launch inside a fresh instance of that container. The first build can take 20-30s (mostly due to downloading of the base image) but after that both build and start overhead should be minimal. Default builds (`npm run build`) will not rebuild the sandbox. - -Container-based sandboxing mounts the project directory (and system temp directory) with read-write access and is started/stopped/removed automatically as you start/stop Gemini CLI. Files created within the sandbox should be automatically mapped to your user/group on host machine. You can easily specify additional mounts, ports, or environment variables by setting `SANDBOX_{MOUNTS,PORTS,ENV}` as needed. You can also fully customize the sandbox for your projects by creating the files `.qwen/sandbox.Dockerfile` and/or `.qwen/sandbox.bashrc` under your project settings directory (`.qwen`) and running `qwen` with `BUILD_SANDBOX=1` to trigger building of your custom sandbox. - -#### Proxied Networking - -All sandboxing methods, including macOS Seatbelt using `*-proxied` profiles, support restricting outbound network traffic through a custom proxy server that can be specified as `GEMINI_SANDBOX_PROXY_COMMAND=`, where `` must start a proxy server that listens on `:::8877` for relevant requests. See `docs/examples/proxy-script.md` for a minimal proxy that only allows `HTTPS` connections to `example.com:443` (e.g. `curl https://example.com`) and declines all other requests. The proxy is started and stopped automatically alongside the sandbox. +> TBD ## Manual Publish diff --git a/Makefile b/Makefile index fc540ccc..db8cba23 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ -# Makefile for gemini-cli +# Makefile for qwen-code .PHONY: help install build build-sandbox build-all test lint format preflight clean start debug release run-npx create-alias help: - @echo "Makefile for gemini-cli" + @echo "Makefile for qwen-code" @echo "" @echo "Usage:" @echo " make install - Install npm dependencies" @@ -14,11 +14,11 @@ help: @echo " make format - Format the code" @echo " make preflight - Run formatting, linting, and tests" @echo " make clean - Remove generated files" - @echo " make start - Start the Gemini CLI" - @echo " make debug - Start the Gemini CLI in debug mode" + @echo " make start - Start the Qwen Code CLI" + @echo " make debug - Start the Qwen Code CLI in debug mode" @echo "" @echo " make run-npx - Run the CLI using npx (for testing the published package)" - @echo " make create-alias - Create a 'gemini' alias for your shell" + @echo " make create-alias - Create a 'qwen' alias for your shell" install: npm install From 0d43ddee2a9e37b6d63d0ff1a58b199c38d973e8 Mon Sep 17 00:00:00 2001 From: pomelo-nwu Date: Mon, 22 Dec 2025 22:49:51 +0800 Subject: [PATCH 13/14] feat: update readme.md --- README.md | 166 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 105 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index 0574293e..fef5541b 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,11 @@ -# Qwen Code -
-![](https://gw.alicdn.com/imgextra/i1/O1CN01D2DviS1wwtEtMwIzJ_!!6000000006373-2-tps-1600-900.png) - [![npm version](https://img.shields.io/npm/v/@qwen-code/qwen-code.svg)](https://www.npmjs.com/package/@qwen-code/qwen-code) [![License](https://img.shields.io/github/license/QwenLM/qwen-code.svg)](./LICENSE) [![Node.js Version](https://img.shields.io/badge/node-%3E%3D20.0.0-brightgreen.svg)](https://nodejs.org/) [![Downloads](https://img.shields.io/npm/dm/@qwen-code/qwen-code.svg)](https://www.npmjs.com/package/@qwen-code/qwen-code) -**AI-powered command-line workflow tool for developers** +**An open-source AI agent that lives in your terminal.** 中文 | Deutsch | @@ -17,93 +13,137 @@ 日本語 | Русский -[Installation](#install-from-npm) • [Quick Start](#-quick-start) • [Features](#-why-qwen-code) • [Documentation](https://qwenlm.github.io/qwen-code-docs/en/users/overview/) • [Contributing](https://qwenlm.github.io/qwen-code-docs/en/developers/contributing/) -
-Qwen Code is a powerful command-line AI workflow tool adapted from [**Gemini CLI**](https://github.com/google-gemini/gemini-cli), specifically optimized for [Qwen3-Coder](https://github.com/QwenLM/Qwen3-Coder) models. It enhances your development workflow with advanced code understanding, automated tasks, and intelligent assistance. +Qwen Code is an open-source AI agent for the terminal, optimized for [Qwen3-Coder](https://github.com/QwenLM/Qwen3-Coder). It helps you understand large codebases, automate tedious work, and ship faster. -> [!NOTE] -> 🖥️ There is also a powerful **desktop/web/mobile** UI for Qwen Code/Gemini CLI called [**Gemini CLI Desktop**](https://github.com/Piebald-AI/gemini-cli-desktop). +![](https://gw.alicdn.com/imgextra/i1/O1CN01D2DviS1wwtEtMwIzJ_!!6000000006373-2-tps-1600-900.png) -## 📌 Why Qwen Code? +## Why Qwen Code? -- 🎯 Free Access Available: Get started with 2,000 free requests per day via Qwen OAuth. -- 🧠 Code Understanding & Editing - Query and edit large codebases beyond traditional context window limits -- 🤖 Workflow Automation - Automate operational tasks like handling pull requests and complex rebases -- 💻 Terminal-first: Designed for developers who live in the command line. -- 🧰 VS Code: Install the VS Code extension to seamlessly integrate into your existing workflow. -- 📦 Simple Setup: Easy installation with npm, Homebrew, or source for quick deployment. +- **OpenAI-compatible, OAuth free-tier**: use an OpenAI-compatible API, or sign in with Qwen OAuth to get 2,000 free requests/day. +- **Open-source, co-evolving**: both the framework and the Qwen3-Coder model are open-source—and they ship and evolve together. +- **Agentic workflow, feature-rich**: rich built-in tools (Skills, SubAgents, Plan Mode) for a full agentic workflow and a Claude Code-like experience. +- **Terminal-first, IDE-friendly**: built for developers who live in the command line, with optional integration for VS Code and Zed. -> 👉 Know more [workflows](https://qwenlm.github.io/qwen-code-docs/en/users/common-workflow/) -> -> 📦 The extension is currently in development. For installation, features, and development guide, see the [VS Code Extension README](./packages/vscode-ide-companion/README.md). +## Installation -## ❓ How to use Qwen Code? - -### Prerequisites - -Ensure you have [Node.js version 20](https://nodejs.org/en/download) or higher installed. +#### Prerequisites ```bash +# Node.js 20+ curl -qL https://www.npmjs.com/install.sh | sh ``` -### Install from npm +#### NPM (recommended) ```bash npm install -g @qwen-code/qwen-code@latest ``` -## 🚀 Quick Start +#### Homebrew (macOS, Linux) ```bash -# 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 +brew install qwen-code ``` -👇 Click to play video +## Quick Start -[![qwencode-start](https://img.alicdn.com/imgextra/i3/6000000004682/O1CN01cSWkqj1kSPUZPj68h_!!6000000004682-0-tbvideo.jpg)](https://cloud.video.taobao.com/vod/HLfyppnCHplRV9Qhz2xSqeazHeRzYtG-EYJnHAqtzkQ.mp4) +```bash +# Start Qwen Code (interactive) +qwen -## Usage Examples +# Then, in the session: +/help +/auth +``` -### 1️⃣ Interactive Mode +On first use you'll be prompted to sign in. You can run `/auth` anytime to switch authentication methods. + +Example prompts: + +```text +What does this project do? +Explain the codebase structure. +Help me refactor this function. +Generate unit tests for this module. +``` + +
+Click to watch a demo video + + + +
+ +## Authentication + +Qwen Code supports two authentication methods: + +- **Qwen OAuth (recommended & free)**: sign in with your `qwen.ai` account in a browser. +- **OpenAI-compatible API**: use `OPENAI_API_KEY` (and optionally a custom base URL / model). + +#### Qwen OAuth (recommended) + +Start `qwen`, then run: + +```bash +/auth +``` + +Choose **Qwen OAuth** and complete the browser flow. Your credentials are cached locally so you usually won't need to log in again. + +#### OpenAI-compatible API (API key) + +Environment variables (recommended for CI / headless environments): + +```bash +export OPENAI_API_KEY="your-api-key-here" +export OPENAI_BASE_URL="https://api.openai.com/v1" # optional +export OPENAI_MODEL="gpt-4o" # optional +``` + +For details (including `.qwen/.env` loading and security notes), see the [authentication guide](https://qwenlm.github.io/qwen-code-docs/en/users/configuration/auth/). + +## Usage + +As an open-source terminal agent, you can use Qwen Code in four primary ways: + +1. Interactive mode (terminal UI) +2. Headless mode (scripts, CI) +3. IDE integration (VS Code, Zed) +4. TypeScript SDK + +#### Interactive mode ```bash cd your-project/ qwen ``` -Navigate to your project folder and type `qwen` to launch Qwen Code. Start a conversation and use `@` to reference files within the folder. +Run `qwen` in your project folder to launch the interactive terminal UI. Use `@` to reference local files (for example `@src/main.ts`). -If you want to learn more about common workflows, click [Common Workflows](https://qwenlm.github.io/qwen-code-docs/en/users/common-workflow/) to view. - -### 2️⃣ Headless Mode +#### Headless mode ```bash cd your-project/ qwen -p "your question" ``` -[Headless mode](https://qwenlm.github.io/qwen-code-docs/en/users/features/headless) allows you to run Qwen Code programmatically from command line scripts and automation tools without any interactive UI. This is ideal for scripting, automation, CI/CD pipelines, and building AI-powered tools. +Use `-p` to run Qwen Code without the interactive UI—ideal for scripts, automation, and CI/CD. Learn more: [Headless mode](https://qwenlm.github.io/qwen-code-docs/en/users/features/headless). -### 3️⃣ Use in IDE +#### IDE integration -If you prefer to integrate Qwen Code into your current editor, we now support VS Code and Zed. For details, please refer to: +Use Qwen Code inside your editor (VS Code and Zed): - [Use in VS Code](https://qwenlm.github.io/qwen-code-docs/en/users/integration-vscode/) - [Use in Zed](https://qwenlm.github.io/qwen-code-docs/en/users/integration-zed/) -### 4️⃣ SDK +#### TypeScript SDK -Qwen Code now supports an SDK designed to simplify integration with the Qwen Code platform. It provides a set of easy-to-use APIs and tools enabling developers to efficiently build, test, and deploy applications. For details, please refer to: +Build on top of Qwen Code with the TypeScript SDK: - [Use the Qwen Code SDK](./packages/sdk-typescript/README.md) @@ -115,6 +155,7 @@ Qwen Code now supports an SDK designed to simplify integration with the Qwen Cod - `/clear` - Clear conversation history - `/compress` - Compress history to save tokens - `/stats` - Show current session information +- `/bug` - Submit a bug report - `/exit` or `/quit` - Exit Qwen Code ### Keyboard Shortcuts @@ -123,9 +164,18 @@ Qwen Code now supports an SDK designed to simplify integration with the Qwen Cod - `Ctrl+D` - Exit (on empty line) - `Up/Down` - Navigate command history -> 👉 Know more about [Commands](https://qwenlm.github.io/qwen-code-docs/en/users/features/commands/) +> Learn more about [Commands](https://qwenlm.github.io/qwen-code-docs/en/users/features/commands/) > -> 💡 **Tip**: In YOLO mode (`--yolo`), vision switching happens automatically without prompts when images are detected. Know more about [Approval Mode](https://qwenlm.github.io/qwen-code-docs/en/users/features/approval-mode/) +> **Tip**: In YOLO mode (`--yolo`), vision switching happens automatically without prompts when images are detected. Learn more about [Approval Mode](https://qwenlm.github.io/qwen-code-docs/en/users/features/approval-mode/) + +## Configuration + +Qwen Code can be configured via `settings.json`, environment variables, and CLI flags. + +- **User settings**: `~/.qwen/settings.json` +- **Project settings**: `.qwen/settings.json` + +See [settings](https://qwenlm.github.io/qwen-code-docs/en/users/configuration/settings/) for available options and precedence. ## Benchmark Results @@ -136,24 +186,18 @@ Qwen Code now supports an SDK designed to simplify integration with the Qwen Cod | Qwen Code | Qwen3-Coder-480A35 | 37.5% | | Qwen Code | Qwen3-Coder-30BA3B | 31.3% | -## Development & Contributing +## Ecosystem -See [CONTRIBUTING.md](https://qwenlm.github.io/qwen-code-docs/en/developers/contributing/) to learn how to contribute to the project. +Looking for a graphical interface? -For detailed authentication setup, see the [authentication guide](https://qwenlm.github.io/qwen-code-docs/en/users/configuration/auth/). +- [**Gemini CLI Desktop**](https://github.com/Piebald-AI/gemini-cli-desktop) A cross-platform desktop/web/mobile UI for Qwen Code ## Troubleshooting If you encounter issues, check the [troubleshooting guide](https://qwenlm.github.io/qwen-code-docs/en/users/support/troubleshooting/). +To report a bug from within the CLI, run `/bug` and include a short title and repro steps. + ## Acknowledgments This project is based on [Google Gemini CLI](https://github.com/google-gemini/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](./LICENSE) - -## Star History - -[![Star History Chart](https://api.star-history.com/svg?repos=QwenLM/qwen-code&type=Date)](https://www.star-history.com/#QwenLM/qwen-code&Date) From bbbdeb280daebd895f23e2f123a7088bdda4058c Mon Sep 17 00:00:00 2001 From: pomelo-nwu Date: Mon, 22 Dec 2025 23:00:09 +0800 Subject: [PATCH 14/14] =?UTF-8?q?feat:=20add=20Portugu=C3=AAs=20link?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index fef5541b..022ea727 100644 --- a/README.md +++ b/README.md @@ -7,11 +7,12 @@ **An open-source AI agent that lives in your terminal.** -中文 | -Deutsch | -français | -日本語 | -Русский +中文 | +Deutsch | +français | +日本語 | +Русский | +Português (Brasil) @@ -21,7 +22,7 @@ Qwen Code is an open-source AI agent for the terminal, optimized for [Qwen3-Code ## Why Qwen Code? -- **OpenAI-compatible, OAuth free-tier**: use an OpenAI-compatible API, or sign in with Qwen OAuth to get 2,000 free requests/day. +- **OpenAI-compatible, OAuth free tier**: use an OpenAI-compatible API, or sign in with Qwen OAuth to get 2,000 free requests/day. - **Open-source, co-evolving**: both the framework and the Qwen3-Coder model are open-source—and they ship and evolve together. - **Agentic workflow, feature-rich**: rich built-in tools (Skills, SubAgents, Plan Mode) for a full agentic workflow and a Claude Code-like experience. - **Terminal-first, IDE-friendly**: built for developers who live in the command line, with optional integration for VS Code and Zed. @@ -58,7 +59,7 @@ qwen /auth ``` -On first use you'll be prompted to sign in. You can run `/auth` anytime to switch authentication methods. +On first use, you'll be prompted to sign in. You can run `/auth` anytime to switch authentication methods. Example prompts: