Official terminal-based AI coding tool
Qwen Code is a terminal-based AI coding tool. Connect it to QwenCloud via Token Plan (Personal Edition), Token Plan (Team Edition), Coding Plan, or pay-as-you-go billing.
Qwen Code supports the following scenarios:
Launch Qwen Code and type
Edit or create a
Launch Qwen Code and type
Launch Qwen Code and type
Launch Qwen Code and type
After configuration is complete, run the following command in your project directory to launch Qwen Code and start a conversation.
Qwen Code supports usage as a plugin in VS Code and JetBrains IDE, providing AI coding capabilities within the IDE.
Ensure your VS Code version is 1.85.0 or higher before use.
Ensure your JetBrains IDE supports Agent Client Protocol (ACP) before use.
Qwen Code Desktop is the GUI application of Qwen Code with a built-in CLI runtime, requiring no additional command-line tool installation. The desktop version shares the same
For more advanced features of Qwen Code, see the Qwen Code official documentation.
If you encounter errors during configuration, refer to the FAQ documentation for your billing plan:
Type the
Common scenarios
Qwen Code supports the following scenarios:
- AI-assisted coding: Generate, complete, and review code from the terminal using natural language to speed up everyday development.
- Web development: Provide a screenshot of a target website, and Qwen Code parses the page structure to generate high-fidelity front-end code.
- Video production: Given an open-source repository URL, generate a dedicated promotional video in one step.
Install Qwen Code
- macOS/Linux
- Windows
Open a terminal and run the following command to install Qwen Code.
Configure access credentials
Launch Qwen Code and type /auth for visual configuration. QwenCloud offers the following billing plans. Choose based on your needs:
- Token Plan (Personal Edition): Deducts personal Credits based on token consumption.
- Token Plan (Team Edition): Subscription per seat, with token consumption deducted from Credits.
- Coding Plan: Fixed monthly subscription billed by number of model calls.
- Pay-as-you-go: Post-paid based on actual usage.
Token Plan (Personal Edition)
Edit or create a settings.json file and replace YOUR_API_KEY with your Token Plan (Personal Edition) dedicated API Key. Available models include qwen3.8-max, qwen3.7-max, qwen3.7-plus, qwen3.6-flash, glm-5.2, and deepseek-v4-pro. For the full list, see Token Plan (Personal Edition) supported models. The file path is as follows:
- macOS/Linux:
~/.qwen/settings.json - Windows:
C:\Users\<Username>\.qwen\settings.json
qwen3.8-max thinking mode:
- thinking: Supports both enabled and disabled (hybrid thinking mode).
- temperature: Defaults to 0.6 in thinking mode. Values below 0.6 are automatically adjusted to 0.6.
- reasoning_effort: Controls reasoning depth. Options: xhigh, medium, low. Default: xhigh.
Token Plan (Team Edition)
Launch Qwen Code and type /auth, then select Subscription Plan > Alibaba Cloud Model Studio Token Plan, and enter the Token Plan (Team Edition) dedicated API Key to complete the configuration. For available models, see Token Plan (Team Edition) supported models.
Advanced configuration: via settings.json
Advanced configuration: via settings.json
Edit or create a
settings.json file and replace YOUR_API_KEY with your Token Plan (Team Edition) dedicated API Key. The file path is as follows:- macOS/Linux:
~/.qwen/settings.json - Windows:
C:\Users\<Windows username>\.qwen\settings.json
qwen3.8-max thinking mode:
- thinking: Supports both enabled and disabled (hybrid thinking mode).
- temperature: Defaults to 0.6 in thinking mode. Values below 0.6 are automatically adjusted to 0.6.
- reasoning_effort: Controls reasoning depth. Options: xhigh, medium, low. Default: xhigh.
Coding Plan
Launch Qwen Code and type /auth, then select Subscription Plan > Alibaba Cloud Model Studio Coding Plan, choose the Coding Plan region (global), and enter the Coding Plan dedicated API Key to complete the configuration. For available models, see Coding Plan supported models.
Advanced configuration: via settings.json
Advanced configuration: via settings.json
Edit or create a
settings.json file and replace YOUR_API_KEY with your Coding Plan dedicated API Key. The file path is as follows:- macOS/Linux:
~/.qwen/settings.json - Windows:
C:\Users\<Windows username>\.qwen\settings.json
Pay-as-you-go
Launch Qwen Code and type /auth, select Use your own API Key > Standard API Key, then choose the region and enter the QwenCloud API Key to complete the configuration. For available models, see OpenAI compatible - Supported models.
Advanced configuration: via settings.json
Advanced configuration: via settings.json
Edit or create a To add other models, append them in the same format within
settings.json file and replace YOUR_API_KEY with your QwenCloud API Key. The file path is as follows:- macOS/Linux:
~/.qwen/settings.json - Windows:
C:\Users\<Windows username>\.qwen\settings.json
modelProviders.openai.Verify configuration
After configuration is complete, run the following command in your project directory to launch Qwen Code and start a conversation.
Qwen Code IDE plugins
Qwen Code supports usage as a plugin in VS Code and JetBrains IDE, providing AI coding capabilities within the IDE.
VS Code
Ensure your VS Code version is 1.85.0 or higher before use.
- Open VS Code, search for
Qwen Code Companionin the Extensions Marketplace and install it. - The CLI and IDE plugin share the same
settings.json. If you have already completed the configuration above, skip this step. Otherwise, follow the Configure access credentials section above. - Click the icon in the upper-right corner to launch Qwen Code. Type or click
/, then selectSwitch modelto switch models.
JetBrains IDE
Ensure your JetBrains IDE supports Agent Client Protocol (ACP) before use.
- Qwen Code IDE depends on Qwen Code CLI. First, follow the Install Qwen Code section in this document to install and complete Configure access credentials.
- Open JetBrains IDE, go to the AI Chat page, and click Install Plugin. IDEA will install the JetBrains AI Assistant plugin.
-
Click the three-dot menu in the upper-right corner of the AI Chat window, select Add Custom Agent, and fill in the following configuration. Replace
/path/to/qwenwith the Qwen Code installation path. Run the following command to find the path:- macOS/Linux:
which qwen - Windows:
where qwen(CMD) orGet-Command qwen(PowerShell)
- macOS/Linux:
- After configuration, Qwen Code will appear in the AI Chat panel. You can switch models in the lower-right corner.
Qwen Code Desktop
Qwen Code Desktop is the GUI application of Qwen Code with a built-in CLI runtime, requiring no additional command-line tool installation. The desktop version shares the same settings.json configuration file with the CLI. If you have already completed configuration through the CLI, the desktop version is ready to use without additional setup.
Visit the Qwen Code GitHub Releases page to download the desktop installer for your operating system (macOS, Windows, or Linux).
If you have not configured yet, you can do so through the desktop GUI:
- Open Qwen Code Desktop, click Settings on the left sidebar, and select the AI tab.
- In the Model Provider section, click + Connect.
- In the popup, select the QwenCloud tab and choose the billing plan that suits your needs:
- Coding Plan: For individual developers, metered by invocations.
- Token Plan: For teams, billed by token consumption.
- Standard API Key: Pay-as-you-go with an existing QwenCloud API Key.
- Enter the API Key as prompted to complete the configuration.
Common commands
The following commands apply to Qwen Code CLI. The IDE plugin only supports some commands. Please refer to actual usage.
| Command | Description | Example |
|---|---|---|
/model | Switch the model used in the current session. | /model |
/auth | Change the authentication method. | /auth |
/init | Analyze the current directory and create an initial context file (QWEN.md). | /init |
/clear | Clear the terminal screen and start a new conversation. | /clear |
/compress | Replace chat history with a summary to save tokens. | /compress |
/settings | Open the settings editor to configure language, theme, and more. | /settings |
/summary | Generate a project summary based on the conversation history. | /summary |
/resume | Resume a previous conversation session. | /resume |
/stats | Display detailed statistics for the current session. | /stats |
/help | Display help information for available commands. | /help or /? |
/quit | Exit Qwen Code. | /quit |
Learn more
- For advanced features such as sub-agents, MCP, and Skills in Qwen Code, see the Qwen Code official documentation.
- For Qwen Code use cases, see Use Cases.
FAQ
Error codes
If you encounter errors during configuration, refer to the FAQ documentation for your billing plan:
- Pay-as-you-go: Error codes and troubleshooting
- Coding Plan: Coding Plan FAQ
- Token Plan (Personal Edition): Token Plan FAQ
- Token Plan (Team Edition): Token Plan (Team Edition) FAQ
How to switch models?
Type the /model command directly in Qwen Code to select and switch from the list of models configured in settings.json. To add a new model, add the corresponding configuration under settings.json in the modelProviders section, then restart Qwen Code.