Qwen Code is Alibaba’s own terminal coding agent — adapted from the open Gemini CLI codebase and tuned for Qwen models. If you’re going to use Qwen3-Coder for agentic work, its native CLI is a natural fit, with first-class support for the big context windows the Coder models are known for.
This covers installing and first-running Qwen Code on Windows, getting it talking to DashScope, and the pricing choices. If you’d rather use Qwen through a different agent, see run Qwen3-Coder with Claude Code.
Step 1: Node
Qwen Code is a Node package, so you need Node. On Windows you can install it directly, but WSL gives the cleaner environment terminal agents expect — see the WSL install guide. In WSL, nvm is the tidy way:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install --lts
Step 2: Install Qwen Code
Install it globally with npm (check the project’s current package name in Alibaba’s docs):
npm install -g @qwen-code/qwen-code
Confirm it’s available:
qwen --version
Step 3: API key from DashScope
Create an Alibaba Cloud Model Studio account and generate a DashScope API key. Set it as the environment variable Qwen Code expects (its docs name the exact variable), and use the international endpoint outside mainland China:
export DASHSCOPE_API_KEY="sk-your-key"
Step 4: First run
Point Qwen Code at qwen3-coder-plus and start it in a project folder:
cd ~/myproject
qwen
Give it a small first task — “summarize this repo and list the entry points” — to confirm it reads files and responds. From there it edits files and runs commands like any agent.
Models
Qwen models worth using
| qwen3-coder-plus | Agentic coding, tool calling, big context |
|---|---|
| qwen3-max | Flagship general model (pricier) |
| qwen3.5-plus | Strong general model, low cost |
For Qwen Code, qwen3-coder-plus is the default to beat. Confirm current IDs on Model Studio.
Pricing and coding plan
- Pay-per-token on DashScope, with a cache-hit discount on repeated input.
- Alibaba Coding Plan — about $50/month for roughly 90,000 requests, including select third-party models.
See Alibaba Coding Plan vs pay-per-token to choose. Verify current quotas and rates on Model Studio, as they change.
Troubleshooting
qwen: command not found— npm global bin not on PATH; reopen the shell.- Auth failures — wrong region endpoint, or the API key variable isn’t set.
- Model errors — confirm
qwen3-coder-plusis current on Model Studio. - Slow file ops in WSL — keep the project in your Linux home, not
/mnt/c.
Qwen Code CLI checklist
- Node installed (nvm in WSL recommended)
- Qwen Code installed globally with npm
- DashScope API key set for the right region
- Model set to qwen3-coder-plus
- First task run in a project folder
Wrapping up
Qwen Code CLI is the native way to run Qwen3-Coder as an agent: install Node, add the package with npm, set your DashScope key for the right region, and launch with qwen in a project. Its strength is big context, so it’s a strong pick for large repositories. Choose pay-per-token or the coding plan based on how much you code.
To use Qwen elsewhere, see Qwen3-Coder with Codex CLI or use Qwen with Aider.