@yagyeshvyas/vibeguard 1.3.0 → 1.11.1
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/.vibeguard-mcp.example.json +51 -0
- package/CHANGELOG.md +604 -216
- package/MCP-FIREWALL.md +296 -0
- package/README.md +355 -31
- package/bin/cli.js +355 -27
- package/bin/cmd-agent-monitor.js +45 -0
- package/bin/cmd-agent-risk.js +64 -0
- package/bin/cmd-gif.js +62 -0
- package/bin/cmd-git-scan.js +74 -0
- package/bin/cmd-llm-proxy.js +164 -0
- package/bin/cmd-mcp-firewall.js +191 -0
- package/bin/cmd-pentest.js +103 -0
- package/bin/cmd-platform.js +137 -0
- package/bin/cmd-pr-scan.js +135 -0
- package/bin/cmd-sbom-diff.js +38 -0
- package/bin/cmd-skill-scan.js +35 -0
- package/docs/AISVS.md +25 -0
- package/docs/ARCHITECTURE.md +81 -0
- package/docs/INSTALLATION.md +139 -0
- package/docs/WINDOWS.md +74 -0
- package/docs/security-policy.strict.example.json +134 -0
- package/docs/security-policy.strict.example.pub.pem +3 -0
- package/package.json +45 -7
- package/src/.vibeguard/cache/file-hashes.json +60 -0
- package/src/.vibeguard/latest-snapshot.json +36 -0
- package/src/.vibeguard/mcp-pins.json +1 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/auto.js +428 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/daemon.js +344 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/dashboard.js +279 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/engine.js +297 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/hook.js +151 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/install.js +299 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/manifest.json +65 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/mcp-server.js +2051 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/plugin.js +168 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/pre-deploy.js +362 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/repl.js +150 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/rules.js +1611 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/sbom.js +164 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/shell-guard.js +292 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/slopsquat.js +144 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-23-50-635Z/trace.js +220 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/auto.js +428 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/daemon.js +344 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/engine.js +297 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/install.js +299 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/manifest.json +37 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/mcp-server.js +2055 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/plugin.js +168 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/pre-deploy.js +362 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-26-26-074Z/trace.js +220 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/auto.js +428 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/daemon.js +344 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/dashboard.js +279 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/engine.js +297 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/hook.js +151 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/install.js +299 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/manifest.json +65 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/mcp-server.js +2055 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/plugin.js +168 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/pre-deploy.js +362 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/repl.js +150 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/rules.js +1611 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/sbom.js +164 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/shell-guard.js +292 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/slopsquat.js +144 -0
- package/src/.vibeguard/snapshots/2026-08-05T16-35-06-272Z/trace.js +220 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/auto.js +428 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/daemon.js +344 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/dashboard.js +279 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/engine.js +297 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/hook.js +151 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/install.js +299 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/manifest.json +65 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/mcp-server.js +2054 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/plugin.js +168 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/pre-deploy.js +362 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/repl.js +150 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/rules.js +1611 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/sbom.js +164 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/shell-guard.js +292 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/slopsquat.js +144 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-08-40-613Z/trace.js +220 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/auto.js +428 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/daemon.js +344 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/engine.js +297 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/install.js +299 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/manifest.json +37 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/mcp-server.js +2055 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/plugin.js +168 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/pre-deploy.js +362 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-11-32-644Z/trace.js +220 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/auto.js +428 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/daemon.js +344 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/engine.js +297 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/manifest.json +33 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/mcp-server.js +2055 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/rules.js +1611 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/shell-guard.js +292 -0
- package/src/.vibeguard/snapshots/2026-08-05T18-16-47-635Z/trace.js +220 -0
- package/src/.vibeguard-baseline.json +5226 -0
- package/src/action-guard.js +84 -6
- package/src/agent-monitor.js +262 -0
- package/src/agent-policy.js +642 -0
- package/src/agent-risk.js +271 -0
- package/src/agentic.js +1513 -0
- package/src/ast.js +165 -7
- package/src/audit-trail.js +212 -67
- package/src/auto.js +427 -427
- package/src/autofix.js +11 -4
- package/src/bundles.js +198 -0
- package/src/daemon.js +343 -343
- package/src/dashboard.js +278 -278
- package/src/engine.js +3 -0
- package/src/entropy.js +187 -0
- package/src/firewall.js +19 -3
- package/src/gif.js +134 -0
- package/src/gitscan.js +282 -0
- package/src/hook.js +151 -151
- package/src/injection-decode.js +136 -0
- package/src/install.js +298 -280
- package/src/integrity.js +16 -1
- package/src/integrity.json +43 -13
- package/src/interceptor.js +12 -9
- package/src/llm-proxy.js +986 -0
- package/src/mcp-audit.js +61 -5
- package/src/mcp-firewall.js +971 -0
- package/src/mcp-server.js +2500 -2047
- package/src/obfuscation.js +315 -0
- package/src/owasp-agentic.js +314 -0
- package/src/pentest.js +589 -0
- package/src/pii.js +4 -0
- package/src/platform/aisvs.js +38 -0
- package/src/platform/approval.js +187 -0
- package/src/platform/canonical.js +73 -0
- package/src/platform/contracts.js +158 -0
- package/src/platform/delegation.js +73 -0
- package/src/platform/http-gateway.js +177 -0
- package/src/platform/identity.js +253 -0
- package/src/platform/jwt.js +86 -0
- package/src/platform/mcp-http-bridge.js +199 -0
- package/src/platform/memory-guard.js +64 -0
- package/src/platform/os-sandbox.js +144 -0
- package/src/platform/policy.js +332 -0
- package/src/platform/sandbox-manager.js +92 -0
- package/src/platform/signed-audit.js +357 -0
- package/src/platform/ssrf.js +129 -0
- package/src/plugin.js +182 -168
- package/src/pre-deploy.js +170 -55
- package/src/privacy-audit.js +272 -272
- package/src/repl.js +150 -150
- package/src/report.js +7 -1
- package/src/routes.js +1210 -0
- package/src/rules-2026.js +1407 -0
- package/src/rules-pack.js +3068 -3019
- package/src/rules.js +376 -60
- package/src/sandbox.js +200 -10
- package/src/sbom.js +193 -164
- package/src/scanner.js +189 -33
- package/src/shell-guard.js +11 -0
- package/src/skill-scan.js +477 -0
- package/src/slopsquat.js +144 -144
- package/src/surface.js +408 -0
- package/src/taint-ast.js +204 -37
- package/src/taint.js +15 -3
- package/src/tokenlean.js +579 -0
- package/src/trace.js +220 -220
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* One-command installer: `vibeguard install`.
|
|
5
|
+
*
|
|
6
|
+
* Detects which AI coding clients are present and wires the VibeGuard MCP server
|
|
7
|
+
* into each. It only WRITES config for clients whose config format/location is
|
|
8
|
+
* known and stable; for anything else it prints a ready-to-paste block so you can
|
|
9
|
+
* add it by hand (we don't write to guessed paths).
|
|
10
|
+
*
|
|
11
|
+
* Default server command is `npx -y @yagyeshvyas/vibeguard mcp` (works once published).
|
|
12
|
+
* Use --local to point at this checkout's absolute mcp-server.js for dev.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
const fs = require('fs');
|
|
16
|
+
const os = require('os');
|
|
17
|
+
const path = require('path');
|
|
18
|
+
|
|
19
|
+
const HOME = os.homedir();
|
|
20
|
+
|
|
21
|
+
function serverSpec(local) {
|
|
22
|
+
if (local) {
|
|
23
|
+
return { command: process.execPath, args: [path.resolve(__dirname, 'mcp-server.js')] };
|
|
24
|
+
}
|
|
25
|
+
// `npx -y @yagyeshvyas/vibeguard mcp` — resolves the published `vibeguard` package and runs
|
|
26
|
+
// its `mcp` subcommand. (npx -y @yagyeshvyas/vibeguard-mcp would look for a package by that
|
|
27
|
+
// name, which doesn't exist — the mcp bin lives inside the vibeguard package.)
|
|
28
|
+
return { command: 'npx', args: ['-y', 'vibeguard', 'mcp'] };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function exists(p) {
|
|
32
|
+
try {
|
|
33
|
+
return fs.existsSync(p);
|
|
34
|
+
} catch {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function backup(file) {
|
|
40
|
+
try {
|
|
41
|
+
if (exists(file)) fs.copyFileSync(file, file + '.vibeguard-bak');
|
|
42
|
+
} catch {
|
|
43
|
+
/* best effort */
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function readJson(file) {
|
|
48
|
+
try {
|
|
49
|
+
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
50
|
+
} catch {
|
|
51
|
+
return {};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function ensureDir(file) {
|
|
56
|
+
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Merge a server entry into a JSON config using the given top-level key
|
|
60
|
+
// ("mcpServers" for most, "servers" for VS Code).
|
|
61
|
+
function writeJsonMcp(file, key, spec, name) {
|
|
62
|
+
ensureDir(file);
|
|
63
|
+
backup(file);
|
|
64
|
+
const cfg = readJson(file);
|
|
65
|
+
if (!cfg[key] || typeof cfg[key] !== 'object') cfg[key] = {};
|
|
66
|
+
cfg[key][name] = { command: spec.command, args: spec.args };
|
|
67
|
+
fs.writeFileSync(file, JSON.stringify(cfg, null, 2) + '\n');
|
|
68
|
+
return file;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// -------- Per-client handlers ----------------------------------------------
|
|
72
|
+
// Each returns { client, status: 'installed'|'skipped'|'manual'|'error', detail }.
|
|
73
|
+
|
|
74
|
+
function installClaudeCode(spec) {
|
|
75
|
+
// Write the project-scoped .mcp.json (Claude Code's documented config file) in
|
|
76
|
+
// the current directory. No shelling out, no global side effects — this repo
|
|
77
|
+
// gets the server, and we also print the global `claude mcp add` command.
|
|
78
|
+
const file = path.join(process.cwd(), '.mcp.json');
|
|
79
|
+
writeJsonMcp(file, 'mcpServers', spec, 'vibeguard');
|
|
80
|
+
return {
|
|
81
|
+
client: 'Claude Code',
|
|
82
|
+
status: 'installed',
|
|
83
|
+
detail: `${file} (project). Global: claude mcp add -s user vibeguard -- ${[spec.command, ...spec.args].join(' ')}`,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function installCursor(spec) {
|
|
88
|
+
const dir = path.join(HOME, '.cursor');
|
|
89
|
+
if (!exists(dir)) return { client: 'Cursor', status: 'skipped', detail: 'not detected (~/.cursor missing)' };
|
|
90
|
+
const file = path.join(dir, 'mcp.json');
|
|
91
|
+
writeJsonMcp(file, 'mcpServers', spec, 'vibeguard');
|
|
92
|
+
return { client: 'Cursor', status: 'installed', detail: file };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function installWindsurf(spec) {
|
|
96
|
+
const dir = path.join(HOME, '.codeium', 'windsurf');
|
|
97
|
+
if (!exists(path.join(HOME, '.codeium')))
|
|
98
|
+
return { client: 'Windsurf', status: 'skipped', detail: 'not detected (~/.codeium missing)' };
|
|
99
|
+
const file = path.join(dir, 'mcp_config.json');
|
|
100
|
+
writeJsonMcp(file, 'mcpServers', spec, 'vibeguard');
|
|
101
|
+
return { client: 'Windsurf', status: 'installed', detail: file };
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function installCodex(spec) {
|
|
105
|
+
const dir = path.join(HOME, '.codex');
|
|
106
|
+
if (!exists(dir)) return { client: 'Codex CLI', status: 'skipped', detail: 'not detected (~/.codex missing)' };
|
|
107
|
+
const file = path.join(dir, 'config.toml');
|
|
108
|
+
let content = '';
|
|
109
|
+
try {
|
|
110
|
+
content = fs.readFileSync(file, 'utf8');
|
|
111
|
+
} catch {
|
|
112
|
+
content = '';
|
|
113
|
+
}
|
|
114
|
+
if (/\[mcp_servers\.vibeguard\]/.test(content)) {
|
|
115
|
+
return { client: 'Codex CLI', status: 'installed', detail: 'already present in ' + file };
|
|
116
|
+
}
|
|
117
|
+
backup(file);
|
|
118
|
+
const argsToml = spec.args.map((a) => JSON.stringify(a)).join(', ');
|
|
119
|
+
const block =
|
|
120
|
+
`\n[mcp_servers.vibeguard]\n` +
|
|
121
|
+
`command = ${JSON.stringify(spec.command)}\n` +
|
|
122
|
+
`args = [${argsToml}]\n`;
|
|
123
|
+
ensureDir(file);
|
|
124
|
+
fs.writeFileSync(file, (content && !content.endsWith('\n') ? content + '\n' : content) + block);
|
|
125
|
+
return { client: 'Codex CLI', status: 'installed', detail: file };
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function installVSCode(spec) {
|
|
129
|
+
// VS Code (Copilot agent) reads workspace .vscode/mcp.json with a "servers" key.
|
|
130
|
+
const file = path.join(process.cwd(), '.vscode', 'mcp.json');
|
|
131
|
+
// Only write if a .vscode folder exists here (i.e. this is a VS Code project).
|
|
132
|
+
if (!exists(path.join(process.cwd(), '.vscode'))) {
|
|
133
|
+
return { client: 'VS Code', status: 'skipped', detail: 'no ./.vscode in this project' };
|
|
134
|
+
}
|
|
135
|
+
writeJsonMcp(file, 'servers', spec, 'vibeguard');
|
|
136
|
+
return { client: 'VS Code', status: 'installed', detail: file };
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
function installAntigravity(spec) {
|
|
140
|
+
// Google Antigravity uses ~/.antigravity/config.json with mcpServers key
|
|
141
|
+
const dir = path.join(HOME, '.antigravity');
|
|
142
|
+
if (!exists(dir)) return { client: 'Antigravity', status: 'skipped', detail: 'not detected (~/.antigravity missing)' };
|
|
143
|
+
const file = path.join(dir, 'config.json');
|
|
144
|
+
writeJsonMcp(file, 'mcpServers', spec, 'vibeguard');
|
|
145
|
+
return { client: 'Antigravity', status: 'installed', detail: file };
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function installContinue(spec) {
|
|
149
|
+
// Continue.dev uses ~/.continue/config.json with mcpServers key
|
|
150
|
+
const dir = path.join(HOME, '.continue');
|
|
151
|
+
if (!exists(dir)) return { client: 'Continue', status: 'skipped', detail: 'not detected (~/.continue missing)' };
|
|
152
|
+
const file = path.join(dir, 'config.json');
|
|
153
|
+
writeJsonMcp(file, 'mcpServers', spec, 'vibeguard');
|
|
154
|
+
return { client: 'Continue', status: 'installed', detail: file };
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function installCline(spec) {
|
|
158
|
+
// Cline (VS Code extension) uses cline_mcp_settings.json in VS Code user dir
|
|
159
|
+
const dir = path.join(HOME, '.vscode', 'extensions');
|
|
160
|
+
if (!exists(path.join(HOME, '.vscode')) && !exists(path.join(HOME, 'AppData', 'Roaming', 'Code')))
|
|
161
|
+
return { client: 'Cline', status: 'skipped', detail: 'not detected (VS Code not found)' };
|
|
162
|
+
// Cline stores MCP config in the VS Code userData directory
|
|
163
|
+
const userDataDir = process.platform === 'win32'
|
|
164
|
+
? path.join(HOME, 'AppData', 'Roaming', 'Code', 'User')
|
|
165
|
+
: path.join(HOME, '.vscode', 'User');
|
|
166
|
+
if (!exists(userDataDir)) return { client: 'Cline', status: 'skipped', detail: 'VS Code User dir not found' };
|
|
167
|
+
const file = path.join(userDataDir, 'globalStorage', 'saoudrizwan.claude-dev', 'settings', 'cline_mcp_settings.json');
|
|
168
|
+
writeJsonMcp(file, 'mcpServers', spec, 'vibeguard');
|
|
169
|
+
return { client: 'Cline', status: 'installed', detail: file };
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
function installAider(spec) {
|
|
173
|
+
// Aider uses ~/.aider.conf.yml — MCP via command launch
|
|
174
|
+
const file = path.join(HOME, '.aider.conf.yml');
|
|
175
|
+
if (!exists(file)) return { client: 'Aider', status: 'manual', detail: 'add --mcp to your aider launch or ~/.aider.conf.yml' };
|
|
176
|
+
let content = '';
|
|
177
|
+
try { content = fs.readFileSync(file, 'utf8'); } catch {}
|
|
178
|
+
if (/vibeguard/.test(content)) return { client: 'Aider', status: 'installed', detail: 'already present' };
|
|
179
|
+
backup(file);
|
|
180
|
+
const block = `\n# VibeGuard MCP server\nmcp-command: ${spec.command}\nmcp-args: ${spec.args.join(' ')}\n`;
|
|
181
|
+
fs.writeFileSync(file, content + block);
|
|
182
|
+
return { client: 'Aider', status: 'installed', detail: file };
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function installGeminiCLI(spec) {
|
|
186
|
+
// Google Gemini CLI uses ~/.gemini/config.json with mcpServers key
|
|
187
|
+
const dir = path.join(HOME, '.gemini');
|
|
188
|
+
if (!exists(dir)) return { client: 'Gemini CLI', status: 'skipped', detail: 'not detected (~/.gemini missing)' };
|
|
189
|
+
const file = path.join(dir, 'config.json');
|
|
190
|
+
writeJsonMcp(file, 'mcpServers', spec, 'vibeguard');
|
|
191
|
+
return { client: 'Gemini CLI', status: 'installed', detail: file };
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
function installRooCode(spec) {
|
|
195
|
+
// Roo Code (VS Code extension) uses roo_cline_mcp_settings.json
|
|
196
|
+
const userDataDir = process.platform === 'win32'
|
|
197
|
+
? path.join(HOME, 'AppData', 'Roaming', 'Code', 'User')
|
|
198
|
+
: path.join(HOME, '.vscode', 'User');
|
|
199
|
+
if (!exists(userDataDir)) return { client: 'Roo Code', status: 'skipped', detail: 'VS Code User dir not found' };
|
|
200
|
+
const file = path.join(userDataDir, 'globalStorage', 'rooveterinaryinc.roo-cline', 'settings', 'roo_cline_mcp_settings.json');
|
|
201
|
+
writeJsonMcp(file, 'mcpServers', spec, 'vibeguard');
|
|
202
|
+
return { client: 'Roo Code', status: 'installed', detail: file };
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function installOpenHands(spec) {
|
|
206
|
+
// OpenHands uses ~/.openhands/config.toml similar to Codex
|
|
207
|
+
const dir = path.join(HOME, '.openhands');
|
|
208
|
+
if (!exists(dir)) return { client: 'OpenHands', status: 'skipped', detail: 'not detected (~/.openhands missing)' };
|
|
209
|
+
const file = path.join(dir, 'config.toml');
|
|
210
|
+
let content = '';
|
|
211
|
+
try { content = fs.readFileSync(file, 'utf8'); } catch {}
|
|
212
|
+
if (/\[mcp_servers\.vibeguard\]/.test(content)) return { client: 'OpenHands', status: 'installed', detail: 'already present' };
|
|
213
|
+
backup(file);
|
|
214
|
+
const argsToml = spec.args.map((a) => JSON.stringify(a)).join(', ');
|
|
215
|
+
const block = `\n[mcp_servers.vibeguard]\ncommand = ${JSON.stringify(spec.command)}\nargs = [${argsToml}]\n`;
|
|
216
|
+
ensureDir(file);
|
|
217
|
+
fs.writeFileSync(file, (content && !content.endsWith('\n') ? content + '\n' : content) + block);
|
|
218
|
+
return { client: 'OpenHands', status: 'installed', detail: file };
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function installCopilotCLI(spec) {
|
|
222
|
+
// GitHub Copilot CLI uses ~/.copilot/config.json with mcpServers key
|
|
223
|
+
const dir = path.join(HOME, '.copilot');
|
|
224
|
+
if (!exists(dir)) return { client: 'Copilot CLI', status: 'skipped', detail: 'not detected (~/.copilot missing)' };
|
|
225
|
+
const file = path.join(dir, 'config.json');
|
|
226
|
+
writeJsonMcp(file, 'mcpServers', spec, 'vibeguard');
|
|
227
|
+
return { client: 'Copilot CLI', status: 'installed', detail: file };
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
function installAmazonQ(spec) {
|
|
231
|
+
// Amazon Q Developer CLI uses ~/.aws/amazonq/config.json
|
|
232
|
+
const dir = path.join(HOME, '.aws', 'amazonq');
|
|
233
|
+
if (!exists(dir)) return { client: 'Amazon Q', status: 'skipped', detail: 'not detected (~/.aws/amazonq missing)' };
|
|
234
|
+
const file = path.join(dir, 'config.json');
|
|
235
|
+
writeJsonMcp(file, 'mcpServers', spec, 'vibeguard');
|
|
236
|
+
return { client: 'Amazon Q', status: 'installed', detail: file };
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
function installCody(spec) {
|
|
240
|
+
// Sourcegraph Cody uses ~/.config/cody/config.json
|
|
241
|
+
const dir = process.platform === 'win32'
|
|
242
|
+
? path.join(HOME, 'AppData', 'Roaming', 'Sourcegraph', 'Cody')
|
|
243
|
+
: path.join(HOME, '.config', 'cody');
|
|
244
|
+
if (!exists(dir)) return { client: 'Sourcegraph Cody', status: 'skipped', detail: 'not detected (cody config dir missing)' };
|
|
245
|
+
const file = path.join(dir, 'config.json');
|
|
246
|
+
writeJsonMcp(file, 'mcpServers', spec, 'vibeguard');
|
|
247
|
+
return { client: 'Sourcegraph Cody', status: 'installed', detail: file };
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function installHermes(spec) {
|
|
251
|
+
// Hermes Agent (Nous Research) reads MCP servers from $HERMES_HOME/config.yaml
|
|
252
|
+
// (default ~/.hermes/config.yaml) under `mcp_servers:`. We never hand-edit the
|
|
253
|
+
// YAML (a bad write can break the live gateway); we detect it and emit the
|
|
254
|
+
// exact, safe commands using Hermes' own config CLI instead.
|
|
255
|
+
const hermesHome = process.env.HERMES_HOME || path.join(HOME, '.hermes');
|
|
256
|
+
const cfg = path.join(hermesHome, 'config.yaml');
|
|
257
|
+
if (!exists(cfg)) {
|
|
258
|
+
return { client: 'Hermes Agent', status: 'skipped', detail: `not detected (${cfg} missing)` };
|
|
259
|
+
}
|
|
260
|
+
const argsStr = spec.args.map((a) => JSON.stringify(a)).join(', ');
|
|
261
|
+
return {
|
|
262
|
+
client: 'Hermes Agent',
|
|
263
|
+
status: 'instructions',
|
|
264
|
+
detail: `${cfg} — add under \`mcp_servers:\`, or run:\n hermes config set mcp_servers.vibeguard.command ${spec.command}\n hermes config set mcp_servers.vibeguard.args '[${argsStr}]'\n hermes config set mcp_servers.vibeguard.timeout 120`,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
function pasteBlock(spec) {
|
|
269
|
+
return JSON.stringify(
|
|
270
|
+
{ mcpServers: { vibeguard: { command: spec.command, args: spec.args } } },
|
|
271
|
+
null,
|
|
272
|
+
2
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function install(opts = {}) {
|
|
277
|
+
const spec = serverSpec(opts.local);
|
|
278
|
+
const results = [
|
|
279
|
+
installClaudeCode(spec),
|
|
280
|
+
installCursor(spec),
|
|
281
|
+
installWindsurf(spec),
|
|
282
|
+
installCodex(spec),
|
|
283
|
+
installAntigravity(spec),
|
|
284
|
+
installContinue(spec),
|
|
285
|
+
installCline(spec),
|
|
286
|
+
installAider(spec),
|
|
287
|
+
installGeminiCLI(spec),
|
|
288
|
+
installRooCode(spec),
|
|
289
|
+
installOpenHands(spec),
|
|
290
|
+
installVSCode(spec),
|
|
291
|
+
installCopilotCLI(spec),
|
|
292
|
+
installAmazonQ(spec),
|
|
293
|
+
installCody(spec),
|
|
294
|
+
installHermes(spec),
|
|
295
|
+
];
|
|
296
|
+
return { spec, results, paste: pasteBlock(spec) };
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
module.exports = { install, serverSpec, pasteBlock, writeJsonMcp };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"stamp": "2026-08-05T16-23-50-635Z",
|
|
3
|
+
"files": [
|
|
4
|
+
{
|
|
5
|
+
"file": "rules.js",
|
|
6
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/rules.js"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"file": "mcp-server.js",
|
|
10
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/mcp-server.js"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"file": "auto.js",
|
|
14
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/auto.js"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"file": "daemon.js",
|
|
18
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/daemon.js"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"file": "dashboard.js",
|
|
22
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/dashboard.js"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"file": "engine.js",
|
|
26
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/engine.js"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"file": "hook.js",
|
|
30
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/hook.js"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"file": "install.js",
|
|
34
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/install.js"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"file": "plugin.js",
|
|
38
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/plugin.js"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"file": "pre-deploy.js",
|
|
42
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/pre-deploy.js"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"file": "repl.js",
|
|
46
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/repl.js"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"file": "sbom.js",
|
|
50
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/sbom.js"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"file": "shell-guard.js",
|
|
54
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/shell-guard.js"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"file": "slopsquat.js",
|
|
58
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/slopsquat.js"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"file": "trace.js",
|
|
62
|
+
"backup": ".vibeguard/snapshots/2026-08-05T16-23-50-635Z/trace.js"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
}
|