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 August 3, 2026 3 min read
Qwen Code CLI running its first task in a Windows terminal

Qwen Code is Qwen’s open-source terminal coding agent. Current releases can use qwen3.8-max, Alibaba’s production flagship, through Model Studio. The CLI can read a repository, edit files, and run commands, so start it in a project where you can review or revert changes.

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 install Node first. Native Windows and WSL both work. See the WSL install guide if the project already uses Linux tooling.

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@latest

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.8-max and start it in a project folder:

cd ~/myproject
qwen

Give it a small first task such as “summarize this repo and list the entry points”. Confirm that it reads files before allowing edits or commands.

Models

Qwen models worth using

qwen3.8-max Current flagship; coding, tools, vision, and 1M context
qwen3.7-plus Lower-cost hosted model for routine work
Qwen3.8-27B Open model for local or self-hosted use

For a new hosted configuration, start with qwen3.8-max. Use the exact ID shown by your provider because local and third-party deployments often use a different name.

Pricing and coding plan

  • Pay-per-token on DashScope, with a cache-hit discount on repeated input.
  • Alibaba’s current Token Plan is credits-based. Check the live plan page for seat prices and credit multipliers.

See Alibaba Coding Plan vs pay-per-token to choose. Verify current quotas and rates on Model Studio, as they change.

Troubleshooting

  • If qwen is not found, reopen the shell and check npm’s global binary path.
  • For authentication failures, check the region endpoint and API key variable.
  • If the model is not found, confirm that qwen3.8-max is available in the selected workspace and region.
  • If file operations are slow in WSL, keep the project in the Linux file system instead of /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.8-max
  • First task run in a project folder

Verify the installation

Run qwen --version, start the CLI in a small repository, and ask it to explain one file without making edits. Once authentication and model selection work, approve a small change and inspect the diff.

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 Qwen's open-source terminal coding agent. It reads repositories, edits files, and runs commands. Current releases can use Qwen3.8-Max through Model Studio or another configured provider.

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. Alibaba offers pay-as-you-go billing and a credits-based Token Plan. The plan uses dedicated keys and endpoints, so compare its current credits allowance with measured API usage.

Does Qwen Code support big context?

Yes. Qwen3.8-Max has a 1 million-token context window, although the CLI and service can apply smaller practical limits during a session.

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.