@qoder-ai/qodercli 0.2.2-beta.3 → 0.2.2-beta.4
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 +202 -0
- package/README.md +368 -0
- package/{bundle → bin}/builtin/agent-creator/SKILL.md +15 -26
- package/{bundle → bin}/builtin/skill-creator/SKILL.md +4 -3
- package/bin/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js.map +1 -0
- package/bin/node_modules/@google/gemini-cli-devtools/dist/src/index.js.map +1 -0
- package/bin/node_modules/@google/gemini-cli-devtools/dist/src/types.js.map +1 -0
- package/bin/qodercli +0 -0
- package/bin/run.js +28 -0
- package/package.json +16 -25
- package/bundle/builtin/hook-config/SKILL.md +0 -480
- package/bundle/builtin/mcp-config/SKILL.md +0 -155
- package/bundle/policies/sandbox-default.toml +0 -19
- package/bundle/postinstall.cjs +0 -16
- package/bundle/qodercli.js +0 -5170
- package/bundle/sandbox-macos-permissive-open.sb +0 -27
- package/bundle/sandbox-macos-permissive-proxied.sb +0 -37
- package/bundle/sandbox-macos-restrictive-open.sb +0 -96
- package/bundle/sandbox-macos-restrictive-proxied.sb +0 -98
- package/bundle/sandbox-macos-strict-open.sb +0 -131
- package/bundle/sandbox-macos-strict-proxied.sb +0 -133
- /package/{bundle → bin}/node_modules/@google/gemini-cli-devtools/dist/client/main.js +0 -0
- /package/{bundle → bin}/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.d.ts +0 -0
- /package/{bundle → bin}/node_modules/@google/gemini-cli-devtools/dist/src/_client-assets.js +0 -0
- /package/{bundle → bin}/node_modules/@google/gemini-cli-devtools/dist/src/index.d.ts +0 -0
- /package/{bundle → bin}/node_modules/@google/gemini-cli-devtools/dist/src/index.js +0 -0
- /package/{bundle → bin}/node_modules/@google/gemini-cli-devtools/dist/src/types.d.ts +0 -0
- /package/{bundle → bin}/node_modules/@google/gemini-cli-devtools/dist/src/types.js +0 -0
- /package/{bundle → bin}/node_modules/@google/gemini-cli-devtools/package.json +0 -0
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mcp-config
|
|
3
|
-
description: Interactively add, update, or remove MCP (Model Context Protocol) servers in QoderCLI config files. Use this skill whenever the user pastes an MCP server config snippet, asks to "add an MCP", "配置 MCP", "install this MCP server", "register an MCP", wants to move an MCP between project/user/local scope, or asks why a newly pasted MCP isn't showing up. Handles stdio, http, sse, and ws transports, merges safely into the right target file (`<repo>/.qoder/settings.json`, `~/.qoder/settings.json`, or `<repo>/.qoder/settings.local.json`), and tells the user exactly how to reload so the server actually connects.
|
|
4
|
-
allowed-tools: Bash, Edit, Read, Write
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# MCP Config Helper (QoderCLI)
|
|
8
|
-
|
|
9
|
-
Help the user land an MCP server config into the right QoderCLI config file, merge it cleanly with what's already there, and reload it so it actually takes effect.
|
|
10
|
-
|
|
11
|
-
## When this skill fires
|
|
12
|
-
|
|
13
|
-
Typical user inputs:
|
|
14
|
-
|
|
15
|
-
- Pastes a JSON blob that looks like an MCP server definition (has `command`, `args`, or `url` + `type`)
|
|
16
|
-
- "帮我把这个 MCP 加到项目里"
|
|
17
|
-
- "Add this MCP server to user scope"
|
|
18
|
-
- "Why isn't my new MCP showing up in `/mcp`?"
|
|
19
|
-
- "Move the filesystem MCP from project to user scope"
|
|
20
|
-
- "Remove the old foo MCP"
|
|
21
|
-
|
|
22
|
-
If the user's request doesn't involve MCP server registration, don't invoke this skill.
|
|
23
|
-
|
|
24
|
-
## Prefer the built-in CLI when possible
|
|
25
|
-
|
|
26
|
-
QoderCLI ships first-class commands for MCP CRUD:
|
|
27
|
-
|
|
28
|
-
- `qodercli mcp add <name> <commandOrUrl> [args...] --scope <user|local|project> --transport <stdio|sse|http|ws>`
|
|
29
|
-
- `qodercli mcp add-json <name> <json> --scope <user|local|project>` — ideal when the user pasted a full server body, just wrap it and pass through.
|
|
30
|
-
- `qodercli mcp list`, `qodercli mcp get <name>`, `qodercli mcp remove <name> --scope ...`
|
|
31
|
-
|
|
32
|
-
If the user's ask maps cleanly onto one of these, run the command via Bash instead of hand-editing JSON — the CLI handles collision detection, OAuth setup, scope validation, and writes to the right file. Fall back to direct file editing only when: (a) the user is doing a cross-scope move (read from one, write to another), (b) the user wants a surgical edit to an env var or header on an existing entry, or (c) the CLI rejects the input and you need to diagnose why.
|
|
33
|
-
|
|
34
|
-
## What the user pastes
|
|
35
|
-
|
|
36
|
-
MCP configs come in several shapes. Normalize them before writing. Common inputs:
|
|
37
|
-
|
|
38
|
-
**Full server block (most common — from docs/README):**
|
|
39
|
-
```json
|
|
40
|
-
{
|
|
41
|
-
"mcpServers": {
|
|
42
|
-
"filesystem": {
|
|
43
|
-
"command": "npx",
|
|
44
|
-
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"]
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**Single server entry (name + body):**
|
|
51
|
-
```json
|
|
52
|
-
"filesystem": {
|
|
53
|
-
"command": "npx",
|
|
54
|
-
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"]
|
|
55
|
-
}
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
**Just the body (user will supply the name):**
|
|
59
|
-
```json
|
|
60
|
-
{ "command": "npx", "args": ["-y", "..."] }
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
**HTTP / SSE transport:**
|
|
64
|
-
```json
|
|
65
|
-
{
|
|
66
|
-
"type": "http",
|
|
67
|
-
"url": "https://example.com/mcp",
|
|
68
|
-
"headers": { "Authorization": "Bearer ..." }
|
|
69
|
-
}
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
If the name is missing from the snippet, ask the user what to call the server. Don't invent one.
|
|
73
|
-
|
|
74
|
-
## Target files (scopes)
|
|
75
|
-
|
|
76
|
-
QoderCLI supports three MCP scopes. Pick the right file — the difference matters:
|
|
77
|
-
|
|
78
|
-
| Scope | File | `mcpServers` lives at | When to use |
|
|
79
|
-
| --------- | ------------------------------------------ | ------------------------------ | --------------------------------------------------------------------- |
|
|
80
|
-
| `project` | `<repo>/.qoder/settings.json` | top-level `mcpServers` | Shared with the team via git. Use for project-wide, committed config. |
|
|
81
|
-
| `user` | `~/.qoder/settings.json` | top-level `mcpServers` | Available across all projects for this user. Use for personal tools. |
|
|
82
|
-
| `local` | `<repo>/.qoder/settings.local.json` | top-level `mcpServers` | Project-specific, user-only, **gitignored**. This is the CLI default. |
|
|
83
|
-
|
|
84
|
-
**Do NOT write to any of these — they are wrong targets that look plausible but the CLI does not read:**
|
|
85
|
-
- `<repo>/.mcp.json` or `~/.mcp.json` (Claude Code convention, not QoderCLI)
|
|
86
|
-
- `~/.qoder/mcp.json` (no such file — user MCPs go inside `~/.qoder/settings.json` under `mcpServers`)
|
|
87
|
-
- `~/Library/Application Support/Qoder/User/mcp.json` or any VS Code extension path
|
|
88
|
-
- `~/.claude.json` or `~/.claude/settings.json` (those are Claude Code, not QoderCLI)
|
|
89
|
-
|
|
90
|
-
The only three valid targets are the three rows in the table above. If you find yourself about to write somewhere else, stop.
|
|
91
|
-
|
|
92
|
-
**Scope selection — don't default silently.** If the user hasn't specified a scope, ask before writing. A one-liner is enough: "Add this to **project** (`<repo>/.qoder/settings.json`, committed), **user** (`~/.qoder/settings.json`, global), or **local** (`<repo>/.qoder/settings.local.json`, gitignored)?"
|
|
93
|
-
|
|
94
|
-
Don't guess "probably local scope just because it's the CLI default" — the difference between project (checked into git, teammates see it) and user/local (personal) is significant, and picking wrong can leak secrets or clutter a teammate's config. Users routinely paste MCP configs from docs that don't mention scope; they need the prompt.
|
|
95
|
-
|
|
96
|
-
Exception: proceed without asking only when phrasing makes it genuinely unambiguous — "add to this project", "push this to the team", "only for me globally", "just for this repo". Vague signals like "装一下" / "加进去" do not qualify.
|
|
97
|
-
|
|
98
|
-
## Workflow
|
|
99
|
-
|
|
100
|
-
1. **Parse the pasted config.** Extract: server name, transport (`stdio` if `command` present, else `http`/`sse`/`ws` based on `type`/`url`), and the server body. Normalize so the write step only deals with a clean `(name, body)` pair.
|
|
101
|
-
|
|
102
|
-
2. **Confirm scope** if not obvious from the user's message (see table above).
|
|
103
|
-
|
|
104
|
-
3. **Decide: CLI or direct edit?** For a plain add with a clean body, `qodercli mcp add-json <name> '<json>' --scope <scope>` is the shortest path and handles collision errors for you. For cross-scope moves, surgical field edits, or removals from multiple scopes at once, go direct.
|
|
105
|
-
|
|
106
|
-
4. **If direct-editing, read the target file.** Use the Read tool. If the file doesn't exist, plan to create it with `{ "mcpServers": { ... } }`. If it exists, add/update a top-level `mcpServers` key and preserve every other setting already in the file.
|
|
107
|
-
|
|
108
|
-
5. **Detect collisions — but don't be precious.** Two sub-cases:
|
|
109
|
-
- **User explicitly asked to update/replace/move an existing entry** (e.g. "把 filesystem 路径改成...", "update the github token", "replace example-api"): just do it. Don't ask for reconfirmation. A one-line "found existing filesystem at /old/path → updating to /new/path" is plenty; the user already decided.
|
|
110
|
-
- **User pasted a new config that happens to collide** (no mention of the existing entry, likely unaware it's there): stop and show them the existing entry vs. the new one, ask replace/rename/cancel. Silent overwrite here loses hand-edited fields (env vars, auth headers) and surprises the user.
|
|
111
|
-
|
|
112
|
-
The distinguishing signal: did the user's wording acknowledge that the server already exists? If yes, proceed. If no and there's a collision, surface it. Note that `qodercli mcp add`/`add-json` *refuses* to overwrite by default — if the user wants a replace, either remove-then-add via CLI, or fall back to a direct Edit.
|
|
113
|
-
|
|
114
|
-
6. **Merge and write.** For direct edits, use the Edit tool for surgical changes when the file exists (especially `~/.qoder/settings.json`, which holds unrelated settings and shouldn't be rewritten wholesale). Only rewrite the whole file with Write when creating it fresh. Preserve formatting — match the existing indentation.
|
|
115
|
-
|
|
116
|
-
7. **Validate.** After writing, read the relevant slice back and confirm the JSON parses and the server is present. All three targets are real settings files — a corrupted write breaks settings on the next start, so validation isn't optional.
|
|
117
|
-
|
|
118
|
-
8. **Tell the user how to reload.** See below.
|
|
119
|
-
|
|
120
|
-
## Reload instructions
|
|
121
|
-
|
|
122
|
-
MCP servers are loaded at startup and on explicit reconnect. After editing config, the user must reload. Tell them the shortest path:
|
|
123
|
-
|
|
124
|
-
- **Added or changed a server (running session)**: run `/mcp reload` inside QoderCLI — it restarts all MCP clients and refreshes the tool surface. This is the one you want 95% of the time.
|
|
125
|
-
- **Inspect what's loaded**: `/mcp` lists current servers and their status.
|
|
126
|
-
- **Project-scope first-time add**: QoderCLI prompts for approval before running project-level MCP servers (this is enforced via the project-MCP approval flow). The user will see a trust prompt the first time `/mcp reload` picks up the new entry — mention this so they're not surprised.
|
|
127
|
-
- **Removed a server**: `/mcp reload` drops the connection. If you only removed it from one of multiple scopes, it may still show up from another — `qodercli mcp list` confirms where it still lives.
|
|
128
|
-
|
|
129
|
-
Keep the reload instruction to one or two sentences — don't lecture.
|
|
130
|
-
|
|
131
|
-
## Gotchas worth flagging
|
|
132
|
-
|
|
133
|
-
- **Env vars with secrets**: if the pasted config has `"env": { "API_KEY": "sk-..." }` with a real-looking secret, flag it: "This config has what looks like a real API key — do you want to move it to an env var reference or keep it inline?" Don't refuse; just surface the choice.
|
|
134
|
-
- **Settings files hold unrelated keys**: all three targets also store user preferences, keybinding toggles, auth hints, etc. Never rewrite a settings file whole — Edit the specific `mcpServers` slice.
|
|
135
|
-
- **Shared `.qoder` directory name**: user settings live in `~/.qoder/settings.json`; project shared settings in `<repo>/.qoder/settings.json`; project-local (gitignored) in `<repo>/.qoder/settings.local.json`. Keep the scope clear before writing.
|
|
136
|
-
- **Relative paths**: stdio `command`/`args` often reference local scripts. If the user pastes `./server.js`, ask whether they want it resolved to an absolute path — relative paths break when the CLI starts from a different cwd.
|
|
137
|
-
- **Project-scope is committed**: `<repo>/.qoder/settings.json` ends up in git. Remind the user not to include secrets there — for secret-bearing configs prefer `user` or `local`.
|
|
138
|
-
- **Plugin-provided MCPs**: servers whose names start with `mcp__plugin_` come from installed extensions, not user config. Don't try to edit them via this skill — point the user to the extension's own config.
|
|
139
|
-
|
|
140
|
-
## Output style
|
|
141
|
-
|
|
142
|
-
Length should match what's actually at stake — not a fixed rule.
|
|
143
|
-
|
|
144
|
-
**Default (simple add, no concerns):** one or two sentences. What was written where, how to reload. The user pasted config and wants it landed.
|
|
145
|
-
|
|
146
|
-
> Added `filesystem` (stdio) to `~/.qoder/settings.json` (user scope). Run `/mcp reload` to pick it up.
|
|
147
|
-
|
|
148
|
-
**When there's something worth flagging, don't suppress it to stay terse.** Brief matters less than "the user understood what just happened and what to do next." Specifically, add a short follow-up paragraph (2-4 sentences) when:
|
|
149
|
-
|
|
150
|
-
- **The pasted config contained a real-looking secret** (Bearer token, API key, password). Tell them it's now sitting in plaintext in the config file, that project-scope `<repo>/.qoder/settings.json` is committed to git and `~/.qoder/settings.json` is often synced via dotfiles, and offer to switch to env-var reference or rotation if exposed. Don't assume they've thought this through — many people paste from copy-paste without realizing.
|
|
151
|
-
- **The operation has a non-obvious side effect** the user probably didn't anticipate. E.g., for `@modelcontextprotocol/server-filesystem`, changing the path replaces — it doesn't merge, so the old dir loses access. Mention it in one line.
|
|
152
|
-
- **The collision was silent** (user didn't mention the existing entry). Surface what was there before the change.
|
|
153
|
-
- **Scope crossed trust boundary** (e.g. moved from `local` → `project`). Remind them it's now committed and teammates will pick it up on next pull.
|
|
154
|
-
|
|
155
|
-
Don't pad. Don't add headers (`## 生效方式`, `## 安全提醒`) for a 2-sentence response — just write the sentences. Headers only earn their keep when the response is long enough that scanning matters.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
[modes.plan]
|
|
2
|
-
network = false
|
|
3
|
-
readonly = true
|
|
4
|
-
approvedTools = []
|
|
5
|
-
allowOverrides = true
|
|
6
|
-
|
|
7
|
-
[modes.default]
|
|
8
|
-
network = false
|
|
9
|
-
readonly = false
|
|
10
|
-
approvedTools = ['cat', 'ls', 'grep', 'head', 'tail', 'less', 'Get-Content', 'dir', 'type', 'findstr', 'Get-ChildItem', 'echo']
|
|
11
|
-
allowOverrides = true
|
|
12
|
-
|
|
13
|
-
[modes.accepting_edits]
|
|
14
|
-
network = false
|
|
15
|
-
readonly = false
|
|
16
|
-
approvedTools = ['sed', 'grep', 'awk', 'perl', 'cat', 'echo', 'Add-Content', 'Set-Content']
|
|
17
|
-
allowOverrides = true
|
|
18
|
-
|
|
19
|
-
[commands]
|
package/bundle/postinstall.cjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* npm postinstall hook — writes installation source marker for update routing.
|
|
4
|
-
* Aligned with qodercli-old: core/utils/install/source.go reads this file
|
|
5
|
-
* to determine how the CLI was installed (npm, homebrew-cask, curl-bash).
|
|
6
|
-
*/
|
|
7
|
-
const fs = require('node:fs');
|
|
8
|
-
const path = require('node:path');
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
const pkgRoot = path.resolve(__dirname, '..');
|
|
12
|
-
const markerPath = path.join(pkgRoot, '.qodercli-install-resource');
|
|
13
|
-
fs.writeFileSync(markerPath, 'npm', 'utf8');
|
|
14
|
-
} catch {
|
|
15
|
-
// Silent failure — marker is best-effort, should never block installation
|
|
16
|
-
}
|