@qwen-code/qwen-code 0.14.5 → 0.15.0-preview.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,168 @@
1
+ # Memory
2
+
3
+ Every Qwen Code session starts with a fresh context window. Two mechanisms carry knowledge across sessions so you don't have to re-explain yourself every time:
4
+
5
+ - **QWEN.md** — instructions _you_ write once and Qwen reads every session
6
+ - **Auto-memory** — notes Qwen writes itself based on what it learns from you
7
+
8
+ ---
9
+
10
+ ## QWEN.md: your instructions to Qwen
11
+
12
+ QWEN.md is a plain text file where you write things Qwen should always know about your project or your preferences. Think of it as a permanent briefing that loads at the start of every conversation.
13
+
14
+ ### What to put in QWEN.md
15
+
16
+ Add things you'd otherwise have to repeat every session:
17
+
18
+ - Build and test commands (`npm run test`, `make build`)
19
+ - Coding conventions your team follows ("all new files must have JSDoc comments")
20
+ - Architectural decisions ("we use the repository pattern, never call the database directly from controllers")
21
+ - Personal preferences ("always use pnpm, not npm")
22
+
23
+ Don't include things Qwen can figure out by reading your code. QWEN.md works best when it's short and specific — the longer it gets, the less reliably Qwen follows it.
24
+
25
+ ### Where to create QWEN.md
26
+
27
+ | File | Who it applies to |
28
+ | ----------------------------- | --------------------------------------------- |
29
+ | `~/.qwen/QWEN.md` | You, across all your projects |
30
+ | `QWEN.md` in the project root | Your whole team (commit it to source control) |
31
+
32
+ You can have both. Qwen loads all QWEN.md files it finds when you start a session — your personal one plus any in the project.
33
+
34
+ If your repository already has an `AGENTS.md` file for other AI tools, Qwen reads that too. No need to duplicate instructions.
35
+
36
+ ### Generate one automatically with `/init`
37
+
38
+ Run `/init` and Qwen will analyze your codebase to create a starter QWEN.md with build commands, test instructions, and conventions it finds. If one already exists, it suggests additions instead of overwriting.
39
+
40
+ ### Reference other files
41
+
42
+ You can point QWEN.md at other files so Qwen reads them too:
43
+
44
+ ```markdown
45
+ See @README.md for project overview.
46
+
47
+ # Conventions
48
+
49
+ - Git workflow: @docs/git-workflow.md
50
+ ```
51
+
52
+ Use `@path/to/file` anywhere in QWEN.md. Relative paths resolve from the QWEN.md file itself.
53
+
54
+ ---
55
+
56
+ ## Auto-memory: what Qwen learns about you
57
+
58
+ Auto-memory runs in the background. After each of your conversations, Qwen quietly saves useful things it learned — your preferences, feedback you gave, project context — so it can use them in future sessions without you repeating yourself.
59
+
60
+ This is different from QWEN.md: you don't write it, Qwen does.
61
+
62
+ ### What Qwen saves
63
+
64
+ Qwen looks for four kinds of things worth remembering:
65
+
66
+ | What | Examples |
67
+ | ----------------------- | -------------------------------------------------------- |
68
+ | **About you** | Your role, background, how you like to work |
69
+ | **Your feedback** | Corrections you made, approaches you confirmed |
70
+ | **Project context** | Ongoing work, decisions, goals not obvious from the code |
71
+ | **External references** | Dashboards, ticket trackers, docs links you mentioned |
72
+
73
+ Qwen doesn't save everything — only things that would actually be useful next time.
74
+
75
+ ### Where it's stored
76
+
77
+ Auto-memory files live at `~/.qwen/projects/<project>/memory/`. All branches and worktrees of the same repository share the same memory folder, so what Qwen learns in one branch is available in others.
78
+
79
+ Everything saved is plain markdown — you can open, edit, or delete any file at any time.
80
+
81
+ ### Periodic cleanup
82
+
83
+ Qwen periodically goes through its saved memories to remove duplicates and clean up outdated entries. This runs automatically in the background once a day after enough sessions have accumulated. You can trigger it manually with `/dream` if you want it to run now.
84
+
85
+ While cleanup is running, **✦ dreaming** appears in the corner of the screen. Your session continues normally.
86
+
87
+ ### Turning it on or off
88
+
89
+ Auto-memory is on by default. To toggle it, open `/memory` and use the switches at the top. You can turn off just the automatic saving, just the periodic cleanup, or both.
90
+
91
+ You can also set them in `~/.qwen/settings.json` (applies to all projects) or `.qwen/settings.json` (this project only):
92
+
93
+ ```json
94
+ {
95
+ "memory": {
96
+ "enableManagedAutoMemory": true,
97
+ "enableManagedAutoDream": true
98
+ }
99
+ }
100
+ ```
101
+
102
+ ---
103
+
104
+ ## Commands
105
+
106
+ ### `/memory`
107
+
108
+ Opens the Memory panel. From here you can:
109
+
110
+ - Turn auto-memory saving on or off
111
+ - Turn periodic cleanup (dream) on or off
112
+ - Open your personal QWEN.md (`~/.qwen/QWEN.md`)
113
+ - Open the project QWEN.md
114
+ - Browse the auto-memory folder
115
+
116
+ ### `/init`
117
+
118
+ Generates a starter QWEN.md for your project. Qwen reads your codebase and fills in build commands, test instructions, and conventions it discovers.
119
+
120
+ ### `/remember <text>`
121
+
122
+ Immediately saves something to auto-memory without waiting for Qwen to pick it up automatically:
123
+
124
+ ```
125
+ /remember always use snake_case for Python variable names
126
+ /remember the staging environment is at staging.example.com
127
+ ```
128
+
129
+ ### `/forget <text>`
130
+
131
+ Removes auto-memory entries that match your description:
132
+
133
+ ```
134
+ /forget old workaround for the login bug
135
+ ```
136
+
137
+ ### `/dream`
138
+
139
+ Runs the memory cleanup now instead of waiting for the automatic schedule:
140
+
141
+ ```
142
+ /dream
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Troubleshooting
148
+
149
+ ### Qwen isn't following my QWEN.md
150
+
151
+ Open `/memory` to see which files are loaded. If your file isn't listed, Qwen can't see it — make sure it's in the project root or `~/.qwen/`.
152
+
153
+ Instructions work better when they're specific:
154
+
155
+ - ✓ `Use 2-space indentation for TypeScript files`
156
+ - ✗ `Format code nicely`
157
+
158
+ If you have multiple QWEN.md files with conflicting instructions, Qwen may behave inconsistently. Review them and remove any contradictions.
159
+
160
+ ### I want to see what Qwen has saved
161
+
162
+ Run `/memory` and select **Open auto-memory folder**. All saved memories are readable markdown files you can browse, edit, or delete.
163
+
164
+ ### Qwen keeps forgetting things
165
+
166
+ If auto-memory is on but Qwen doesn't seem to remember things across sessions, try running `/dream` to force a cleanup pass. Also check `/memory` to confirm both toggles are enabled.
167
+
168
+ For things you always want Qwen to remember, add them to QWEN.md instead — auto-memory is best-effort, QWEN.md is guaranteed.
@@ -5,14 +5,21 @@
5
5
  The status line lets you run a shell command whose output is displayed in the footer's left section. The command receives structured JSON context via stdin, so it can show session-aware information like the current model, token usage, git branch, or anything else you can script.
6
6
 
7
7
  ```
8
- With status line (default approval mode — 1 row):
8
+ Single-line status (default approval mode — 1 row):
9
9
  ┌─────────────────────────────────────────────────────────────────┐
10
10
  │ user@host ~/project (main) ctx:34% 🔒 docker | Debug | 67% │ ← status line
11
11
  └─────────────────────────────────────────────────────────────────┘
12
12
 
13
- With status line + non-default mode (2 rows):
13
+ Multi-line status (up to 2 lines 2 rows):
14
14
  ┌─────────────────────────────────────────────────────────────────┐
15
- │ user@host ~/project (main) ctx:34% 🔒 docker | Debug | 67% │ ← status line
15
+ │ user@host ~/project (main) ctx:34% 🔒 docker | Debug | 67% │ ← status line 1
16
+ │ ████████░░░░░░░░░░ 34% context │ ← status line 2
17
+ └─────────────────────────────────────────────────────────────────┘
18
+
19
+ Multi-line status + non-default mode (3 rows max):
20
+ ┌─────────────────────────────────────────────────────────────────┐
21
+ │ user@host ~/project (main) ctx:34% 🔒 docker | Debug | 67% │ ← status line 1
22
+ │ ████████░░░░░░░░░░ 34% context │ ← status line 2
16
23
  │ auto-accept edits (shift + tab to cycle) │ ← mode indicator
17
24
  └─────────────────────────────────────────────────────────────────┘
18
25
  ```
@@ -53,10 +60,10 @@ Add a `statusLine` object under the `ui` key in `~/.qwen/settings.json`:
53
60
  }
54
61
  ```
55
62
 
56
- | Field | Type | Required | Description |
57
- | --------- | ----------- | -------- | ------------------------------------------------------------------------------------- |
58
- | `type` | `"command"` | Yes | Must be `"command"` |
59
- | `command` | string | Yes | Shell command to execute. Receives JSON via stdin, first line of stdout is displayed. |
63
+ | Field | Type | Required | Description |
64
+ | --------- | ----------- | -------- | --------------------------------------------------------------------------------------- |
65
+ | `type` | `"command"` | Yes | Must be `"command"` |
66
+ | `command` | string | Yes | Shell command to execute. Receives JSON via stdin, stdout is displayed (up to 2 lines). |
60
67
 
61
68
  ## JSON input
62
69
 
@@ -220,7 +227,7 @@ Then reference it in settings:
220
227
 
221
228
  - **Update triggers**: The status line updates when the model changes, a new message is sent (token count changes), vim mode is toggled, git branch changes, tool calls complete, or file changes occur. Updates are debounced (300ms).
222
229
  - **Timeout**: Commands that take longer than 5 seconds are killed. The status line clears on failure.
223
- - **Output**: Only the first line of stdout is used. The text is rendered with dimmed colors in the footer's left section and truncated if it exceeds the available width.
230
+ - **Output**: Multi-line output is supported (up to 2 lines; extra lines are discarded). Each line is rendered as a separate row with dimmed colors in the footer's left section. Lines that exceed the available width are truncated.
224
231
  - **Hot reload**: Changes to `ui.statusLine` in settings take effect immediately — no restart required.
225
232
  - **Shell**: Commands run via `/bin/sh` on macOS/Linux. On Windows, `cmd.exe` is used by default — wrap POSIX commands with `bash -c "..."` or point to a bash script (e.g. `bash ~/.qwen/statusline-command.sh`).
226
233
  - **Removal**: Delete the `ui.statusLine` key from settings to disable. The "? for shortcuts" hint returns.
@@ -15,10 +15,10 @@
15
15
  curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh | bash
16
16
  ```
17
17
 
18
- **Windows (Run as Administrator CMD)**
18
+ **Windows (Run as Administrator)**
19
19
 
20
- ```sh
21
- curl -fsSL -o %TEMP%\install-qwen.bat https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.bat && %TEMP%\install-qwen.bat
20
+ ```cmd
21
+ powershell -Command "Invoke-WebRequest 'https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.bat' -OutFile (Join-Path $env:TEMP 'install-qwen.bat'); & (Join-Path $env:TEMP 'install-qwen.bat')"
22
22
  ```
23
23
 
24
24
  > [!note]
@@ -32,7 +32,7 @@ cd your-project
32
32
  qwen
33
33
  ```
34
34
 
35
- Select **Qwen OAuth (Free)** authentication and follow the prompts to log in. Then let's start with understanding your codebase. Try one of these commands:
35
+ Choose your authentication method — **API Key** or **[Alibaba Cloud Coding Plan](https://bailian.console.aliyun.com/cn-beijing/?tab=coding-plan#/efm/coding-plan-index)** ([intl](https://modelstudio.console.alibabacloud.com/?tab=coding-plan#/efm/coding-plan-index)) and follow the prompts to configure. See the API setup guide ([Beijing](https://bailian.console.aliyun.com/cn-beijing/?tab=doc#/doc/?type=model&url=3023091) / [intl](https://modelstudio.console.alibabacloud.com/ap-southeast-1?tab=doc#/doc/?type=model&url=2974721)) for step-by-step instructions. Then let's start with understanding your codebase. Try one of these commands:
36
36
 
37
37
  ```
38
38
  what does this project do?
@@ -10,7 +10,7 @@ Make sure you have:
10
10
 
11
11
  - A **terminal** or command prompt open
12
12
  - A code project to work with
13
- - A [Qwen Code](https://chat.qwen.ai/auth?mode=register) account
13
+ - An API key from Alibaba Cloud Model Studio ([Beijing](https://bailian.console.aliyun.com/) / [intl](https://modelstudio.console.alibabacloud.com/)), or an Alibaba Cloud Coding Plan ([Beijing](https://bailian.console.aliyun.com/cn-beijing/?tab=coding-plan#/efm/coding-plan-index) / [intl](https://modelstudio.console.alibabacloud.com/?tab=coding-plan#/efm/coding-plan-index)) subscription
14
14
 
15
15
  ## Step 1: Install Qwen Code
16
16
 
@@ -24,10 +24,10 @@ To install Qwen Code, use one of the following methods:
24
24
  curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh | bash
25
25
  ```
26
26
 
27
- **Windows (Run as Administrator CMD)**
27
+ **Windows (Run as Administrator)**
28
28
 
29
- ```sh
30
- curl -fsSL -o %TEMP%\install-qwen.bat https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.bat && %TEMP%\install-qwen.bat
29
+ ```cmd
30
+ powershell -Command "Invoke-WebRequest 'https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.bat' -OutFile (Join-Path $env:TEMP 'install-qwen.bat'); & (Join-Path $env:TEMP 'install-qwen.bat')"
31
31
  ```
32
32
 
33
33
  > [!note]
@@ -52,21 +52,26 @@ npm install -g @qwen-code/qwen-code@latest
52
52
  brew install qwen-code
53
53
  ```
54
54
 
55
- ## Step 2: Log in to your account
55
+ ## Step 2: Set up authentication
56
56
 
57
- Qwen Code requires an account to use. When you start an interactive session with the `qwen` command, you'll be prompted to log in:
57
+ When you start an interactive session with the `qwen` command, you'll be prompted to configure authentication:
58
58
 
59
59
  ```bash
60
- # You'll be prompted to log in on first use
60
+ # You'll be prompted to set up authentication on first use
61
61
  qwen
62
62
  ```
63
63
 
64
64
  ```bash
65
- # Follow the prompts to log in with your account
65
+ # Or run /auth anytime to change authentication method
66
66
  /auth
67
67
  ```
68
68
 
69
- Select `Qwen OAuth`, log in to your account and follow the prompts to confirm. Once logged in, your credentials are stored and you won't need to log in again.
69
+ Choose your preferred authentication method:
70
+
71
+ - **Alibaba Cloud Coding Plan**: Select `Alibaba Cloud Coding Plan` for a fixed monthly fee with diverse model options. See the [Coding Plan guide](https://bailian.console.aliyun.com/cn-beijing/?tab=coding-plan#/efm/coding-plan-index) ([intl](https://modelstudio.console.alibabacloud.com/?tab=coding-plan#/efm/coding-plan-index)) for setup instructions.
72
+ - **API Key**: Select `API Key`, then enter your API key from Alibaba Cloud Model Studio ([Beijing](https://bailian.console.aliyun.com/) / [intl](https://modelstudio.console.alibabacloud.com/)). See the API setup guide ([Beijing](https://bailian.console.aliyun.com/cn-beijing/?tab=doc#/doc/?type=model&url=3023091) / [intl](https://modelstudio.console.alibabacloud.com/ap-southeast-1?tab=doc#/doc/?type=model&url=2974721)) for details.
73
+
74
+ > ⚠️ **Note**: Qwen OAuth was discontinued on April 15, 2026. If you were previously using Qwen OAuth, please switch to one of the methods above.
70
75
 
71
76
  > [!note]
72
77
  >
@@ -9,15 +9,21 @@ This guide provides solutions to common issues and debugging tips, including top
9
9
 
10
10
  ## Authentication or login errors
11
11
 
12
+ - **Error: `Qwen OAuth free tier was discontinued on 2026-04-15`**
13
+ - **Cause:** Qwen OAuth is no longer available as of April 15, 2026.
14
+ - **Solution:** Switch to a different authentication method. Run `qwen` → `/auth` and choose one of:
15
+ - **API Key**: Use an API key from Alibaba Cloud Model Studio ([Beijing](https://bailian.console.aliyun.com/) / [intl](https://modelstudio.console.alibabacloud.com/)). See the API setup guide ([Beijing](https://bailian.console.aliyun.com/cn-beijing/?tab=doc#/doc/?type=model&url=3023091) / [intl](https://modelstudio.console.alibabacloud.com/ap-southeast-1?tab=doc#/doc/?type=model&url=2974721)).
16
+ - **Alibaba Cloud Coding Plan**: Subscribe for a fixed monthly fee with higher quotas. See the Coding Plan guide ([Beijing](https://bailian.console.aliyun.com/cn-beijing/?tab=coding-plan#/efm/coding-plan-index) / [intl](https://modelstudio.console.alibabacloud.com/?tab=coding-plan#/efm/coding-plan-index)).
17
+
12
18
  - **Error: `UNABLE_TO_GET_ISSUER_CERT_LOCALLY`, `UNABLE_TO_VERIFY_LEAF_SIGNATURE`, or `unable to get local issuer certificate`**
13
19
  - **Cause:** You may be on a corporate network with a firewall that intercepts and inspects SSL/TLS traffic. This often requires a custom root CA certificate to be trusted by Node.js.
14
20
  - **Solution:** Set the `NODE_EXTRA_CA_CERTS` environment variable to the absolute path of your corporate root CA certificate file.
15
21
  - Example: `export NODE_EXTRA_CA_CERTS=/path/to/your/corporate-ca.crt`
16
22
 
17
23
  - **Error: `Device authorization flow failed: fetch failed`**
18
- - **Cause:** Node.js could not reach Qwen OAuth endpoints (often a proxy or SSL/TLS trust issue). When available, Qwen Code will also print the underlying error cause (for example: `UNABLE_TO_VERIFY_LEAF_SIGNATURE`).
24
+ - **Cause:** Node.js could not reach Qwen OAuth endpoints (often a proxy or SSL/TLS trust issue). When available, Qwen Code will also print the underlying error cause (for example: `UNABLE_TO_VERIFY_LEAF_SIGNATURE`). Note: this error is specific to the legacy Qwen OAuth flow.
19
25
  - **Solution:**
20
- - Confirm you can access `https://chat.qwen.ai` from the same machine/network.
26
+ - If you are still using Qwen OAuth, switch to API Key or Coding Plan via `/auth`.
21
27
  - If you are behind a proxy, set it via `qwen --proxy <url>` (or the `proxy` setting in `settings.json`).
22
28
  - If your network uses a corporate TLS inspection CA, set `NODE_EXTRA_CA_CERTS` as described above.
23
29
 
@@ -41,7 +47,7 @@ This guide provides solutions to common issues and debugging tips, including top
41
47
  Refer to [Qwen Code Configuration](../configuration/settings) for more details.
42
48
 
43
49
  - **Q: Why don't I see cached token counts in my stats output?**
44
- - A: Cached token information is only displayed when cached tokens are being used. This feature is available for API key users (Qwen API key or Google Cloud Vertex AI) but not for OAuth users (such as Google Personal/Enterprise accounts like Google Gmail or Google Workspace, respectively). This is because the Qwen Code Assist API does not support cached content creation. You can still view your total token usage using the `/stats` command.
50
+ - A: Cached token information is only displayed when cached tokens are being used. This feature is available for API key users (e.g., Alibaba Cloud Model Studio API key or Google Cloud Vertex AI). You can still view your total token usage using the `/stats` command.
45
51
 
46
52
  ## Common error messages and solutions
47
53