# Qwen Code

> Alibaba Qwen's open-source terminal coding agent, originally based on Gemini CLI, which works with Qwen models and OpenAI-, Anthropic- or Gemini-compatible providers. Run it in EnvHaven from any browser, signed in once with your own account, and keep it working 24/7; or install it on your own machine.

_Updated November 23, 2026 · Checked against Qwen Code 0.24.6 in EnvHaven v1.9.0_

| At a glance |  |
| --- | --- |
| Made by | Alibaba Qwen |
| Command | `qwen` |
| Version checked | 0.24.6, in EnvHaven v1.9.0 |
| License | Apache-2.0, [source](https://github.com/QwenLM/qwen-code) |
| Documentation | [qwenlm.github.io/qwen-code-docs/en/users/overview/](https://qwenlm.github.io/qwen-code-docs/en/users/overview/) |

## Use Qwen Code in EnvHaven

1. Open your workspace in any browser, on a laptop, a tablet or a phone.
2. Tap **Launch**, choose Qwen Code and tap **Sign in**: it starts Qwen Code, which asks you to sign in the first time. For an API key, choose **Set key** instead and paste `OPENAI_API_KEY`; the workspace keeps it write-only.
3. Start it with one tap: signed in, Qwen Code gets a green dot in the Launch menu and an icon in the workspace's top bar. Support is built in (0.24.6), so there is nothing to install or update.
4. Give it a task. Runs with the default approval mode; add `--yolo` for unattended runs.
5. Close the tab whenever you like. The workspace is an always-on Linux machine, so Qwen Code keeps working, and every device you open it from shows the same session.

Every agent signs in with your own account: EnvHaven never resells tokens or adds a markup.

## Install Qwen Code on another machine

npm (Node.js 22 or later):

```bash
npm install -g @qwen-code/qwen-code@latest
```

Homebrew:

```bash
brew install qwen-code
```

## Sign in from the terminal

In a workspace the Launch menu does this for you. On any other machine, or when you would rather type it:

- Inside a session, `/auth` chooses how to sign in.
- For an OpenAI-compatible provider set `OPENAI_API_KEY`, `OPENAI_BASE_URL` and `OPENAI_MODEL`; `ANTHROPIC_API_KEY` and `GEMINI_API_KEY` work the same way for those providers.
- Qwen Plus or Pro through Qwen sign-in (from Qwen Code 0.27; the 0.24.6 build in EnvHaven 1.9.0 predates it), and Alibaba Cloud coding plans.

## Run Qwen Code without permission prompts

For one session:

```bash
qwen --yolo
```

Or by approval mode:

```bash
qwen --approval-mode yolo
```

`--yolo` approves every action automatically and adds no sandbox. Without it, trusted folders start in `auto` mode, where a model classifies each risky call and approves or blocks it.

**In EnvHaven:** Runs with the default approval mode; add `--yolo` for unattended runs. The details, and when full access is safe, are on the [Qwen Code full-access page](https://envhaven.com/yolo/qwen-code).

## Instructions file

Qwen Code reads `QWEN.md`, `AGENTS.md`, `~/.qwen/QWEN.md`.

## Add MCP servers

```bash
qwen mcp add <name> <command> [args...]
```

Servers go to `~/.qwen/settings.json` under `mcpServers`; `--scope project` writes the project file.

The [MCP config converter](https://envhaven.com/mcp-config) writes the same server for every agent at once.

## Run it from scripts

```bash
qwen -p "<prompt>"
```

Headless runs cannot stop to ask, so they need the full-access setting above.

## Qwen Code away from your desk

Qwen Code keeps working only while the machine it runs on is awake. In EnvHaven that machine is the workspace, which never sleeps: start a task, close the laptop and check on it from a phone.

- [Qwen Code in the browser](https://envhaven.com/agents/qwen-code/browser)
- [Qwen Code on iPhone](https://envhaven.com/agents/qwen-code/iphone)
- [Qwen Code on iPad](https://envhaven.com/agents/qwen-code/ipad)
- [Qwen Code on Android](https://envhaven.com/agents/qwen-code/android)
- [Qwen Code on a Chromebook](https://envhaven.com/agents/qwen-code/chromebook)
- [Qwen Code on Windows](https://envhaven.com/agents/qwen-code/windows)
- [Qwen Code on a VPS](https://envhaven.com/agents/qwen-code/vps)
- [Qwen Code in Docker](https://envhaven.com/agents/qwen-code/docker)
- [Qwen Code on a Raspberry Pi](https://envhaven.com/agents/qwen-code/raspberry-pi)
- [Qwen Code 24/7](https://envhaven.com/agents/qwen-code/24-7)

Alibaba Qwen's own options:

- Chat channels (Telegram, WeChat, QQ, DingTalk, Feishu and more) through `qwen channel start`.

## Compare Qwen Code

- [Qwen Code vs Claude Code](https://envhaven.com/compare/qwen-code-vs-claude-code)

## When Qwen Code misbehaves

- [Qwen Code: No auth type is selected](https://envhaven.com/errors/qwen-code/no-auth-type-is-selected)
- [Qwen Code: You are running Qwen Code in the root directory](https://envhaven.com/errors/qwen-code/running-in-the-root-directory)
- [Is Qwen Code down?](https://envhaven.com/status/qwen-code) Live status of the providers it depends on.

## Keep reading

- [Qwen Code full-access mode](https://envhaven.com/yolo/qwen-code)
- [Qwen Code in the browser](https://envhaven.com/agents/qwen-code/browser)
- [Qwen Code on iPhone](https://envhaven.com/agents/qwen-code/iphone)
- [Qwen Code on iPad](https://envhaven.com/agents/qwen-code/ipad)
- [Qwen Code vs Claude Code](https://envhaven.com/compare/qwen-code-vs-claude-code)

Source: https://envhaven.com/agents/qwen-code
