@protolabsai/proto 0.14.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.
- package/LICENSE +203 -0
- package/README.md +286 -0
- package/dist/bundled/adversarial-verification/SKILL.md +98 -0
- package/dist/bundled/brainstorming/SKILL.md +171 -0
- package/dist/bundled/coding-agent-standards/SKILL.md +67 -0
- package/dist/bundled/dispatching-parallel-agents/SKILL.md +193 -0
- package/dist/bundled/executing-plans/SKILL.md +77 -0
- package/dist/bundled/finishing-a-development-branch/SKILL.md +213 -0
- package/dist/bundled/loop/SKILL.md +61 -0
- package/dist/bundled/qc-helper/SKILL.md +151 -0
- package/dist/bundled/qc-helper/docs/_meta.ts +30 -0
- package/dist/bundled/qc-helper/docs/common-workflow.md +571 -0
- package/dist/bundled/qc-helper/docs/configuration/_meta.ts +10 -0
- package/dist/bundled/qc-helper/docs/configuration/auth.md +366 -0
- package/dist/bundled/qc-helper/docs/configuration/memory.md +0 -0
- package/dist/bundled/qc-helper/docs/configuration/model-providers.md +542 -0
- package/dist/bundled/qc-helper/docs/configuration/qwen-ignore.md +55 -0
- package/dist/bundled/qc-helper/docs/configuration/settings.md +652 -0
- package/dist/bundled/qc-helper/docs/configuration/themes.md +160 -0
- package/dist/bundled/qc-helper/docs/configuration/trusted-folders.md +61 -0
- package/dist/bundled/qc-helper/docs/extension/_meta.ts +9 -0
- package/dist/bundled/qc-helper/docs/extension/extension-releasing.md +121 -0
- package/dist/bundled/qc-helper/docs/extension/getting-started-extensions.md +299 -0
- package/dist/bundled/qc-helper/docs/extension/introduction.md +303 -0
- package/dist/bundled/qc-helper/docs/features/_meta.ts +18 -0
- package/dist/bundled/qc-helper/docs/features/approval-mode.md +263 -0
- package/dist/bundled/qc-helper/docs/features/arena.md +218 -0
- package/dist/bundled/qc-helper/docs/features/checkpointing.md +77 -0
- package/dist/bundled/qc-helper/docs/features/commands.md +312 -0
- package/dist/bundled/qc-helper/docs/features/headless.md +318 -0
- package/dist/bundled/qc-helper/docs/features/hooks.md +343 -0
- package/dist/bundled/qc-helper/docs/features/language.md +139 -0
- package/dist/bundled/qc-helper/docs/features/lsp.md +453 -0
- package/dist/bundled/qc-helper/docs/features/mcp.md +281 -0
- package/dist/bundled/qc-helper/docs/features/sandbox.md +241 -0
- package/dist/bundled/qc-helper/docs/features/scheduled-tasks.md +139 -0
- package/dist/bundled/qc-helper/docs/features/skills.md +289 -0
- package/dist/bundled/qc-helper/docs/features/sub-agents.md +307 -0
- package/dist/bundled/qc-helper/docs/features/token-caching.md +29 -0
- package/dist/bundled/qc-helper/docs/ide-integration/_meta.ts +4 -0
- package/dist/bundled/qc-helper/docs/ide-integration/ide-companion-spec.md +182 -0
- package/dist/bundled/qc-helper/docs/ide-integration/ide-integration.md +144 -0
- package/dist/bundled/qc-helper/docs/integration-github-action.md +241 -0
- package/dist/bundled/qc-helper/docs/integration-jetbrains.md +81 -0
- package/dist/bundled/qc-helper/docs/integration-vscode.md +39 -0
- package/dist/bundled/qc-helper/docs/integration-zed.md +72 -0
- package/dist/bundled/qc-helper/docs/overview.md +64 -0
- package/dist/bundled/qc-helper/docs/quickstart.md +273 -0
- package/dist/bundled/qc-helper/docs/reference/_meta.ts +4 -0
- package/dist/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +72 -0
- package/dist/bundled/qc-helper/docs/reference/sdk-api.md +524 -0
- package/dist/bundled/qc-helper/docs/support/Uninstall.md +42 -0
- package/dist/bundled/qc-helper/docs/support/_meta.ts +6 -0
- package/dist/bundled/qc-helper/docs/support/tos-privacy.md +112 -0
- package/dist/bundled/qc-helper/docs/support/troubleshooting.md +123 -0
- package/dist/bundled/receiving-code-review/SKILL.md +226 -0
- package/dist/bundled/requesting-code-review/SKILL.md +115 -0
- package/dist/bundled/review/SKILL.md +123 -0
- package/dist/bundled/subagent-driven-development/SKILL.md +292 -0
- package/dist/bundled/subagent-driven-development/code-quality-reviewer-prompt.md +27 -0
- package/dist/bundled/subagent-driven-development/implementer-prompt.md +113 -0
- package/dist/bundled/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/dist/bundled/systematic-debugging/SKILL.md +305 -0
- package/dist/bundled/test-driven-development/SKILL.md +396 -0
- package/dist/bundled/using-git-worktrees/SKILL.md +223 -0
- package/dist/bundled/using-superpowers/SKILL.md +117 -0
- package/dist/bundled/verification-before-completion/SKILL.md +147 -0
- package/dist/bundled/writing-plans/SKILL.md +159 -0
- package/dist/bundled/writing-skills/SKILL.md +716 -0
- package/dist/cli.js +483432 -0
- package/dist/sandbox-macos-permissive-closed.sb +32 -0
- package/dist/sandbox-macos-permissive-open.sb +27 -0
- package/dist/sandbox-macos-permissive-proxied.sb +37 -0
- package/dist/sandbox-macos-restrictive-closed.sb +93 -0
- package/dist/sandbox-macos-restrictive-open.sb +96 -0
- package/dist/sandbox-macos-restrictive-proxied.sb +98 -0
- package/dist/vendor/ripgrep/COPYING +3 -0
- package/dist/vendor/ripgrep/arm64-darwin/rg +0 -0
- package/dist/vendor/ripgrep/arm64-linux/rg +0 -0
- package/dist/vendor/ripgrep/x64-darwin/rg +0 -0
- package/dist/vendor/ripgrep/x64-linux/rg +0 -0
- package/dist/vendor/ripgrep/x64-win32/rg.exe +0 -0
- package/dist/vendor/tree-sitter/tree-sitter-bash.wasm +0 -0
- package/dist/vendor/tree-sitter/tree-sitter.wasm +0 -0
- package/package.json +143 -0
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# Themes
|
|
2
|
+
|
|
3
|
+
Qwen Code supports a variety of themes to customize its color scheme and appearance. You can change the theme to suit your preferences via the `/theme` command or `"theme":` configuration setting.
|
|
4
|
+
|
|
5
|
+
## Available Themes
|
|
6
|
+
|
|
7
|
+
Qwen Code comes with a selection of pre-defined themes, which you can list using the `/theme` command within the CLI:
|
|
8
|
+
|
|
9
|
+
- **Dark Themes:**
|
|
10
|
+
- `ANSI`
|
|
11
|
+
- `Atom One`
|
|
12
|
+
- `Ayu`
|
|
13
|
+
- `Default`
|
|
14
|
+
- `Dracula`
|
|
15
|
+
- `GitHub`
|
|
16
|
+
- **Light Themes:**
|
|
17
|
+
- `ANSI Light`
|
|
18
|
+
- `Ayu Light`
|
|
19
|
+
- `Default Light`
|
|
20
|
+
- `GitHub Light`
|
|
21
|
+
- `Google Code`
|
|
22
|
+
- `Xcode`
|
|
23
|
+
|
|
24
|
+
### Changing Themes
|
|
25
|
+
|
|
26
|
+
1. Enter `/theme` into Qwen Code.
|
|
27
|
+
2. A dialog or selection prompt appears, listing the available themes.
|
|
28
|
+
3. Using the arrow keys, select a theme. Some interfaces might offer a live preview or highlight as you select.
|
|
29
|
+
4. Confirm your selection to apply the theme.
|
|
30
|
+
|
|
31
|
+
**Note:** If a theme is defined in your `settings.json` file (either by name or by a file path), you must remove the `"theme"` setting from the file before you can change the theme using the `/theme` command.
|
|
32
|
+
|
|
33
|
+
### Theme Persistence
|
|
34
|
+
|
|
35
|
+
Selected themes are saved in Qwen Code's [configuration](../configuration/settings) so your preference is remembered across sessions.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Custom Color Themes
|
|
40
|
+
|
|
41
|
+
Qwen Code allows you to create your own custom color themes by specifying them in your `settings.json` file. This gives you full control over the color palette used in the CLI.
|
|
42
|
+
|
|
43
|
+
### How to Define a Custom Theme
|
|
44
|
+
|
|
45
|
+
Add a `customThemes` block to your user, project, or system `settings.json` file. Each custom theme is defined as an object with a unique name and a set of color keys. For example:
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"ui": {
|
|
50
|
+
"customThemes": {
|
|
51
|
+
"MyCustomTheme": {
|
|
52
|
+
"name": "MyCustomTheme",
|
|
53
|
+
"type": "custom",
|
|
54
|
+
"Background": "#181818",
|
|
55
|
+
...
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Color keys:**
|
|
63
|
+
|
|
64
|
+
- `Background`
|
|
65
|
+
- `Foreground`
|
|
66
|
+
- `LightBlue`
|
|
67
|
+
- `AccentBlue`
|
|
68
|
+
- `AccentPurple`
|
|
69
|
+
- `AccentCyan`
|
|
70
|
+
- `AccentGreen`
|
|
71
|
+
- `AccentYellow`
|
|
72
|
+
- `AccentRed`
|
|
73
|
+
- `Comment`
|
|
74
|
+
- `Gray`
|
|
75
|
+
- `DiffAdded` (optional, for added lines in diffs)
|
|
76
|
+
- `DiffRemoved` (optional, for removed lines in diffs)
|
|
77
|
+
- `DiffModified` (optional, for modified lines in diffs)
|
|
78
|
+
|
|
79
|
+
**Required Properties:**
|
|
80
|
+
|
|
81
|
+
- `name` (must match the key in the `customThemes` object and be a string)
|
|
82
|
+
- `type` (must be the string `"custom"`)
|
|
83
|
+
- `Background`
|
|
84
|
+
- `Foreground`
|
|
85
|
+
- `LightBlue`
|
|
86
|
+
- `AccentBlue`
|
|
87
|
+
- `AccentPurple`
|
|
88
|
+
- `AccentCyan`
|
|
89
|
+
- `AccentGreen`
|
|
90
|
+
- `AccentYellow`
|
|
91
|
+
- `AccentRed`
|
|
92
|
+
- `Comment`
|
|
93
|
+
- `Gray`
|
|
94
|
+
|
|
95
|
+
You can use either hex codes (e.g., `#FF0000`) **or** standard CSS color names (e.g., `coral`, `teal`, `blue`) for any color value. See [CSS color names](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#color_keywords) for a full list of supported names.
|
|
96
|
+
|
|
97
|
+
You can define multiple custom themes by adding more entries to the `customThemes` object.
|
|
98
|
+
|
|
99
|
+
### Loading Themes from a File
|
|
100
|
+
|
|
101
|
+
In addition to defining custom themes in `settings.json`, you can also load a theme directly from a JSON file by specifying the file path in your `settings.json`. This is useful for sharing themes or keeping them separate from your main configuration.
|
|
102
|
+
|
|
103
|
+
To load a theme from a file, set the `theme` property in your `settings.json` to the path of your theme file:
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"ui": {
|
|
108
|
+
"theme": "/path/to/your/theme.json"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
The theme file must be a valid JSON file that follows the same structure as a custom theme defined in `settings.json`.
|
|
114
|
+
|
|
115
|
+
**Example `my-theme.json`:**
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"name": "My File Theme",
|
|
120
|
+
"type": "custom",
|
|
121
|
+
"Background": "#282A36",
|
|
122
|
+
"Foreground": "#F8F8F2",
|
|
123
|
+
"LightBlue": "#82AAFF",
|
|
124
|
+
"AccentBlue": "#61AFEF",
|
|
125
|
+
"AccentPurple": "#BD93F9",
|
|
126
|
+
"AccentCyan": "#8BE9FD",
|
|
127
|
+
"AccentGreen": "#50FA7B",
|
|
128
|
+
"AccentYellow": "#F1FA8C",
|
|
129
|
+
"AccentRed": "#FF5555",
|
|
130
|
+
"Comment": "#6272A4",
|
|
131
|
+
"Gray": "#ABB2BF",
|
|
132
|
+
"DiffAdded": "#A6E3A1",
|
|
133
|
+
"DiffRemoved": "#F38BA8",
|
|
134
|
+
"DiffModified": "#89B4FA",
|
|
135
|
+
"GradientColors": ["#4796E4", "#847ACE", "#C3677F"]
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Security Note:** For your safety, Gemini CLI will only load theme files that are located within your home directory. If you attempt to load a theme from outside your home directory, a warning will be displayed and the theme will not be loaded. This is to prevent loading potentially malicious theme files from untrusted sources.
|
|
140
|
+
|
|
141
|
+
### Example Custom Theme
|
|
142
|
+
|
|
143
|
+
<img src="https://gw.alicdn.com/imgextra/i1/O1CN01Em30Hc1jYXAdIgls3_!!6000000004560-2-tps-1009-629.png" alt=" " style="zoom:100%;text-align:center;margin: 0 auto;" />
|
|
144
|
+
|
|
145
|
+
### Using Your Custom Theme
|
|
146
|
+
|
|
147
|
+
- Select your custom theme using the `/theme` command in Qwen Code. Your custom theme will appear in the theme selection dialog.
|
|
148
|
+
- Or, set it as the default by adding `"theme": "MyCustomTheme"` to the `ui` object in your `settings.json`.
|
|
149
|
+
- Custom themes can be set at the user, project, or system level, and follow the same [configuration precedence](../configuration/settings) as other settings.
|
|
150
|
+
|
|
151
|
+
## Themes Preview
|
|
152
|
+
|
|
153
|
+
| Dark Theme | Preview | Light Theme | Preview |
|
|
154
|
+
| :----------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|
|
155
|
+
| ANSI | <img src="https://gw.alicdn.com/imgextra/i2/O1CN01ZInJiq1GdSZc9gHsI_!!6000000000645-2-tps-1140-934.png" style="zoom:30%;text-align:center;margin: 0 auto;" /> | ANSI Light | <img src="https://gw.alicdn.com/imgextra/i2/O1CN01IiJQFC1h9E3MXQj6W_!!6000000004234-2-tps-1140-934.png" style="zoom:30%;text-align:center;margin: 0 auto;" /> |
|
|
156
|
+
| Atom OneDark | <img src="https://gw.alicdn.com/imgextra/i2/O1CN01Zlx1SO1Sw21SkTKV3_!!6000000002310-2-tps-1140-934.png" style="zoom:30%;text-align:center;margin: 0 auto;" /> | Ayu Light | <img src="https://gw.alicdn.com/imgextra/i3/O1CN01zEUc1V1jeUJsnCgQb_!!6000000004573-2-tps-1140-934.png" alt=" " style="zoom:30%;text-align:center;margin: 0 auto;" /> |
|
|
157
|
+
| Ayu | <img src="https://gw.alicdn.com/imgextra/i3/O1CN019upo6v1SmPhmRjzfN_!!6000000002289-2-tps-1140-934.png" alt=" " style="zoom:30%;text-align:center;margin: 0 auto;" /> | Default Light | <img src="https://gw.alicdn.com/imgextra/i4/O1CN01RHjrEs1u7TXq3M6l3_!!6000000005990-2-tps-1140-934.png" alt=" " style="zoom:30%;text-align:center;margin: 0 auto;" /> |
|
|
158
|
+
| Default | <img src="https://gw.alicdn.com/imgextra/i4/O1CN016pIeXz1pFC8owmR4Q_!!6000000005330-2-tps-1140-934.png" style="zoom:30%;text-align:center;margin: 0 auto;" /> | GitHub Light | <img src="https://gw.alicdn.com/imgextra/i4/O1CN01US2b0g1VETCPAVWLA_!!6000000002621-2-tps-1140-934.png" alt=" " style="zoom:30%;text-align:center;margin: 0 auto;" /> |
|
|
159
|
+
| Dracula | <img src="https://gw.alicdn.com/imgextra/i4/O1CN016htnWH20c3gd2LpUR_!!6000000006869-2-tps-1140-934.png" style="zoom:30%;text-align:center;margin: 0 auto;" /> | Google Code | <img src="https://gw.alicdn.com/imgextra/i1/O1CN01Ng29ab23iQ2BuYKz8_!!6000000007289-2-tps-1140-934.png" alt=" " style="zoom:30%;text-align:center;margin: 0 auto;" /> |
|
|
160
|
+
| GitHub | <img src="https://gw.alicdn.com/imgextra/i4/O1CN01fFCRda1IQIQ9qDNqv_!!6000000000887-2-tps-1140-934.png" alt=" " style="zoom:30%;text-align:center;margin: 0 auto;" /> | Xcode | <img src="https://gw.alicdn.com/imgextra/i1/O1CN010E3QAi1Huh5o1E9LN_!!6000000000818-2-tps-1140-934.png" alt=" " style="zoom:30%;text-align:center;margin: 0 auto;" /> |
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Trusted Folders
|
|
2
|
+
|
|
3
|
+
The Trusted Folders feature is a security setting that gives you control over which projects can use the full capabilities of the Qwen Code. It prevents potentially malicious code from running by asking you to approve a folder before the CLI loads any project-specific configurations from it.
|
|
4
|
+
|
|
5
|
+
## Enabling the Feature
|
|
6
|
+
|
|
7
|
+
The Trusted Folders feature is **disabled by default**. To use it, you must first enable it in your settings.
|
|
8
|
+
|
|
9
|
+
Add the following to your user `settings.json` file:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"security": {
|
|
14
|
+
"folderTrust": {
|
|
15
|
+
"enabled": true
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## How It Works: The Trust Dialog
|
|
22
|
+
|
|
23
|
+
Once the feature is enabled, the first time you run the Qwen Code from a folder, a dialog will automatically appear, prompting you to make a choice:
|
|
24
|
+
|
|
25
|
+
- **Trust folder**: Grants full trust to the current folder (e.g. `my-project`).
|
|
26
|
+
- **Trust parent folder**: Grants trust to the parent directory (e.g. `safe-projects`), which automatically trusts all of its subdirectories as well. This is useful if you keep all your safe projects in one place.
|
|
27
|
+
- **Don't trust**: Marks the folder as untrusted. The CLI will operate in a restricted "safe mode."
|
|
28
|
+
|
|
29
|
+
Your choice is saved in a central file (`~/.qwen/trustedFolders.json`), so you will only be asked once per folder.
|
|
30
|
+
|
|
31
|
+
## Why Trust Matters: The Impact of an Untrusted Workspace
|
|
32
|
+
|
|
33
|
+
When a folder is **untrusted**, the Qwen Code runs in a restricted "safe mode" to protect you. In this mode, the following features are disabled:
|
|
34
|
+
|
|
35
|
+
1. **Workspace Settings are Ignored**: The CLI will **not** load the `.qwen/settings.json` file from the project. This prevents the loading of custom tools and other potentially dangerous configurations.
|
|
36
|
+
|
|
37
|
+
2. **Environment Variables are Ignored**: The CLI will **not** load any `.env` files from the project.
|
|
38
|
+
|
|
39
|
+
3. **Extension Management is Restricted**: You **cannot install, update, or uninstall** extensions.
|
|
40
|
+
|
|
41
|
+
4. **Tool Auto-Acceptance is Disabled**: You will always be prompted before any tool is run, even if you have auto-acceptance enabled globally.
|
|
42
|
+
|
|
43
|
+
5. **Automatic Memory Loading is Disabled**: The CLI will not automatically load files into context from directories specified in local settings.
|
|
44
|
+
|
|
45
|
+
Granting trust to a folder unlocks the full functionality of the Qwen Code for that workspace.
|
|
46
|
+
|
|
47
|
+
## Managing Your Trust Settings
|
|
48
|
+
|
|
49
|
+
If you need to change a decision or see all your settings, you have a couple of options:
|
|
50
|
+
|
|
51
|
+
- **Change the Current Folder's Trust**: Run the `/permissions` command from within the CLI. This will bring up the same interactive dialog, allowing you to change the trust level for the current folder.
|
|
52
|
+
|
|
53
|
+
- **View All Trust Rules**: To see a complete list of all your trusted and untrusted folder rules, you can inspect the contents of the `~/.qwen/trustedFolders.json` file in your home directory.
|
|
54
|
+
|
|
55
|
+
## The Trust Check Process (Advanced)
|
|
56
|
+
|
|
57
|
+
For advanced users, it's helpful to know the exact order of operations for how trust is determined:
|
|
58
|
+
|
|
59
|
+
1. **IDE Trust Signal**: If you are using the [IDE Integration](../ide-integration/ide-integration), the CLI first asks the IDE if the workspace is trusted. The IDE's response takes highest priority.
|
|
60
|
+
|
|
61
|
+
2. **Local Trust File**: If the IDE is not connected, the CLI checks the central `~/.qwen/trustedFolders.json` file.
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Extension Releasing
|
|
2
|
+
|
|
3
|
+
There are two primary ways of releasing extensions to users:
|
|
4
|
+
|
|
5
|
+
- [Git repository](#releasing-through-a-git-repository)
|
|
6
|
+
- [Github Releases](#releasing-through-github-releases)
|
|
7
|
+
|
|
8
|
+
Git repository releases tend to be the simplest and most flexible approach, while GitHub releases can be more efficient on initial install as they are shipped as single archives instead of requiring a git clone which downloads each file individually. Github releases may also contain platform specific archives if you need to ship platform specific binary files.
|
|
9
|
+
|
|
10
|
+
## Releasing through a git repository
|
|
11
|
+
|
|
12
|
+
This is the most flexible and simple option. All you need to do us create a publicly accessible git repo (such as a public github repository) and then users can install your extension using `qwen extensions install <your-repo-uri>`, or for a GitHub repository they can use the simplified `qwen extensions install <org>/<repo>` format. They can optionally depend on a specific ref (branch/tag/commit) using the `--ref=<some-ref>` argument, this defaults to the default branch.
|
|
13
|
+
|
|
14
|
+
Whenever commits are pushed to the ref that a user depends on, they will be prompted to update the extension. Note that this also allows for easy rollbacks, the HEAD commit is always treated as the latest version regardless of the actual version in the `qwen-extension.json` file.
|
|
15
|
+
|
|
16
|
+
### Managing release channels using a git repository
|
|
17
|
+
|
|
18
|
+
Users can depend on any ref from your git repo, such as a branch or tag, which allows you to manage multiple release channels.
|
|
19
|
+
|
|
20
|
+
For instance, you can maintain a `stable` branch, which users can install this way `qwen extensions install <your-repo-uri> --ref=stable`. Or, you could make this the default by treating your default branch as your stable release branch, and doing development in a different branch (for instance called `dev`). You can maintain as many branches or tags as you like, providing maximum flexibility for you and your users.
|
|
21
|
+
|
|
22
|
+
Note that these `ref` arguments can be tags, branches, or even specific commits, which allows users to depend on a specific version of your extension. It is up to you how you want to manage your tags and branches.
|
|
23
|
+
|
|
24
|
+
### Example releasing flow using a git repo
|
|
25
|
+
|
|
26
|
+
While there are many options for how you want to manage releases using a git flow, we recommend treating your default branch as your "stable" release branch. This means that the default behavior for `qwen extensions install <your-repo-uri>` is to be on the stable release branch.
|
|
27
|
+
|
|
28
|
+
Lets say you want to maintain three standard release channels, `stable`, `preview`, and `dev`. You would do all your standard development in the `dev` branch. When you are ready to do a preview release, you merge that branch into your `preview` branch. When you are ready to promote your preview branch to stable, you merge `preview` into your stable branch (which might be your default branch or a different branch).
|
|
29
|
+
|
|
30
|
+
You can also cherry pick changes from one branch into another using `git cherry-pick`, but do note that this will result in your branches having a slightly divergent history from each other, unless you force push changes to your branches on each release to restore the history to a clean slate (which may not be possible for the default branch depending on your repository settings). If you plan on doing cherry picks, you may want to avoid having your default branch be the stable branch to avoid force-pushing to the default branch which should generally be avoided.
|
|
31
|
+
|
|
32
|
+
## Releasing through Github releases
|
|
33
|
+
|
|
34
|
+
Qwen Code extensions can be distributed through [GitHub Releases](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases). This provides a faster and more reliable initial installation experience for users, as it avoids the need to clone the repository.
|
|
35
|
+
|
|
36
|
+
Each release includes at least one archive file, which contains the full contents of the repo at the tag that it was linked to. Releases may also include [pre-built archives](#custom-pre-built-archives) if your extension requires some build step or has platform specific binaries attached to it.
|
|
37
|
+
|
|
38
|
+
When checking for updates, qwen code will just look for the latest release on github (you must mark it as such when creating the release), unless the user installed a specific release by passing `--ref=<some-release-tag>`. We do not at this time support opting in to pre-release releases or semver.
|
|
39
|
+
|
|
40
|
+
### Custom pre-built archives
|
|
41
|
+
|
|
42
|
+
Custom archives must be attached directly to the github release as assets and must be fully self-contained. This means they should include the entire extension, see [archive structure](#archive-structure).
|
|
43
|
+
|
|
44
|
+
If your extension is platform-independent, you can provide a single generic asset. In this case, there should be only one asset attached to the release.
|
|
45
|
+
|
|
46
|
+
Custom archives may also be used if you want to develop your extension within a larger repository, you can build an archive which has a different layout from the repo itself (for instance it might just be an archive of a subdirectory containing the extension).
|
|
47
|
+
|
|
48
|
+
#### Platform specific archives
|
|
49
|
+
|
|
50
|
+
To ensure Qwen Code can automatically find the correct release asset for each platform, you must follow this naming convention. The CLI will search for assets in the following order:
|
|
51
|
+
|
|
52
|
+
1. **Platform and Architecture-Specific:** `{platform}.{arch}.{name}.{extension}`
|
|
53
|
+
2. **Platform-Specific:** `{platform}.{name}.{extension}`
|
|
54
|
+
3. **Generic:** If only one asset is provided, it will be used as a generic fallback.
|
|
55
|
+
|
|
56
|
+
- `{name}`: The name of your extension.
|
|
57
|
+
- `{platform}`: The operating system. Supported values are:
|
|
58
|
+
- `darwin` (macOS)
|
|
59
|
+
- `linux`
|
|
60
|
+
- `win32` (Windows)
|
|
61
|
+
- `{arch}`: The architecture. Supported values are:
|
|
62
|
+
- `x64`
|
|
63
|
+
- `arm64`
|
|
64
|
+
- `{extension}`: The file extension of the archive (e.g., `.tar.gz` or `.zip`).
|
|
65
|
+
|
|
66
|
+
**Examples:**
|
|
67
|
+
|
|
68
|
+
- `darwin.arm64.my-tool.tar.gz` (specific to Apple Silicon Macs)
|
|
69
|
+
- `darwin.my-tool.tar.gz` (for all Macs)
|
|
70
|
+
- `linux.x64.my-tool.tar.gz`
|
|
71
|
+
- `win32.my-tool.zip`
|
|
72
|
+
|
|
73
|
+
#### Archive structure
|
|
74
|
+
|
|
75
|
+
Archives must be fully contained extensions and have all the standard requirements - specifically the `qwen-extension.json` file must be at the root of the archive.
|
|
76
|
+
|
|
77
|
+
The rest of the layout should look exactly the same as a typical extension, see [extensions.md](extension.md).
|
|
78
|
+
|
|
79
|
+
#### Example GitHub Actions workflow
|
|
80
|
+
|
|
81
|
+
Here is an example of a GitHub Actions workflow that builds and releases a Qwen Code extension for multiple platforms:
|
|
82
|
+
|
|
83
|
+
```yaml
|
|
84
|
+
name: Release Extension
|
|
85
|
+
|
|
86
|
+
on:
|
|
87
|
+
push:
|
|
88
|
+
tags:
|
|
89
|
+
- 'v*'
|
|
90
|
+
|
|
91
|
+
jobs:
|
|
92
|
+
release:
|
|
93
|
+
runs-on: ubuntu-latest
|
|
94
|
+
steps:
|
|
95
|
+
- uses: actions/checkout@v3
|
|
96
|
+
|
|
97
|
+
- name: Set up Node.js
|
|
98
|
+
uses: actions/setup-node@v3
|
|
99
|
+
with:
|
|
100
|
+
node-version: '20'
|
|
101
|
+
|
|
102
|
+
- name: Install dependencies
|
|
103
|
+
run: npm ci
|
|
104
|
+
|
|
105
|
+
- name: Build extension
|
|
106
|
+
run: npm run build
|
|
107
|
+
|
|
108
|
+
- name: Create release assets
|
|
109
|
+
run: |
|
|
110
|
+
npm run package -- --platform=darwin --arch=arm64
|
|
111
|
+
npm run package -- --platform=linux --arch=x64
|
|
112
|
+
npm run package -- --platform=win32 --arch=x64
|
|
113
|
+
|
|
114
|
+
- name: Create GitHub Release
|
|
115
|
+
uses: softprops/action-gh-release@v1
|
|
116
|
+
with:
|
|
117
|
+
files: |
|
|
118
|
+
release/darwin.arm64.my-tool.tar.gz
|
|
119
|
+
release/linux.arm64.my-tool.tar.gz
|
|
120
|
+
release/win32.arm64.my-tool.zip
|
|
121
|
+
```
|
|
@@ -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.
|