@sechroom/cli 2026.6.16 → 2026.6.17
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/dist/index.js +22 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2389,36 +2389,40 @@ Next \u2014 verify: ${verify.description}
|
|
|
2389
2389
|
}
|
|
2390
2390
|
function registerSetup(program2) {
|
|
2391
2391
|
const setup = program2.command("setup").description("Granular onboarding steps (init runs these together)");
|
|
2392
|
-
setup.command("mcp <
|
|
2393
|
-
await
|
|
2392
|
+
setup.command("mcp <clients...>").description(`Write only the MCP config for one or more clients (${ALL_CLIENT_KEYS.join(", ")}, or 'all')`).option("--dry-run", "print what would be written without writing", false).addHelpText("after", "\nExamples:\n $ sechroom setup mcp codex\n $ sechroom setup mcp claude-code codex\n $ sechroom setup mcp all").action(async (clients, opts, cmd) => {
|
|
2393
|
+
await runClients(clients, cmd, { dryRun: Boolean(opts.dryRun), mcp: true, agentFiles: false });
|
|
2394
2394
|
});
|
|
2395
|
-
setup.command("agent-files <
|
|
2396
|
-
await
|
|
2395
|
+
setup.command("agent-files <clients...>").description(`Write only the agent instruction file(s) for one or more clients (${ALL_CLIENT_KEYS.join(", ")}, or 'all')`).option("--dry-run", "print what would be written without writing", false).option("--copy", "make a personal copy you can edit (default: prompt on a TTY, else skip)").addHelpText("after", "\nExamples:\n $ sechroom setup agent-files claude-code CLAUDE.md\n $ sechroom setup agent-files claude-code codex CLAUDE.md + AGENTS.md in one run\n $ sechroom setup agent-files all").action(async (clients, opts, cmd) => {
|
|
2396
|
+
await runClients(clients, cmd, { dryRun: Boolean(opts.dryRun), mcp: false, agentFiles: true, copy: opts.copy });
|
|
2397
2397
|
});
|
|
2398
2398
|
}
|
|
2399
|
-
async function
|
|
2399
|
+
async function runClients(clients, cmd, opts) {
|
|
2400
2400
|
const cfg = resolveConfig(cmd.optsWithGlobals());
|
|
2401
2401
|
const targets = clientTargets(process.cwd());
|
|
2402
|
-
const
|
|
2403
|
-
if (!target) fail(`unknown client '${client}'. Known: ${ALL_CLIENT_KEYS.join(", ")}.`);
|
|
2402
|
+
const keys = resolveClientKeys(clients.join(","));
|
|
2404
2403
|
const setupData = await withSpinner("Fetching setup descriptors", () => fetchSetup(cfg));
|
|
2405
2404
|
const personalWorkspaceId = await getPersonalWorkspaceId(cfg);
|
|
2406
2405
|
if (opts.agentFiles && !opts.dryRun) {
|
|
2407
|
-
await maybeOfferCopies(cfg, setupData, targets,
|
|
2406
|
+
await maybeOfferCopies(cfg, setupData, targets, keys, personalWorkspaceId, copyChoice(opts));
|
|
2408
2407
|
}
|
|
2409
|
-
const actions = await applyClient(cfg, setupData, target, {
|
|
2410
|
-
dryRun: opts.dryRun,
|
|
2411
|
-
mcp: opts.mcp,
|
|
2412
|
-
agentFiles: opts.agentFiles,
|
|
2413
|
-
personalWorkspaceId
|
|
2414
|
-
});
|
|
2415
2408
|
const json = cmd.optsWithGlobals().json;
|
|
2409
|
+
const result = [];
|
|
2410
|
+
for (const key of keys) {
|
|
2411
|
+
const target = targets[key];
|
|
2412
|
+
const actions = await applyClient(cfg, setupData, target, {
|
|
2413
|
+
dryRun: opts.dryRun,
|
|
2414
|
+
mcp: opts.mcp,
|
|
2415
|
+
agentFiles: opts.agentFiles,
|
|
2416
|
+
personalWorkspaceId
|
|
2417
|
+
});
|
|
2418
|
+
result.push({ client: key, actions });
|
|
2419
|
+
if (!json) printActions(target, actions);
|
|
2420
|
+
}
|
|
2416
2421
|
if (json) {
|
|
2417
|
-
emit({ dryRun: opts.dryRun,
|
|
2418
|
-
|
|
2419
|
-
printActions(target, actions);
|
|
2420
|
-
process.stdout.write(opts.dryRun ? "\n(dry run \u2014 nothing written)\n" : "\nDone.\n");
|
|
2422
|
+
emit({ dryRun: opts.dryRun, clients: result }, true);
|
|
2423
|
+
return;
|
|
2421
2424
|
}
|
|
2425
|
+
process.stdout.write(opts.dryRun ? "\n(dry run \u2014 nothing written)\n" : "\nDone.\n");
|
|
2422
2426
|
}
|
|
2423
2427
|
|
|
2424
2428
|
// src/commands/onboard.ts
|
package/package.json
CHANGED