@cg3/equip 0.2.7 → 0.2.9
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 +43 -2
- package/bin/equip.js +26 -3
- package/lib/detect.js +34 -2
- package/lib/platforms.js +31 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,17 +6,35 @@ Equip handles the hard part of distributing your MCP tool: detecting which AI co
|
|
|
6
6
|
|
|
7
7
|
## Supported Platforms
|
|
8
8
|
|
|
9
|
+
Equip supports **11 platforms** across two tiers, depending on whether the platform has a writable location for behavioral rules.
|
|
10
|
+
|
|
11
|
+
### Full Support — MCP + Behavioral Rules
|
|
12
|
+
|
|
13
|
+
These platforms get both MCP server config *and* auto-installed behavioral rules. Rules teach agents *when* to use your tool (e.g., "search before debugging") and are versioned for idempotent updates.
|
|
14
|
+
|
|
9
15
|
| Platform | MCP Config | Rules |
|
|
10
16
|
|---|---|---|
|
|
11
17
|
| Claude Code | `~/.claude.json` (JSON, `mcpServers`) | `~/.claude/CLAUDE.md` (append) |
|
|
12
|
-
| Cursor | `~/.cursor/mcp.json` (JSON, `mcpServers`) | Clipboard (no writable global path) |
|
|
13
18
|
| Windsurf | `~/.codeium/windsurf/mcp_config.json` (JSON, `mcpServers`) | `global_rules.md` (append) |
|
|
14
|
-
| VS Code | `Code/User/mcp.json` (JSON, `servers`, `type: "http"`) | Clipboard |
|
|
15
19
|
| Cline | `globalStorage/.../cline_mcp_settings.json` (JSON, `mcpServers`) | `~/Documents/Cline/Rules/` (standalone file) |
|
|
16
20
|
| Roo Code | `globalStorage/.../cline_mcp_settings.json` (JSON, `mcpServers`) | `~/.roo/rules/` (standalone file) |
|
|
17
21
|
| Codex | `~/.codex/config.toml` (TOML, `mcp_servers`) | `~/.codex/AGENTS.md` (append) |
|
|
18
22
|
| Gemini CLI | `~/.gemini/settings.json` (JSON, `mcpServers`, `httpUrl`) | `~/.gemini/GEMINI.md` (append) |
|
|
19
23
|
|
|
24
|
+
### MCP Only — No Writable Rules Path
|
|
25
|
+
|
|
26
|
+
These platforms get MCP server config but don't have a writable global rules file (`rulesPath: null`). The MCP tools work fine — but equip can't auto-install behavioral rules.
|
|
27
|
+
|
|
28
|
+
| Platform | MCP Config |
|
|
29
|
+
|---|---|
|
|
30
|
+
| Cursor | `~/.cursor/mcp.json` (JSON, `mcpServers`) |
|
|
31
|
+
| VS Code | `Code/User/mcp.json` (JSON, `servers`, `type: "http"`) |
|
|
32
|
+
| Junie (JetBrains) | `~/.junie/mcp/mcp.json` (JSON, `mcpServers`) |
|
|
33
|
+
| Copilot (JetBrains) | `~/.config/github-copilot/intellij/mcp.json` (JSON, `mcpServers`) |
|
|
34
|
+
| Copilot CLI | `~/.copilot/mcp-config.json` (JSON, `mcpServers`) |
|
|
35
|
+
|
|
36
|
+
For these platforms, `installRules()` returns `{ action: "clipboard" }` if the platform is in the configurable `clipboardPlatforms` list (default: `["cursor", "vscode"]`), or `{ action: "skipped" }` otherwise. It's up to the consumer to decide how to handle this — e.g., copying rules to the clipboard, printing instructions, or skipping silently.
|
|
37
|
+
|
|
20
38
|
## Quick Start
|
|
21
39
|
|
|
22
40
|
```bash
|
|
@@ -25,6 +43,28 @@ npx @cg3/equip prior
|
|
|
25
43
|
|
|
26
44
|
That's it. Detects your platforms, authenticates, installs MCP + rules, and verifies — all in one command. Pass `--dry-run` to preview without writing files.
|
|
27
45
|
|
|
46
|
+
## CLI Usage
|
|
47
|
+
|
|
48
|
+
You can invoke any npm package that has an equip-based setup command:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
# Full package name + command
|
|
52
|
+
npx @cg3/equip @cg3/prior-node setup
|
|
53
|
+
|
|
54
|
+
# Shorthand (if registered)
|
|
55
|
+
npx @cg3/equip prior
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The CLI runs `npx -y <package>@latest <command>` with any extra args forwarded (e.g. `--dry-run`, `--platform codex`).
|
|
59
|
+
|
|
60
|
+
### Shorthand Registry
|
|
61
|
+
|
|
62
|
+
Registered shorthands save typing. Open a PR to `bin/equip.js` to add yours:
|
|
63
|
+
|
|
64
|
+
| Shorthand | Expands to |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `prior` | `@cg3/prior-node setup` |
|
|
67
|
+
|
|
28
68
|
## Programmatic Usage
|
|
29
69
|
|
|
30
70
|
```js
|
|
@@ -94,6 +134,7 @@ const { detectPlatforms, installMcpJson, installRules, createManualPlatform, pla
|
|
|
94
134
|
## Key Features
|
|
95
135
|
|
|
96
136
|
- **Zero dependencies** — Pure Node.js, works with Node 18+
|
|
137
|
+
- **11 platforms** — Covers ~80% of active AI coding tool users
|
|
97
138
|
- **Platform-aware** — Handles each platform's config quirks (JSON vs TOML, root keys, URL fields, type requirements)
|
|
98
139
|
- **Non-destructive** — Merges into existing configs, creates backups, preserves other servers
|
|
99
140
|
- **Versioned rules** — Marker-based blocks enable idempotent updates without clobbering user content
|
package/bin/equip.js
CHANGED
|
@@ -36,10 +36,33 @@ if (!alias || alias === "--help" || alias === "-h") {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
const entry = TOOLS[alias];
|
|
39
|
+
|
|
40
|
+
// No registry match — treat as a package name (e.g. "@scope/pkg setup")
|
|
39
41
|
if (!entry) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
42
|
+
const pkg = alias;
|
|
43
|
+
const command = extraArgs.shift(); // first extra arg is the command
|
|
44
|
+
if (!command) {
|
|
45
|
+
console.error(`Usage: npx @cg3/equip <package> <command> [options]`);
|
|
46
|
+
console.error(` or: npx @cg3/equip <shorthand> [options]`);
|
|
47
|
+
console.error("");
|
|
48
|
+
console.error("Registered shorthands:");
|
|
49
|
+
for (const [name, info] of Object.entries(TOOLS)) {
|
|
50
|
+
console.log(` ${name} → ${info.package} ${info.command}`);
|
|
51
|
+
}
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
const npxCmd = process.platform === "win32" ? "npx.cmd" : "npx";
|
|
55
|
+
const child = spawn(npxCmd, ["-y", `${pkg}@latest`, command, ...extraArgs], {
|
|
56
|
+
stdio: "inherit",
|
|
57
|
+
shell: process.platform === "win32",
|
|
58
|
+
env: { ...process.env, EQUIP_VERSION },
|
|
59
|
+
});
|
|
60
|
+
child.on("close", (code) => process.exit(code || 0));
|
|
61
|
+
child.on("error", (err) => {
|
|
62
|
+
console.error(`Failed to run ${pkg}: ${err.message}`);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
});
|
|
65
|
+
return;
|
|
43
66
|
}
|
|
44
67
|
|
|
45
68
|
// Spawn: npx -y <package> <command> [...extraArgs]
|
package/lib/detect.js
CHANGED
|
@@ -7,7 +7,7 @@ const fs = require("fs");
|
|
|
7
7
|
const path = require("path");
|
|
8
8
|
const os = require("os");
|
|
9
9
|
const { execSync } = require("child_process");
|
|
10
|
-
const { getVsCodeMcpPath, getVsCodeUserDir, getClineConfigPath, getRooConfigPath, getCodexConfigPath, getGeminiSettingsPath, getJunieMcpPath } = require("./platforms");
|
|
10
|
+
const { getVsCodeMcpPath, getVsCodeUserDir, getClineConfigPath, getRooConfigPath, getCodexConfigPath, getGeminiSettingsPath, getJunieMcpPath, getCopilotJetBrainsMcpPath, getCopilotCliMcpPath } = require("./platforms");
|
|
11
11
|
const { readMcpEntry } = require("./mcp");
|
|
12
12
|
|
|
13
13
|
// ─── Helpers ─────────────────────────────────────────────────
|
|
@@ -190,7 +190,7 @@ function detectPlatforms(serverName) {
|
|
|
190
190
|
platform: "junie",
|
|
191
191
|
version: cliVersion("junie") || "unknown",
|
|
192
192
|
configPath: junieMcpPath,
|
|
193
|
-
rulesPath: null,
|
|
193
|
+
rulesPath: null,
|
|
194
194
|
existingMcp: serverName ? readMcpEntry(junieMcpPath, "mcpServers", serverName) : null,
|
|
195
195
|
hasCli: !!whichSync("junie"),
|
|
196
196
|
rootKey: "mcpServers",
|
|
@@ -198,6 +198,38 @@ function detectPlatforms(serverName) {
|
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
+
// GitHub Copilot in JetBrains IDEs
|
|
202
|
+
const copilotJbPath = getCopilotJetBrainsMcpPath();
|
|
203
|
+
const copilotJbDir = path.dirname(path.dirname(copilotJbPath)); // github-copilot dir
|
|
204
|
+
if (dirExists(copilotJbDir)) {
|
|
205
|
+
platforms.push({
|
|
206
|
+
platform: "copilot-jetbrains",
|
|
207
|
+
version: "unknown",
|
|
208
|
+
configPath: copilotJbPath,
|
|
209
|
+
rulesPath: null,
|
|
210
|
+
existingMcp: serverName ? readMcpEntry(copilotJbPath, "mcpServers", serverName) : null,
|
|
211
|
+
hasCli: false,
|
|
212
|
+
rootKey: "mcpServers",
|
|
213
|
+
configFormat: "json",
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// GitHub Copilot CLI
|
|
218
|
+
const copilotCliDir = path.join(home, ".copilot");
|
|
219
|
+
const copilotCliMcpPath = getCopilotCliMcpPath();
|
|
220
|
+
if (whichSync("copilot") || dirExists(copilotCliDir)) {
|
|
221
|
+
platforms.push({
|
|
222
|
+
platform: "copilot-cli",
|
|
223
|
+
version: cliVersion("copilot") || "unknown",
|
|
224
|
+
configPath: copilotCliMcpPath,
|
|
225
|
+
rulesPath: null,
|
|
226
|
+
existingMcp: serverName ? readMcpEntry(copilotCliMcpPath, "mcpServers", serverName) : null,
|
|
227
|
+
hasCli: !!whichSync("copilot"),
|
|
228
|
+
rootKey: "mcpServers",
|
|
229
|
+
configFormat: "json",
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
|
|
201
233
|
return platforms;
|
|
202
234
|
}
|
|
203
235
|
|
package/lib/platforms.js
CHANGED
|
@@ -44,6 +44,19 @@ function getJunieMcpPath() {
|
|
|
44
44
|
return path.join(home, ".junie", "mcp", "mcp.json");
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
function getCopilotJetBrainsMcpPath() {
|
|
48
|
+
const home = os.homedir();
|
|
49
|
+
if (process.platform === "win32") {
|
|
50
|
+
return path.join(process.env.APPDATA || path.join(home, "AppData", "Roaming"), "github-copilot", "intellij", "mcp.json");
|
|
51
|
+
}
|
|
52
|
+
return path.join(home, ".config", "github-copilot", "intellij", "mcp.json");
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function getCopilotCliMcpPath() {
|
|
56
|
+
const home = os.homedir();
|
|
57
|
+
return path.join(home, ".copilot", "mcp-config.json");
|
|
58
|
+
}
|
|
59
|
+
|
|
47
60
|
// ─── Platform Registry ──────────────────────────────────────
|
|
48
61
|
|
|
49
62
|
/**
|
|
@@ -104,7 +117,19 @@ function createManualPlatform(platformId) {
|
|
|
104
117
|
},
|
|
105
118
|
junie: {
|
|
106
119
|
configPath: getJunieMcpPath(),
|
|
107
|
-
rulesPath: null,
|
|
120
|
+
rulesPath: null,
|
|
121
|
+
rootKey: "mcpServers",
|
|
122
|
+
configFormat: "json",
|
|
123
|
+
},
|
|
124
|
+
"copilot-jetbrains": {
|
|
125
|
+
configPath: getCopilotJetBrainsMcpPath(),
|
|
126
|
+
rulesPath: null,
|
|
127
|
+
rootKey: "mcpServers",
|
|
128
|
+
configFormat: "json",
|
|
129
|
+
},
|
|
130
|
+
"copilot-cli": {
|
|
131
|
+
configPath: getCopilotCliMcpPath(),
|
|
132
|
+
rulesPath: null,
|
|
108
133
|
rootKey: "mcpServers",
|
|
109
134
|
configFormat: "json",
|
|
110
135
|
},
|
|
@@ -132,6 +157,8 @@ function platformName(id) {
|
|
|
132
157
|
codex: "Codex",
|
|
133
158
|
"gemini-cli": "Gemini CLI",
|
|
134
159
|
junie: "Junie",
|
|
160
|
+
"copilot-jetbrains": "Copilot (JetBrains)",
|
|
161
|
+
"copilot-cli": "Copilot CLI",
|
|
135
162
|
};
|
|
136
163
|
return names[id] || id;
|
|
137
164
|
}
|
|
@@ -139,7 +166,7 @@ function platformName(id) {
|
|
|
139
166
|
/**
|
|
140
167
|
* All known platform IDs.
|
|
141
168
|
*/
|
|
142
|
-
const KNOWN_PLATFORMS = ["claude-code", "cursor", "windsurf", "vscode", "cline", "roo-code", "codex", "gemini-cli", "junie"];
|
|
169
|
+
const KNOWN_PLATFORMS = ["claude-code", "cursor", "windsurf", "vscode", "cline", "roo-code", "codex", "gemini-cli", "junie", "copilot-jetbrains", "copilot-cli"];
|
|
143
170
|
|
|
144
171
|
module.exports = {
|
|
145
172
|
getVsCodeUserDir,
|
|
@@ -149,6 +176,8 @@ module.exports = {
|
|
|
149
176
|
getCodexConfigPath,
|
|
150
177
|
getGeminiSettingsPath,
|
|
151
178
|
getJunieMcpPath,
|
|
179
|
+
getCopilotJetBrainsMcpPath,
|
|
180
|
+
getCopilotCliMcpPath,
|
|
152
181
|
createManualPlatform,
|
|
153
182
|
platformName,
|
|
154
183
|
KNOWN_PLATFORMS,
|