@mmmbuto/qwen-code-termux 0.12.0-termux → 0.14.0-termux
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.
- package/README.md +188 -55
- package/bundled/loop/SKILL.md +61 -0
- package/bundled/qc-helper/SKILL.md +151 -0
- package/bundled/qc-helper/docs/_meta.ts +30 -0
- package/bundled/qc-helper/docs/common-workflow.md +571 -0
- package/bundled/qc-helper/docs/configuration/_meta.ts +10 -0
- package/bundled/qc-helper/docs/configuration/auth.md +366 -0
- package/bundled/qc-helper/docs/configuration/memory.md +0 -0
- package/bundled/qc-helper/docs/configuration/model-providers.md +542 -0
- package/bundled/qc-helper/docs/configuration/qwen-ignore.md +55 -0
- package/bundled/qc-helper/docs/configuration/settings.md +655 -0
- package/bundled/qc-helper/docs/configuration/themes.md +160 -0
- package/bundled/qc-helper/docs/configuration/trusted-folders.md +61 -0
- package/bundled/qc-helper/docs/configuration.md +73 -0
- package/bundled/qc-helper/docs/extension/_meta.ts +9 -0
- package/bundled/qc-helper/docs/extension/extension-releasing.md +204 -0
- package/bundled/qc-helper/docs/extension/getting-started-extensions.md +299 -0
- package/bundled/qc-helper/docs/extension/introduction.md +338 -0
- package/bundled/qc-helper/docs/features/_meta.ts +19 -0
- package/bundled/qc-helper/docs/features/approval-mode.md +263 -0
- package/bundled/qc-helper/docs/features/arena.md +218 -0
- package/bundled/qc-helper/docs/features/channels/_meta.ts +7 -0
- package/bundled/qc-helper/docs/features/channels/dingtalk.md +134 -0
- package/bundled/qc-helper/docs/features/channels/overview.md +336 -0
- package/bundled/qc-helper/docs/features/channels/plugins.md +87 -0
- package/bundled/qc-helper/docs/features/channels/telegram.md +120 -0
- package/bundled/qc-helper/docs/features/channels/weixin.md +106 -0
- package/bundled/qc-helper/docs/features/checkpointing.md +77 -0
- package/bundled/qc-helper/docs/features/commands.md +312 -0
- package/bundled/qc-helper/docs/features/headless.md +318 -0
- package/bundled/qc-helper/docs/features/hooks.md +720 -0
- package/bundled/qc-helper/docs/features/language.md +139 -0
- package/bundled/qc-helper/docs/features/lsp.md +417 -0
- package/bundled/qc-helper/docs/features/mcp.md +281 -0
- package/bundled/qc-helper/docs/features/sandbox.md +241 -0
- package/bundled/qc-helper/docs/features/scheduled-tasks.md +139 -0
- package/bundled/qc-helper/docs/features/skills.md +289 -0
- package/bundled/qc-helper/docs/features/sub-agents.md +515 -0
- package/bundled/qc-helper/docs/features/token-caching.md +29 -0
- package/bundled/qc-helper/docs/ide-integration/_meta.ts +4 -0
- package/bundled/qc-helper/docs/ide-integration/ide-companion-spec.md +182 -0
- package/bundled/qc-helper/docs/ide-integration/ide-integration.md +144 -0
- package/bundled/qc-helper/docs/integration-github-action.md +241 -0
- package/bundled/qc-helper/docs/integration-jetbrains.md +81 -0
- package/bundled/qc-helper/docs/integration-vscode.md +39 -0
- package/bundled/qc-helper/docs/integration-zed.md +72 -0
- package/bundled/qc-helper/docs/overview.md +64 -0
- package/bundled/qc-helper/docs/quickstart.md +273 -0
- package/bundled/qc-helper/docs/reference/_meta.ts +3 -0
- package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +72 -0
- package/bundled/qc-helper/docs/support/Uninstall.md +42 -0
- package/bundled/qc-helper/docs/support/_meta.ts +6 -0
- package/bundled/qc-helper/docs/support/tos-privacy.md +112 -0
- package/bundled/qc-helper/docs/support/troubleshooting.md +123 -0
- package/bundled/review/SKILL.md +261 -0
- package/cli.js +298314 -244746
- package/locales/de.js +358 -7
- package/locales/en.js +347 -7
- package/locales/ja.js +347 -7
- package/locales/pt.js +353 -7
- package/locales/ru.js +348 -7
- package/locales/zh.js +333 -7
- package/package.json +12 -7
- package/sandbox-macos-permissive-open.sb +3 -1
- package/vendor/tree-sitter/tree-sitter-bash.wasm +0 -0
- package/vendor/tree-sitter/tree-sitter.wasm +0 -0
- package/CHANGELOG.md +0 -77
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
# Getting Started with Qwen Code Extensions
|
|
2
|
+
|
|
3
|
+
This guide will walk you through creating your first Qwen Code extension. You'll learn how to set up a new extension, add a custom tool via an MCP server, create a custom command, and provide context to the model with a `QWEN.md` file.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
Before you start, make sure you have the Qwen Code installed and a basic understanding of Node.js and TypeScript.
|
|
8
|
+
|
|
9
|
+
## Step 1: Create a New Extension
|
|
10
|
+
|
|
11
|
+
The easiest way to start is by using one of the built-in templates. We'll use the `mcp-server` example as our foundation.
|
|
12
|
+
|
|
13
|
+
Run the following command to create a new directory called `my-first-extension` with the template files:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
qwen extensions new my-first-extension mcp-server
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This will create a new directory with the following structure:
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
my-first-extension/
|
|
23
|
+
├── example.ts
|
|
24
|
+
├── qwen-extension.json
|
|
25
|
+
├── package.json
|
|
26
|
+
└── tsconfig.json
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Step 2: Understand the Extension Files
|
|
30
|
+
|
|
31
|
+
Let's look at the key files in your new extension.
|
|
32
|
+
|
|
33
|
+
### `qwen-extension.json`
|
|
34
|
+
|
|
35
|
+
This is the manifest file for your extension. It tells Qwen Code how to load and use your extension.
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"name": "my-first-extension",
|
|
40
|
+
"version": "1.0.0",
|
|
41
|
+
"mcpServers": {
|
|
42
|
+
"nodeServer": {
|
|
43
|
+
"command": "node",
|
|
44
|
+
"args": ["${extensionPath}${/}dist${/}example.js"],
|
|
45
|
+
"cwd": "${extensionPath}"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
- `name`: The unique name for your extension.
|
|
52
|
+
- `version`: The version of your extension.
|
|
53
|
+
- `mcpServers`: This section defines one or more Model Context Protocol (MCP) servers. MCP servers are how you can add new tools for the model to use.
|
|
54
|
+
- `command`, `args`, `cwd`: These fields specify how to start your server. Notice the use of the `${extensionPath}` variable, which Qwen Code replaces with the absolute path to your extension's installation directory. This allows your extension to work regardless of where it's installed.
|
|
55
|
+
|
|
56
|
+
### `example.ts`
|
|
57
|
+
|
|
58
|
+
This file contains the source code for your MCP server. It's a simple Node.js server that uses the `@modelcontextprotocol/sdk`.
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
/**
|
|
62
|
+
* @license
|
|
63
|
+
* Copyright 2025 Google LLC
|
|
64
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
65
|
+
*/
|
|
66
|
+
|
|
67
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
68
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
69
|
+
import { z } from 'zod';
|
|
70
|
+
|
|
71
|
+
const server = new McpServer({
|
|
72
|
+
name: 'prompt-server',
|
|
73
|
+
version: '1.0.0',
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Registers a new tool named 'fetch_posts'
|
|
77
|
+
server.registerTool(
|
|
78
|
+
'fetch_posts',
|
|
79
|
+
{
|
|
80
|
+
description: 'Fetches a list of posts from a public API.',
|
|
81
|
+
inputSchema: z.object({}).shape,
|
|
82
|
+
},
|
|
83
|
+
async () => {
|
|
84
|
+
const apiResponse = await fetch(
|
|
85
|
+
'https://jsonplaceholder.typicode.com/posts',
|
|
86
|
+
);
|
|
87
|
+
const posts = await apiResponse.json();
|
|
88
|
+
const response = { posts: posts.slice(0, 5) };
|
|
89
|
+
return {
|
|
90
|
+
content: [
|
|
91
|
+
{
|
|
92
|
+
type: 'text',
|
|
93
|
+
text: JSON.stringify(response),
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
// ... (prompt registration omitted for brevity)
|
|
101
|
+
|
|
102
|
+
const transport = new StdioServerTransport();
|
|
103
|
+
await server.connect(transport);
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
This server defines a single tool called `fetch_posts` that fetches data from a public API.
|
|
107
|
+
|
|
108
|
+
### `package.json` and `tsconfig.json`
|
|
109
|
+
|
|
110
|
+
These are standard configuration files for a TypeScript project. The `package.json` file defines dependencies and a `build` script, and `tsconfig.json` configures the TypeScript compiler.
|
|
111
|
+
|
|
112
|
+
## Step 3: Build and Link Your Extension
|
|
113
|
+
|
|
114
|
+
Before you can use the extension, you need to compile the TypeScript code and link the extension to your Qwen Code installation for local development.
|
|
115
|
+
|
|
116
|
+
1. **Install dependencies:**
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
cd my-first-extension
|
|
120
|
+
npm install
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
2. **Build the server:**
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npm run build
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
This will compile `example.ts` into `dist/example.js`, which is the file referenced in your `qwen-extension.json`.
|
|
130
|
+
|
|
131
|
+
3. **Link the extension:**
|
|
132
|
+
|
|
133
|
+
The `link` command creates a symbolic link from the Qwen Code extensions directory to your development directory. This means any changes you make will be reflected immediately without needing to reinstall.
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
qwen extensions link .
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Now, restart your Qwen Code session. The new `fetch_posts` tool will be available. You can test it by asking: "fetch posts".
|
|
140
|
+
|
|
141
|
+
## Step 4: Add a Custom Command
|
|
142
|
+
|
|
143
|
+
Custom commands provide a way to create shortcuts for complex prompts. Let's add a command that searches for a pattern in your code.
|
|
144
|
+
|
|
145
|
+
1. Create a `commands` directory and a subdirectory for your command group:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
mkdir -p commands/fs
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
2. Create a file named `commands/fs/grep-code.md`:
|
|
152
|
+
|
|
153
|
+
```markdown
|
|
154
|
+
---
|
|
155
|
+
description: Search for a pattern in code and summarize findings
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
Please summarize the findings for the pattern `{{args}}`.
|
|
159
|
+
|
|
160
|
+
Search Results:
|
|
161
|
+
!{grep -r {{args}} .}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
This command, `/fs:grep-code`, will take an argument, run the `grep` shell command with it, and pipe the results into a prompt for summarization.
|
|
165
|
+
|
|
166
|
+
> **Note:** Commands use Markdown format with optional YAML frontmatter. TOML format is deprecated but still supported for backwards compatibility.
|
|
167
|
+
|
|
168
|
+
After saving the file, restart the Qwen Code. You can now run `/fs:grep-code "some pattern"` to use your new command.
|
|
169
|
+
|
|
170
|
+
## Step 5: Add Custom Skills and Subagents (Optional)
|
|
171
|
+
|
|
172
|
+
Extensions can also provide custom skills and subagents to extend Qwen Code's capabilities.
|
|
173
|
+
|
|
174
|
+
### Adding a Custom Skill
|
|
175
|
+
|
|
176
|
+
Skills are model-invoked capabilities that the AI can automatically use when relevant.
|
|
177
|
+
|
|
178
|
+
1. Create a `skills` directory with a skill subdirectory:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
mkdir -p skills/code-analyzer
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
2. Create a `skills/code-analyzer/SKILL.md` file:
|
|
185
|
+
|
|
186
|
+
```markdown
|
|
187
|
+
---
|
|
188
|
+
name: code-analyzer
|
|
189
|
+
description: Analyzes code structure and provides insights about complexity, dependencies, and potential improvements
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
# Code Analyzer
|
|
193
|
+
|
|
194
|
+
## Instructions
|
|
195
|
+
|
|
196
|
+
When analyzing code, focus on:
|
|
197
|
+
|
|
198
|
+
- Code complexity and maintainability
|
|
199
|
+
- Dependencies and coupling
|
|
200
|
+
- Potential performance issues
|
|
201
|
+
- Suggestions for improvements
|
|
202
|
+
|
|
203
|
+
## Examples
|
|
204
|
+
|
|
205
|
+
- "Analyze the complexity of this function"
|
|
206
|
+
- "What are the dependencies of this module?"
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Adding a Custom Subagent
|
|
210
|
+
|
|
211
|
+
Subagents are specialized AI assistants for specific tasks.
|
|
212
|
+
|
|
213
|
+
1. Create an `agents` directory:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
mkdir -p agents
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
2. Create an `agents/refactoring-expert.md` file:
|
|
220
|
+
|
|
221
|
+
```markdown
|
|
222
|
+
---
|
|
223
|
+
name: refactoring-expert
|
|
224
|
+
description: Specialized in code refactoring, improving code structure and maintainability
|
|
225
|
+
tools:
|
|
226
|
+
- read_file
|
|
227
|
+
- write_file
|
|
228
|
+
- read_many_files
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
You are a refactoring specialist focused on improving code quality.
|
|
232
|
+
|
|
233
|
+
Your expertise includes:
|
|
234
|
+
|
|
235
|
+
- Identifying code smells and anti-patterns
|
|
236
|
+
- Applying SOLID principles
|
|
237
|
+
- Improving code readability and maintainability
|
|
238
|
+
- Safe refactoring with minimal risk
|
|
239
|
+
|
|
240
|
+
For each refactoring task:
|
|
241
|
+
|
|
242
|
+
1. Analyze the current code structure
|
|
243
|
+
2. Identify areas for improvement
|
|
244
|
+
3. Propose refactoring steps
|
|
245
|
+
4. Implement changes incrementally
|
|
246
|
+
5. Verify functionality is preserved
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
After restarting Qwen Code, your custom skills will be available via `/skills` and subagents via `/agents manage`.
|
|
250
|
+
|
|
251
|
+
## Step 6: Add a Custom `QWEN.md`
|
|
252
|
+
|
|
253
|
+
You can provide persistent context to the model by adding a `QWEN.md` file to your extension. This is useful for giving the model instructions on how to behave or information about your extension's tools. Note that you may not always need this for extensions built to expose commands and prompts.
|
|
254
|
+
|
|
255
|
+
1. Create a file named `QWEN.md` in the root of your extension directory:
|
|
256
|
+
|
|
257
|
+
```markdown
|
|
258
|
+
# My First Extension Instructions
|
|
259
|
+
|
|
260
|
+
You are an expert developer assistant. When the user asks you to fetch posts, use the `fetch_posts` tool. Be concise in your responses.
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
2. Update your `qwen-extension.json` to tell the CLI to load this file:
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"name": "my-first-extension",
|
|
268
|
+
"version": "1.0.0",
|
|
269
|
+
"contextFileName": "QWEN.md",
|
|
270
|
+
"mcpServers": {
|
|
271
|
+
"nodeServer": {
|
|
272
|
+
"command": "node",
|
|
273
|
+
"args": ["${extensionPath}${/}dist${/}example.js"],
|
|
274
|
+
"cwd": "${extensionPath}"
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Restart the CLI again. The model will now have the context from your `QWEN.md` file in every session where the extension is active.
|
|
281
|
+
|
|
282
|
+
## Step 7: Releasing Your Extension
|
|
283
|
+
|
|
284
|
+
Once you are happy with your extension, you can share it with others. The two primary ways of releasing extensions are via a Git repository or through GitHub Releases. Using a public Git repository is the simplest method.
|
|
285
|
+
|
|
286
|
+
For detailed instructions on both methods, please refer to the [Extension Releasing Guide](extension-releasing.md).
|
|
287
|
+
|
|
288
|
+
## Conclusion
|
|
289
|
+
|
|
290
|
+
You've successfully created a Qwen Code extension! You learned how to:
|
|
291
|
+
|
|
292
|
+
- Bootstrap a new extension from a template.
|
|
293
|
+
- Add custom tools with an MCP server.
|
|
294
|
+
- Create convenient custom commands.
|
|
295
|
+
- Add custom skills and subagents.
|
|
296
|
+
- Provide persistent context to the model.
|
|
297
|
+
- Link your extension for local development.
|
|
298
|
+
|
|
299
|
+
From here, you can explore more advanced features and build powerful new capabilities into the Qwen Code.
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
# Qwen Code Extensions
|
|
2
|
+
|
|
3
|
+
Qwen Code extensions package prompts, MCP servers, subagents, skills and custom commands into a familiar and user-friendly format. With extensions, you can expand the capabilities of Qwen Code and share those capabilities with others. They are designed to be easily installable and shareable.
|
|
4
|
+
|
|
5
|
+
Extensions and plugins from [Gemini CLI Extensions Gallery](https://geminicli.com/extensions/) and [Claude Code Marketplace](https://claudemarketplaces.com/) can be directly installed into Qwen Code. This cross-platform compatibility gives you access to a rich ecosystem of extensions and plugins, dramatically expanding Qwen Code's capabilities without requiring extension authors to maintain separate versions.
|
|
6
|
+
|
|
7
|
+
## Extension management
|
|
8
|
+
|
|
9
|
+
We offer a suite of extension management tools using both `qwen extensions` CLI commands and `/extensions` slash commands within the interactive CLI.
|
|
10
|
+
|
|
11
|
+
### Runtime Extension Management (Slash Commands)
|
|
12
|
+
|
|
13
|
+
You can manage extensions at runtime within the interactive CLI using `/extensions` slash commands. These commands support hot-reloading, meaning changes take effect immediately without restarting the application.
|
|
14
|
+
|
|
15
|
+
| Command | Description |
|
|
16
|
+
| ------------------------------------- | ---------------------------------------------------------------------------- |
|
|
17
|
+
| `/extensions` or `/extensions manage` | Manage all installed extensions |
|
|
18
|
+
| `/extensions install <source>` | Install an extension from a git URL, local path, npm package, or marketplace |
|
|
19
|
+
| `/extensions explore [source]` | Open extensions source page(Gemini or ClaudeCode) in your browser |
|
|
20
|
+
|
|
21
|
+
### CLI Extension Management
|
|
22
|
+
|
|
23
|
+
You can also manage extensions using `qwen extensions` CLI commands. Note that changes made via CLI commands will be reflected in active CLI sessions on restart.
|
|
24
|
+
|
|
25
|
+
### Installing an extension
|
|
26
|
+
|
|
27
|
+
You can install an extension using `qwen extensions install` from multiple sources:
|
|
28
|
+
|
|
29
|
+
#### From Claude Code Marketplace
|
|
30
|
+
|
|
31
|
+
Qwen Code also supports plugins from the [Claude Code Marketplace](https://claudemarketplaces.com/). Install from a marketplace and choose a plugin:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
qwen extensions install <marketplace-name>
|
|
35
|
+
# or
|
|
36
|
+
qwen extensions install <marketplace-github-url>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
If you want to install a specific plugin, you can use the format with plugin name:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
qwen extensions install <marketplace-name>:<plugin-name>
|
|
43
|
+
# or
|
|
44
|
+
qwen extensions install <marketplace-github-url>:<plugin-name>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
For example, to install the `prompts.chat` plugin from the [f/awesome-chatgpt-prompts](https://claudemarketplaces.com/plugins/f-awesome-chatgpt-prompts) marketplace:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
qwen extensions install f/awesome-chatgpt-prompts:prompts.chat
|
|
51
|
+
# or
|
|
52
|
+
qwen extensions install https://github.com/f/awesome-chatgpt-prompts:prompts.chat
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Claude plugins are automatically converted to Qwen Code format during installation:
|
|
56
|
+
|
|
57
|
+
- `claude-plugin.json` is converted to `qwen-extension.json`
|
|
58
|
+
- Agent configurations are converted to Qwen subagent format
|
|
59
|
+
- Skill configurations are converted to Qwen skill format
|
|
60
|
+
- Tool mappings are automatically handled
|
|
61
|
+
|
|
62
|
+
You can quickly browse available extensions from different marketplaces using the `/extensions explore` command:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Open Gemini CLI Extensions marketplace
|
|
66
|
+
/extensions explore Gemini
|
|
67
|
+
|
|
68
|
+
# Open Claude Code marketplace
|
|
69
|
+
/extensions explore ClaudeCode
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This command opens the respective marketplace in your default browser, allowing you to discover new extensions to enhance your Qwen Code experience.
|
|
73
|
+
|
|
74
|
+
> **Cross-Platform Compatibility**: This allows you to leverage the rich extension ecosystems from both Gemini CLI and Claude Code, dramatically expanding the available functionality for Qwen Code users.
|
|
75
|
+
|
|
76
|
+
#### From Gemini CLI Extensions
|
|
77
|
+
|
|
78
|
+
Qwen Code fully supports extensions from the [Gemini CLI Extensions Gallery](https://geminicli.com/extensions/). Simply install them using the git URL:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
qwen extensions install <gemini-cli-extension-github-url>
|
|
82
|
+
# or
|
|
83
|
+
qwen extensions install <owner>/<repo>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Gemini extensions are automatically converted to Qwen Code format during installation:
|
|
87
|
+
|
|
88
|
+
- `gemini-extension.json` is converted to `qwen-extension.json`
|
|
89
|
+
- TOML command files are automatically migrated to Markdown format
|
|
90
|
+
- MCP servers, context files, and settings are preserved
|
|
91
|
+
|
|
92
|
+
#### From npm Registry
|
|
93
|
+
|
|
94
|
+
Qwen Code supports installing extensions from npm registries using scoped package names. This is ideal for teams with private registries that already have auth, versioning, and publishing infrastructure in place.
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Install the latest version
|
|
98
|
+
qwen extensions install @scope/my-extension
|
|
99
|
+
|
|
100
|
+
# Install a specific version
|
|
101
|
+
qwen extensions install @scope/my-extension@1.2.0
|
|
102
|
+
|
|
103
|
+
# Install from a custom registry
|
|
104
|
+
qwen extensions install @scope/my-extension --registry https://your-registry.com
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Only scoped packages (`@scope/package-name`) are supported to avoid ambiguity with the `owner/repo` GitHub shorthand format.
|
|
108
|
+
|
|
109
|
+
**Registry resolution** follows this priority:
|
|
110
|
+
|
|
111
|
+
1. `--registry` CLI flag (explicit override)
|
|
112
|
+
2. Scoped registry from `.npmrc` (e.g. `@scope:registry=https://...`)
|
|
113
|
+
3. Default registry from `.npmrc`
|
|
114
|
+
4. Fallback: `https://registry.npmjs.org/`
|
|
115
|
+
|
|
116
|
+
**Authentication** is handled automatically via the `NPM_TOKEN` environment variable or registry-specific `_authToken` entries in your `.npmrc` file.
|
|
117
|
+
|
|
118
|
+
> **Note:** npm extensions must include a `qwen-extension.json` file at the package root, following the same format as any other Qwen Code extension. See [Extension Releasing](./extension-releasing.md#releasing-through-npm-registry) for packaging details.
|
|
119
|
+
|
|
120
|
+
#### From Git Repository
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
qwen extensions install https://github.com/github/github-mcp-server
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
This will install the github mcp server extension.
|
|
127
|
+
|
|
128
|
+
#### From Local Path
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
qwen extensions install /path/to/your/extension
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
Note that we create a copy of the installed extension, so you will need to run `qwen extensions update` to pull in changes from both locally-defined extensions and those on GitHub.
|
|
135
|
+
|
|
136
|
+
### Uninstalling an extension
|
|
137
|
+
|
|
138
|
+
To uninstall, run `qwen extensions uninstall extension-name`, so, in the case of the install example:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
qwen extensions uninstall qwen-cli-security
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Disabling an extension
|
|
145
|
+
|
|
146
|
+
Extensions are, by default, enabled across all workspaces. You can disable an extension entirely or for specific workspace.
|
|
147
|
+
|
|
148
|
+
For example, `qwen extensions disable extension-name` will disable the extension at the user level, so it will be disabled everywhere. `qwen extensions disable extension-name --scope=workspace` will only disable the extension in the current workspace.
|
|
149
|
+
|
|
150
|
+
### Enabling an extension
|
|
151
|
+
|
|
152
|
+
You can enable extensions using `qwen extensions enable extension-name`. You can also enable an extension for a specific workspace using `qwen extensions enable extension-name --scope=workspace` from within that workspace.
|
|
153
|
+
|
|
154
|
+
This is useful if you have an extension disabled at the top-level and only enabled in specific places.
|
|
155
|
+
|
|
156
|
+
### Updating an extension
|
|
157
|
+
|
|
158
|
+
For extensions installed from a local path, a git repository, or an npm registry, you can explicitly update to the latest version with `qwen extensions update extension-name`. For npm extensions installed without a version pin (e.g. `@scope/pkg`), updates check the `latest` dist-tag. For those installed with a specific dist-tag (e.g. `@scope/pkg@beta`), updates track that tag. Extensions pinned to an exact version (e.g. `@scope/pkg@1.2.0`) are always considered up-to-date.
|
|
159
|
+
|
|
160
|
+
You can update all extensions with:
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
qwen extensions update --all
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## How it works
|
|
167
|
+
|
|
168
|
+
On startup, Qwen Code looks for extensions in `<home>/.qwen/extensions`
|
|
169
|
+
|
|
170
|
+
Extensions exist as a directory that contains a `qwen-extension.json` file. For example:
|
|
171
|
+
|
|
172
|
+
`<home>/.qwen/extensions/my-extension/qwen-extension.json`
|
|
173
|
+
|
|
174
|
+
### `qwen-extension.json`
|
|
175
|
+
|
|
176
|
+
The `qwen-extension.json` file contains the configuration for the extension. The file has the following structure:
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"name": "my-extension",
|
|
181
|
+
"version": "1.0.0",
|
|
182
|
+
"mcpServers": {
|
|
183
|
+
"my-server": {
|
|
184
|
+
"command": "node my-server.js"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"channels": {
|
|
188
|
+
"my-platform": {
|
|
189
|
+
"entry": "dist/index.js",
|
|
190
|
+
"displayName": "My Platform Channel"
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"contextFileName": "QWEN.md",
|
|
194
|
+
"commands": "commands",
|
|
195
|
+
"skills": "skills",
|
|
196
|
+
"agents": "agents",
|
|
197
|
+
"settings": [
|
|
198
|
+
{
|
|
199
|
+
"name": "API Key",
|
|
200
|
+
"description": "Your API key for the service",
|
|
201
|
+
"envVar": "MY_API_KEY",
|
|
202
|
+
"sensitive": true
|
|
203
|
+
}
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
- `name`: The name of the extension. This is used to uniquely identify the extension and for conflict resolution when extension commands have the same name as user or project commands. The name should be lowercase or numbers and use dashes instead of underscores or spaces. This is how users will refer to your extension in the CLI. Note that we expect this name to match the extension directory name.
|
|
209
|
+
- `version`: The version of the extension.
|
|
210
|
+
- `mcpServers`: A map of MCP servers to configure. The key is the name of the server, and the value is the server configuration. These servers will be loaded on startup just like MCP servers configured in a [`settings.json` file](./cli/configuration.md). If both an extension and a `settings.json` file configure an MCP server with the same name, the server defined in the `settings.json` file takes precedence.
|
|
211
|
+
- Note that all MCP server configuration options are supported except for `trust`.
|
|
212
|
+
- `channels`: A map of custom channel adapters. The key is the channel type name, and the value has an `entry` (path to compiled JS entry point) and optional `displayName`. The entry point must export a `plugin` object conforming to the `ChannelPlugin` interface. See [Channel Plugins](../features/channels/plugins) for a full guide.
|
|
213
|
+
- `contextFileName`: The name of the file that contains the context for the extension. This will be used to load the context from the extension directory. If this property is not used but a `QWEN.md` file is present in your extension directory, then that file will be loaded.
|
|
214
|
+
- `commands`: The directory containing custom commands (default: `commands`). Commands are `.md` files that define prompts.
|
|
215
|
+
- `skills`: The directory containing custom skills (default: `skills`). Skills are discovered automatically and become available via the `/skills` command.
|
|
216
|
+
- `agents`: The directory containing custom subagents (default: `agents`). Subagents are `.yaml` or `.md` files that define specialized AI assistants.
|
|
217
|
+
- `settings`: An array of settings that the extension requires. When installing, users will be prompted to provide values for these settings. The values are stored securely and passed to MCP servers as environment variables.
|
|
218
|
+
- Each setting has the following properties:
|
|
219
|
+
- `name`: Display name for the setting
|
|
220
|
+
- `description`: A description of what this setting is used for
|
|
221
|
+
- `envVar`: The environment variable name that will be set
|
|
222
|
+
- `sensitive`: Boolean indicating if the value should be hidden (e.g., API keys, passwords)
|
|
223
|
+
|
|
224
|
+
### Managing Extension Settings
|
|
225
|
+
|
|
226
|
+
Extensions can require configuration through settings (such as API keys or credentials). These settings can be managed using the `qwen extensions settings` CLI command:
|
|
227
|
+
|
|
228
|
+
**Set a setting value:**
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
qwen extensions settings set <extension-name> <setting-name> [--scope user|workspace]
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
**List all settings for an extension:**
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
qwen extensions settings list <extension-name>
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**View current values (user and workspace):**
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
qwen extensions settings show <extension-name> <setting-name>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
**Remove a setting value:**
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
qwen extensions settings unset <extension-name> <setting-name> [--scope user|workspace]
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Settings can be configured at two levels:
|
|
253
|
+
|
|
254
|
+
- **User level** (default): Settings apply across all projects (`~/.qwen/.env`)
|
|
255
|
+
- **Workspace level**: Settings apply only to the current project (`.qwen/.env`)
|
|
256
|
+
|
|
257
|
+
Workspace settings take precedence over user settings. Sensitive settings are stored securely and never displayed in plain text.
|
|
258
|
+
|
|
259
|
+
When Qwen Code starts, it loads all the extensions and merges their configurations. If there are any conflicts, the workspace configuration takes precedence.
|
|
260
|
+
|
|
261
|
+
### Custom commands
|
|
262
|
+
|
|
263
|
+
Extensions can provide [custom commands](./cli/commands.md#custom-commands) by placing Markdown files in a `commands/` subdirectory within the extension directory. These commands follow the same format as user and project custom commands and use standard naming conventions.
|
|
264
|
+
|
|
265
|
+
> **Note:** The command format has been updated from TOML to Markdown. TOML files are deprecated but still supported. You can migrate existing TOML commands using the automatic migration prompt that appears when TOML files are detected.
|
|
266
|
+
|
|
267
|
+
**Example**
|
|
268
|
+
|
|
269
|
+
An extension named `gcp` with the following structure:
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
.qwen/extensions/gcp/
|
|
273
|
+
├── qwen-extension.json
|
|
274
|
+
└── commands/
|
|
275
|
+
├── deploy.md
|
|
276
|
+
└── gcs/
|
|
277
|
+
└── sync.md
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Would provide these commands:
|
|
281
|
+
|
|
282
|
+
- `/deploy` - Shows as `[gcp] Custom command from deploy.md` in help
|
|
283
|
+
- `/gcs:sync` - Shows as `[gcp] Custom command from sync.md` in help
|
|
284
|
+
|
|
285
|
+
### Custom skills
|
|
286
|
+
|
|
287
|
+
Extensions can provide custom skills by placing skill files in a `skills/` subdirectory within the extension directory. Each skill should have a `SKILL.md` file with YAML frontmatter defining the skill's name and description.
|
|
288
|
+
|
|
289
|
+
**Example**
|
|
290
|
+
|
|
291
|
+
```
|
|
292
|
+
.qwen/extensions/my-extension/
|
|
293
|
+
├── qwen-extension.json
|
|
294
|
+
└── skills/
|
|
295
|
+
└── pdf-processor/
|
|
296
|
+
└── SKILL.md
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
The skill will be available via the `/skills` command when the extension is active.
|
|
300
|
+
|
|
301
|
+
### Custom subagents
|
|
302
|
+
|
|
303
|
+
Extensions can provide custom subagents by placing agent configuration files in an `agents/` subdirectory within the extension directory. Agents are defined using YAML or Markdown files.
|
|
304
|
+
|
|
305
|
+
**Example**
|
|
306
|
+
|
|
307
|
+
```
|
|
308
|
+
.qwen/extensions/my-extension/
|
|
309
|
+
├── qwen-extension.json
|
|
310
|
+
└── agents/
|
|
311
|
+
└── testing-expert.yaml
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Extension subagents appear in the subagent manager dialog under "Extension Agents" section.
|
|
315
|
+
|
|
316
|
+
### Conflict resolution
|
|
317
|
+
|
|
318
|
+
Extension commands have the lowest precedence. When a conflict occurs with user or project commands:
|
|
319
|
+
|
|
320
|
+
1. **No conflict**: Extension command uses its natural name (e.g., `/deploy`)
|
|
321
|
+
2. **With conflict**: Extension command is renamed with the extension prefix (e.g., `/gcp.deploy`)
|
|
322
|
+
|
|
323
|
+
For example, if both a user and the `gcp` extension define a `deploy` command:
|
|
324
|
+
|
|
325
|
+
- `/deploy` - Executes the user's deploy command
|
|
326
|
+
- `/gcp.deploy` - Executes the extension's deploy command (marked with `[gcp]` tag)
|
|
327
|
+
|
|
328
|
+
## Variables
|
|
329
|
+
|
|
330
|
+
Qwen Code extensions allow variable substitution in `qwen-extension.json`. This can be useful if e.g., you need the current directory to run an MCP server using `"cwd": "${extensionPath}${/}run.ts"`.
|
|
331
|
+
|
|
332
|
+
**Supported variables:**
|
|
333
|
+
|
|
334
|
+
| variable | description |
|
|
335
|
+
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
336
|
+
| `${extensionPath}` | The fully-qualified path of the extension in the user's filesystem e.g., '/Users/username/.qwen/extensions/example-extension'. This will not unwrap symlinks. |
|
|
337
|
+
| `${workspacePath}` | The fully-qualified path of the current workspace. |
|
|
338
|
+
| `${/} or ${pathSeparator}` | The path separator (differs per OS). |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
commands: 'Commands',
|
|
3
|
+
'sub-agents': 'SubAgents',
|
|
4
|
+
arena: 'Agent Arena',
|
|
5
|
+
skills: 'Skills',
|
|
6
|
+
headless: 'Headless Mode',
|
|
7
|
+
checkpointing: {
|
|
8
|
+
display: 'hidden',
|
|
9
|
+
},
|
|
10
|
+
'approval-mode': 'Approval Mode',
|
|
11
|
+
mcp: 'MCP',
|
|
12
|
+
lsp: 'LSP (Language Server Protocol)',
|
|
13
|
+
'token-caching': 'Token Caching',
|
|
14
|
+
sandbox: 'Sandboxing',
|
|
15
|
+
language: 'i18n',
|
|
16
|
+
channels: 'Channels',
|
|
17
|
+
hooks: 'Hooks',
|
|
18
|
+
'scheduled-tasks': 'Scheduled Tasks',
|
|
19
|
+
};
|