Skip to content

Qwen Code CLI on Windows: Install and First Run

Install and run Qwen Code CLI on Windows. Node setup, API key from DashScope, model config, first task, pricing and coding plan, and the common fixes.

MGMCSA Guru Team June 26, 2026 3 min read
Qwen Code CLI running its first task in a Windows terminal

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-plus is 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.

Frequently asked questions

What is Qwen Code CLI?

Qwen Code is Alibaba's terminal coding agent, adapted from the open Gemini CLI codebase and tuned for Qwen models. It reads your repo, edits files, and runs commands, and works best with Qwen3-Coder via DashScope.

How do I install it on Windows?

It's a Node package, so install Node, then install Qwen Code globally with npm. It runs in PowerShell, but WSL gives the cleaner shell environment that terminal agents expect.

Where do I get the API key?

From Alibaba Cloud Model Studio (DashScope). Create an account, generate an API key, and set it as the environment variable Qwen Code expects. Use the international endpoint outside mainland China.

Can Qwen Code use the Alibaba coding plan?

Yes. You can bill through pay-per-token or Alibaba's Coding Plan (around $50/month for about 90,000 requests, including select third-party models). Heavy daily users usually prefer the plan.

Does Qwen Code support big context?

Yes. Paired with Qwen3-Coder's large context window, it handles big repositories and long sessions well, which is one of the main reasons to choose Qwen for agentic coding.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.