Qwen Code is an open-source AI coding agent from the Qwen team that runs in your terminal as the qwen command (QwenLM/qwen-code). You install it with a one-line script or from npm as @qwen-code/qwen-code, run qwen in a project folder, and sign in with /auth.
At a glance
| Licence | Apache 2.0 |
| Announced | 22 July 2025, with Qwen3-Coder (Qwen blog) |
| Latest stable release | v0.29.2, published 2 December 2026 (release notes) |
| npm requirement | Node.js 22 or later (README) |
| Command | qwen (README) |
| User settings file | ~/.qwen/settings.json (settings docs) |
| Free Qwen OAuth allowance | Discontinued on 15 April 2026 (terms page) |
What it is
The repository describes Qwen Code as "the open-source AI coding agent for your terminal, editor, desktop, browser, and chat".
The README quickstart uses the terminal. It also lists other ways to run it:
- a desktop app for macOS, Windows and Linux
- a web UI started with
qwen serve --open(marked experimental) - editor integrations for VS Code, Zed and JetBrains
- chat channels such as Telegram, DingTalk, WeChat and Feishu
- headless runs with
qwen -p "..."for scripts and CI - SDKs for TypeScript, Python and Java
The README says it supports the OpenAI, Anthropic, Gemini and Qwen APIs and local models served by Ollama or vLLM. Built-in features include subagents, skills, hooks, a read-only plan mode and sandboxing, and you can connect MCP servers.
A separate 1.0 line is in preview. The README says "Qwen Code 1.0 Preview brings together the agent harness capabilities of Qoder and Qwen Code in an open-source release". It was tagged as a pre-release, v1.0.0-preview, on 11 November 2026. The install commands below are for the main version, whose current stable release is v0.29.2.
Install
The quickstart recommends the standalone installer.
On Linux or macOS:
curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen-standalone.sh | bash
On Windows (PowerShell):
irm https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen-standalone.ps1 | iex
With npm, which needs Node.js 22 or later, or with Homebrew:
npm install -g @qwen-code/qwen-code@latest
brew install qwen-code
Restart your terminal after installing so the new environment variables take effect. Then start it in a project:
cd /path/to/your-project
qwen
Signing in
On first run, and whenever you type /auth, Qwen Code shows five options (authentication docs):
- Qwen Account with Subscription (Qwen OAuth). You sign in through the browser with a Qwen account that has an active Plus or Pro subscription from chat.qwen.ai. This needs a browser, so the docs recommend an API key for CI and containers.
- QwenCloud. Choose Token Plan (a subscription with a monthly credit quota) or Standard API Key (pay as you go). Then pick the platform: 千问AI平台 for China or QwenCloud for international accounts. Token Plan keys start with
sk-sp-. - Alibaba ModelStudio. Choose Coding Plan (for individual developers, with a weekly quota), Token Plan (for teams, usage-based billing on a dedicated endpoint) or Standard API Key. Coding Plan uses its own endpoints,
https://coding.dashscope.aliyuncs.com/v1for Beijing andhttps://coding-intl.dashscope.aliyuncs.com/v1for the international region. - Third-party providers. Built-in presets for DeepSeek, Grok, MiniMax, Z.AI, Kimi, Idealab, ModelScope, OpenRouter and Requesty.
- Custom provider. Any OpenAI-compatible, Anthropic or Gemini endpoint, including a local server or a proxy.
For scripts, you can skip /auth and set environment variables. With environment variables alone, the key goes in OPENAI_API_KEY. For a QwenCloud pay-as-you-go key:
export OPENAI_API_KEY="sk-your-api-key"
export OPENAI_BASE_URL="https://maas.qwencloudapi.com/compatible-mode/v1"
export OPENAI_MODEL="qwen3.8-max"
The docs' own example uses QWENCLOUD_API_KEY. Provider-specific variables like that one only take effect once a settings.json provider entry names them, and the docs say to export OPENAI_API_KEY to select an OpenAI-compatible connection with environment variables alone (authentication docs).
For the Token Plan itself, see the Token Plan explained.
Is there a free tier?
Not for Qwen OAuth. The project's terms page says the subscription sign-in "is separate from the legacy free Qwen OAuth allowance, which was discontinued on 2026-04-15". The authentication docs say Qwen OAuth usage "is subject to your subscription plan" and send readers to chat.qwen.ai for plan details. They do not state prices or quotas for the Plus and Pro plans, so this page does not either.
QwenCloud has a separate free quota for new users: typically 1,000,000 tokens per model, usually valid for 90 days, in the Singapore region only, and only for calls made with a pay-as-you-go API key. Token Plan keys (sk-sp-) draw on Token Plan credits instead. You can use such a key in Qwen Code through the QwenCloud option above.
The tool itself is open source under the Apache 2.0 licence and costs nothing. Model usage is billed by the provider you connect, apart from any free quota it offers. A local model served by Ollama or vLLM, which the README lists as supported, has no API charge. See running Qwen locally.
Which models it uses
There is no single fixed model. You configure models for one or more providers, and /model switches between the models you have configured. You can also pick one at launch with qwen --model "qwen3-coder-plus" (authentication docs).
What the authentication docs name for each option:
| Sign-in option | Models named in the docs |
|---|---|
| Qwen OAuth | Not named |
| QwenCloud | qwen3.8-max in the setup examples |
| ModelStudio Coding Plan | qwen3.5-plus, qwen3.6-plus, qwen3.7-plus, qwen3-coder-plus, qwen3-coder-next, qwen3-max-2026-01-23, glm-5, glm-4.7, kimi-k2.5, MiniMax-M2.5 |
| ModelStudio Token Plan | Not listed; Qwen Code reads the list from your endpoint during setup |
The README reports that seven Qwen Code versions scored between 76.40% and 77.80% on average on SWE-bench Verified, all using Qwen 3.7 Max (README).
For what each model is, see /models.
Main commands
Commands you type inside a session, from the quickstart and the command reference:
| Command | What it does |
|---|---|
/auth | Change the sign-in method |
/model | Switch the model for this session |
/init | Analyse the current directory and create a context file |
/plan | Enter or leave plan mode |
/approval-mode | Change how tool calls are approved |
/compress | Replace the chat history with a summary to save tokens |
/resume | Resume an earlier session |
/mcp | List configured MCP servers and tools |
/memory | Open the memory manager |
/doctor | Check authentication and environment |
/quit | Exit |
Qwen Code loads QWEN.md and AGENTS.md files automatically as project instructions (README).
Settings files
Qwen Code reads settings from four files (settings docs):
- user:
~/.qwen/settings.json - project:
.qwen/settings.jsonin the project root, which overrides user settings - system:
/etc/qwen-code/settings.jsonon Linux, which overrides user and project settings - system defaults:
/etc/qwen-code/system-defaults.jsonon Linux
The authentication docs give this user file for a Model Studio Token Plan in the Beijing region:
{
"modelProviders": {
"openai": [
{
"id": "qwen3.7-plus",
"name": "qwen3.7-plus (Token Plan)",
"baseUrl": "https://token-plan.cn-beijing.maas.aliyuncs.com/compatible-mode/v1",
"description": "qwen3.7-plus from Alibaba Cloud Token Plan",
"envKey": "BAILIAN_TOKEN_PLAN_API_KEY"
}
]
},
"env": {
"BAILIAN_TOKEN_PLAN_API_KEY": "your-api-key"
},
"security": {
"auth": {
"selectedType": "openai"
}
},
"model": {
"name": "qwen3.7-plus"
}
}
According to the authentication docs, keys in the env block are stored in plain text, and the docs recommend a .env file or a shell export for secrets. Qwen Code looks for .qwen/.env, then .env, walking up from the current directory, and then falls back to ~/.qwen/.env and ~/.env.
How it relates to Gemini CLI
Qwen Code began as a fork of Google's Gemini CLI, as its README and the Qwen3-Coder announcement both state. The Qwen3-Coder announcement says it was "Forked from Gemini Code" and adapted "with customized prompts and function calling protocols" for Qwen3-Coder.
The project's README says it "was originally based on Google Gemini CLI v0.8.2" and that "Starting from Qwen Code v0.1, we stopped syncing with upstream and began independent development" (README).