@ironbee-ai/cli 0.7.3 → 0.8.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.
Files changed (59) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +62 -3
  3. package/dist/clients/claude/index.d.ts +10 -0
  4. package/dist/clients/claude/index.d.ts.map +1 -1
  5. package/dist/clients/claude/index.js +102 -22
  6. package/dist/clients/claude/index.js.map +1 -1
  7. package/dist/clients/cursor/index.d.ts +8 -0
  8. package/dist/clients/cursor/index.d.ts.map +1 -1
  9. package/dist/clients/cursor/index.js +67 -9
  10. package/dist/clients/cursor/index.js.map +1 -1
  11. package/dist/clients/registry.d.ts +35 -6
  12. package/dist/clients/registry.d.ts.map +1 -1
  13. package/dist/clients/registry.js +73 -6
  14. package/dist/clients/registry.js.map +1 -1
  15. package/dist/commands/config.d.ts +79 -0
  16. package/dist/commands/config.d.ts.map +1 -0
  17. package/dist/commands/config.js +558 -0
  18. package/dist/commands/config.js.map +1 -0
  19. package/dist/commands/install.d.ts +14 -0
  20. package/dist/commands/install.d.ts.map +1 -1
  21. package/dist/commands/install.js +122 -16
  22. package/dist/commands/install.js.map +1 -1
  23. package/dist/commands/register.d.ts +24 -0
  24. package/dist/commands/register.d.ts.map +1 -0
  25. package/dist/commands/register.js +67 -0
  26. package/dist/commands/register.js.map +1 -0
  27. package/dist/commands/uninstall.d.ts +18 -0
  28. package/dist/commands/uninstall.d.ts.map +1 -1
  29. package/dist/commands/uninstall.js +160 -16
  30. package/dist/commands/uninstall.js.map +1 -1
  31. package/dist/commands/unregister.d.ts +23 -0
  32. package/dist/commands/unregister.d.ts.map +1 -0
  33. package/dist/commands/unregister.js +67 -0
  34. package/dist/commands/unregister.js.map +1 -0
  35. package/dist/import/claude/discovery.js +4 -4
  36. package/dist/import/claude/discovery.js.map +1 -1
  37. package/dist/import/claude/encoding.d.ts.map +1 -1
  38. package/dist/import/claude/encoding.js +102 -21
  39. package/dist/import/claude/encoding.js.map +1 -1
  40. package/dist/index.js +10 -1
  41. package/dist/index.js.map +1 -1
  42. package/dist/lib/config.d.ts.map +1 -1
  43. package/dist/lib/config.js +6 -1
  44. package/dist/lib/config.js.map +1 -1
  45. package/dist/lib/projects-registry.d.ts +102 -0
  46. package/dist/lib/projects-registry.d.ts.map +1 -0
  47. package/dist/lib/projects-registry.js +282 -0
  48. package/dist/lib/projects-registry.js.map +1 -0
  49. package/dist/lib/prompt.d.ts +40 -0
  50. package/dist/lib/prompt.d.ts.map +1 -0
  51. package/dist/lib/prompt.js +101 -0
  52. package/dist/lib/prompt.js.map +1 -0
  53. package/dist/lib/telemetry.d.ts +8 -0
  54. package/dist/lib/telemetry.d.ts.map +1 -1
  55. package/dist/lib/telemetry.js +44 -0
  56. package/dist/lib/telemetry.js.map +1 -1
  57. package/package.json +7 -5
  58. package/scripts/run-postinstall.js +35 -0
  59. package/scripts/run-preuninstall.js +19 -0
@@ -0,0 +1,558 @@
1
+ "use strict";
2
+ /**
3
+ * `ironbee config` — generic config reader / writer for project & global
4
+ * `<root>/.ironbee/config.json` files.
5
+ *
6
+ * Subcommands:
7
+ * - `config get <key>` — print the value at a dotted path. Default reads
8
+ * the merged effective value (global + project);
9
+ * `--global` / `--project` narrow to one source.
10
+ * - `config set <key> <value>` — write a value. Smart re-render: when the
11
+ * top-level key affects installed client artifacts
12
+ * (hooks, MCP servers, skill/rule md, permissions),
13
+ * the command runs `client.install(projectDir, mergedConfig)`
14
+ * BEFORE persisting the new config to disk so a
15
+ * failed artifact write leaves config in its old
16
+ * state (artifacts-before-config ordering, same as
17
+ * `applyVerificationToggle`).
18
+ * - `config unset <key>` — remove a key. Same rerender rules as `set`.
19
+ * - `config list` — print the whole config (merged / global / project).
20
+ * - `config path` — print the on-disk path of the targeted config file.
21
+ *
22
+ * Type coercion for `set`: tries `JSON.parse(value)` first (so `true`,
23
+ * `false`, `42`, `null`, `[…]`, `{…}` come through as their JSON types).
24
+ * Falls back to the raw string when JSON parse fails, which lets URLs,
25
+ * filesystem paths, and other non-JSON inputs pass through verbatim
26
+ * without quoting (`config set collector.url https://…`). `--json` forces
27
+ * strict JSON parsing — useful when the input would otherwise be
28
+ * misinterpreted (e.g. a string that happens to look like a number).
29
+ *
30
+ * Artifact-affecting top-level keys (the `ARTIFACT_AFFECTING_TOP_KEYS`
31
+ * registry below) are: `verification`, `collector`, `browser`, `backend`,
32
+ * `browserDevTools`, `nodeDevTools`. Changing anything else (e.g.
33
+ * `maxRetries`, `import.concurrency`, `recording`, `jobQueue`, `analytics`)
34
+ * is a pure config flip — runtime hooks read it on next session, no
35
+ * artifact regeneration needed.
36
+ */
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.configCommand = void 0;
39
+ exports.runSet = runSet;
40
+ exports.runUnset = runUnset;
41
+ exports.runGet = runGet;
42
+ exports.runList = runList;
43
+ exports.runPath = runPath;
44
+ const commander_1 = require("commander");
45
+ const fs_1 = require("fs");
46
+ const os_1 = require("os");
47
+ const path_1 = require("path");
48
+ const registry_1 = require("../clients/registry");
49
+ const install_1 = require("./install");
50
+ const config_1 = require("../lib/config");
51
+ const gitignore_1 = require("../lib/gitignore");
52
+ const logger_1 = require("../lib/logger");
53
+ const output_1 = require("../lib/output");
54
+ const prompt_1 = require("../lib/prompt");
55
+ const projects_registry_1 = require("../lib/projects-registry");
56
+ /**
57
+ * Top-level config keys whose change requires re-rendering installed
58
+ * client artifacts (hooks, MCP servers, skill/rule md, permissions).
59
+ *
60
+ * - `verification` → enable/disable mode flips the entire hook set,
61
+ * skill/rule presence, MCP entries, and permission scope.
62
+ * - `collector` → MCP env auto-OTEL injection depends on collector
63
+ * presence + url + apiKey; flipping these mutates `.mcp.json`'s env.
64
+ * - `browser` / `backend` → patterns flow into runtime gating, but
65
+ * fragments / runtime markers in skill/rule/command md are also
66
+ * toggled by enable-backend so changing patterns is a good time to
67
+ * re-render (sync runtime sections to current state).
68
+ * - `browserDevTools` / `nodeDevTools` → MCP env override; mutates
69
+ * `.mcp.json`.
70
+ *
71
+ * Other top-level keys (`maxRetries`, `import.concurrency`, `recording`,
72
+ * `jobQueue`, `analytics`, `ignoredVerifyPatterns`) only affect runtime
73
+ * behavior — no need to touch installed artifacts.
74
+ */
75
+ const ARTIFACT_AFFECTING_TOP_KEYS = new Set([
76
+ "verification",
77
+ "collector",
78
+ "browser",
79
+ "backend",
80
+ "browserDevTools",
81
+ "nodeDevTools",
82
+ ]);
83
+ function projectConfigPath(projectDir) {
84
+ return (0, path_1.join)((0, path_1.resolve)(projectDir), ".ironbee", "config.json");
85
+ }
86
+ function globalConfigPath() {
87
+ return (0, path_1.join)((0, os_1.homedir)(), ".ironbee", "config.json");
88
+ }
89
+ function readConfigFile(path) {
90
+ if (!(0, fs_1.existsSync)(path)) {
91
+ return {};
92
+ }
93
+ try {
94
+ const raw = (0, fs_1.readFileSync)(path, "utf-8");
95
+ if (raw.trim().length === 0) {
96
+ return {};
97
+ }
98
+ return JSON.parse(raw);
99
+ }
100
+ catch (e) {
101
+ logger_1.logger.debug(`failed to read ${path}: ${e}`);
102
+ throw new Error(`Config at ${path} is not valid JSON: ${e instanceof Error ? e.message : e}`);
103
+ }
104
+ }
105
+ function writeConfigFile(path, config) {
106
+ (0, fs_1.mkdirSync)((0, path_1.join)(path, ".."), { recursive: true });
107
+ (0, fs_1.writeFileSync)(path, JSON.stringify(config, null, 2) + "\n");
108
+ }
109
+ /** Top-level segment of a dotted path — used for the artifact registry. */
110
+ function topKey(dotPath) {
111
+ const idx = dotPath.indexOf(".");
112
+ return idx === -1 ? dotPath : dotPath.slice(0, idx);
113
+ }
114
+ function affectsArtifacts(dotPath) {
115
+ return ARTIFACT_AFFECTING_TOP_KEYS.has(topKey(dotPath));
116
+ }
117
+ /** Walk a dotted path; returns `undefined` when any segment is missing. */
118
+ function getAtPath(obj, dotPath) {
119
+ if (dotPath.length === 0) {
120
+ return obj;
121
+ }
122
+ const parts = dotPath.split(".");
123
+ let cur = obj;
124
+ for (const part of parts) {
125
+ if (cur === null || cur === undefined || typeof cur !== "object" || Array.isArray(cur)) {
126
+ return undefined;
127
+ }
128
+ cur = cur[part];
129
+ }
130
+ return cur;
131
+ }
132
+ /**
133
+ * Walk a dotted path, creating intermediate objects as needed, and set the
134
+ * leaf to `value`. If an intermediate segment exists but isn't a plain
135
+ * object (array / primitive / null), it gets overwritten with `{}` —
136
+ * matches the user's intent ("I want this nested key to exist") at the
137
+ * cost of clobbering the prior shape, but loud-fails would be more
138
+ * annoying than helpful here (the user can `unset` and retry).
139
+ */
140
+ function setAtPath(obj, dotPath, value) {
141
+ if (dotPath.length === 0) {
142
+ throw new Error("Cannot set the root config — pass a dotted key (e.g. `collector.url`).");
143
+ }
144
+ const parts = dotPath.split(".");
145
+ let cur = obj;
146
+ for (let i = 0; i < parts.length - 1; i++) {
147
+ const k = parts[i];
148
+ const next = cur[k];
149
+ if (next === null || next === undefined || typeof next !== "object" || Array.isArray(next)) {
150
+ cur[k] = {};
151
+ }
152
+ cur = cur[k];
153
+ }
154
+ cur[parts[parts.length - 1]] = value;
155
+ }
156
+ /**
157
+ * Walk a dotted path and delete the leaf. Returns `true` when something
158
+ * was actually removed, `false` when the path didn't exist (idempotent).
159
+ * Does NOT clean up empty parent objects — keeping the user's structural
160
+ * intent intact (an empty `verification: {}` is meaningfully different
161
+ * from no `verification` key in some loaders).
162
+ */
163
+ function unsetAtPath(obj, dotPath) {
164
+ if (dotPath.length === 0) {
165
+ return false;
166
+ }
167
+ const parts = dotPath.split(".");
168
+ let cur = obj;
169
+ for (let i = 0; i < parts.length - 1; i++) {
170
+ const k = parts[i];
171
+ const next = cur[k];
172
+ if (next === null || next === undefined || typeof next !== "object" || Array.isArray(next)) {
173
+ return false;
174
+ }
175
+ cur = next;
176
+ }
177
+ const last = parts[parts.length - 1];
178
+ if (!Object.prototype.hasOwnProperty.call(cur, last)) {
179
+ return false;
180
+ }
181
+ delete cur[last];
182
+ return true;
183
+ }
184
+ /**
185
+ * Coerce a CLI string value into a typed JSON value.
186
+ *
187
+ * Heuristic mode (default): try `JSON.parse`, fall back to raw string. This
188
+ * lets booleans / numbers / arrays / objects come through as their JSON
189
+ * types, while URLs and arbitrary strings (which fail JSON.parse) pass
190
+ * through unchanged so the user doesn't need to wrap them in quotes.
191
+ *
192
+ * Strict mode (`--json`): require the input to parse as JSON; surface the
193
+ * parse error verbatim. Use when the value is ambiguous (e.g. the string
194
+ * `"42"` should stay a string, not become a number).
195
+ */
196
+ function parseValue(input, json) {
197
+ if (json) {
198
+ try {
199
+ return JSON.parse(input);
200
+ }
201
+ catch (e) {
202
+ throw new Error(`--json was set but value is not valid JSON: ${e instanceof Error ? e.message : e}`);
203
+ }
204
+ }
205
+ try {
206
+ return JSON.parse(input);
207
+ }
208
+ catch {
209
+ return input;
210
+ }
211
+ }
212
+ function resolveWriteTarget(opts) {
213
+ if (opts.global) {
214
+ return { path: globalConfigPath(), label: "global", useGlobal: true };
215
+ }
216
+ const projectDir = opts.projectDir ?? process.cwd();
217
+ return { path: projectConfigPath(projectDir), label: "project", useGlobal: false };
218
+ }
219
+ function resolveReadTarget(opts) {
220
+ if (opts.global && opts.project) {
221
+ throw new Error("Pass at most one of --global / --project.");
222
+ }
223
+ if (opts.global) {
224
+ return { label: "global", path: globalConfigPath() };
225
+ }
226
+ if (opts.project) {
227
+ const projectDir = opts.projectDir ?? process.cwd();
228
+ return { label: "project", path: projectConfigPath(projectDir) };
229
+ }
230
+ return { label: "merged", path: opts.projectDir ?? process.cwd() };
231
+ }
232
+ function readForGet(target) {
233
+ if (target.label === "merged") {
234
+ return (0, config_1.loadConfig)(target.path);
235
+ }
236
+ return readConfigFile(target.path);
237
+ }
238
+ function formatValue(value) {
239
+ if (value === undefined) {
240
+ return "(unset)";
241
+ }
242
+ if (typeof value === "string") {
243
+ return value;
244
+ }
245
+ return JSON.stringify(value, null, 2);
246
+ }
247
+ /**
248
+ * Re-render installed client artifacts so they reflect the current
249
+ * (already-written) merged config. Returns the names of clients that were
250
+ * touched, or `[]` when no rerender was performed (no clients detected and
251
+ * no explicit `--client` filter).
252
+ *
253
+ * Behaviour:
254
+ * - `clientName` explicit (`--client <name>` or `--client all`) → always
255
+ * run install, even if the client isn't detected in the project.
256
+ * Lets `config set` populate a fresh `.claude/` / `.cursor/` directory
257
+ * in scripted setups.
258
+ * - `clientName` undefined → only run install when at least one client
259
+ * is detected. Avoids dropping `.claude/settings.json` into a project
260
+ * the user never opted into. Logs and returns `[]` when nothing matches.
261
+ */
262
+ function rerenderArtifacts(projectDir, clientName) {
263
+ const detected = (0, registry_1.detectClients)(projectDir);
264
+ if (clientName === undefined && detected.length === 0) {
265
+ console.log(` ${output_1.pc.dim("·")} ${output_1.pc.dim("no clients detected in")} ${output_1.pc.dim(projectDir)} ${output_1.pc.dim("— skipping artifact rerender")}`);
266
+ return [];
267
+ }
268
+ const cfg = (0, config_1.loadConfig)(projectDir);
269
+ const clients = (0, registry_1.resolveTargetClients)(projectDir, clientName);
270
+ for (const client of clients) {
271
+ client.install(projectDir, cfg);
272
+ }
273
+ // `client.install` would have thrown above if `projectDir` were
274
+ // missing, so we know the path is valid here.
275
+ (0, gitignore_1.ensureIronBeeGitignored)(projectDir);
276
+ return clients.map((c) => c.name);
277
+ }
278
+ /**
279
+ * Persist `next` to `targetPath` and re-render client artifacts so the
280
+ * installed files reflect the new merged config. Uses write-then-install
281
+ * (not the artifacts-before-config order in `applyVerificationToggle`)
282
+ * because parts of `client.install` reload config from disk via
283
+ * `loadConfig` (specifically `getMcpServerEntry` / `getNodeDevToolsMcpEntry`,
284
+ * which compute auto-OTEL env from `collector.url` / `apiKey`). For
285
+ * generic `config set/unset` we don't know which keys flow through which
286
+ * path, so we always need the new value to be on-disk before install
287
+ * runs. On install failure we roll the config file back to its prior
288
+ * state — same end-state guarantee, different mechanism.
289
+ */
290
+ function writeAndRerender(targetPath, next, projectDir, clientName) {
291
+ const previousBytes = (0, fs_1.existsSync)(targetPath) ? (0, fs_1.readFileSync)(targetPath, "utf-8") : null;
292
+ writeConfigFile(targetPath, next);
293
+ try {
294
+ return rerenderArtifacts(projectDir, clientName);
295
+ }
296
+ catch (e) {
297
+ try {
298
+ if (previousBytes === null) {
299
+ if ((0, fs_1.existsSync)(targetPath)) {
300
+ (0, fs_1.unlinkSync)(targetPath);
301
+ }
302
+ }
303
+ else {
304
+ (0, fs_1.writeFileSync)(targetPath, previousBytes);
305
+ }
306
+ }
307
+ catch (rollbackErr) {
308
+ logger_1.logger.debug(`config rollback failed: ${rollbackErr}`);
309
+ }
310
+ throw e;
311
+ }
312
+ }
313
+ /**
314
+ * After a global config write, surface OTHER registered projects that
315
+ * are still on the prior artifact state, then offer to propagate the
316
+ * change there immediately.
317
+ *
318
+ * The current project (if registered) is filtered out — `writeAndRerender`
319
+ * already re-rendered it inline. The notice / prompt is only about
320
+ * projects this command did NOT touch.
321
+ *
322
+ * Decision flow (in order):
323
+ * 1. `applyAll === true` (CLI flag `--apply-all` or programmatic) →
324
+ * run `runInstallAll` without prompting.
325
+ * 2. `applyAll === false` (programmatic only) → print notice + skip.
326
+ * 3. TTY + no flag → list paths, prompt "Apply… [Y/n]", default Yes.
327
+ * 4. Non-TTY + no flag → print notice + `--apply-all` hint, skip.
328
+ *
329
+ * No-op when the registry is empty or only contains the current project.
330
+ */
331
+ const NOTICE_PATH_CAP = 10;
332
+ function listOtherProjects(currentProjectDir) {
333
+ const projects = (0, registry_1.listActiveProjects)();
334
+ const currentCanonical = (0, projects_registry_1.canonicalizePath)(currentProjectDir);
335
+ return projects.filter((p) => p.path !== currentCanonical);
336
+ }
337
+ function printOtherProjectsBanner(others) {
338
+ const noun = others.length === 1 ? "other project" : "other projects";
339
+ console.log(` ${output_1.pc.yellow("⚠")} ${output_1.pc.bold(String(others.length))} ${noun} registered in the inventory still on the prior state:`);
340
+ const displayed = others.slice(0, NOTICE_PATH_CAP);
341
+ for (const p of displayed) {
342
+ console.log(` ${output_1.pc.dim("·")} ${output_1.pc.dim(p.path)}`);
343
+ }
344
+ if (others.length > NOTICE_PATH_CAP) {
345
+ console.log(` ${output_1.pc.dim("…and")} ${output_1.pc.bold(String(others.length - NOTICE_PATH_CAP))} ${output_1.pc.dim("more")}`);
346
+ }
347
+ }
348
+ async function maybeApplyToOtherProjects(currentProjectDir, wantsRerender, applyAll) {
349
+ if (!wantsRerender) {
350
+ return;
351
+ }
352
+ const others = listOtherProjects(currentProjectDir);
353
+ if (others.length === 0) {
354
+ return;
355
+ }
356
+ printOtherProjectsBanner(others);
357
+ let shouldApply;
358
+ if (applyAll === true) {
359
+ shouldApply = true;
360
+ }
361
+ else if (applyAll === false) {
362
+ // Explicit opt-out (programmatic / `--no-apply-all` if we add it).
363
+ console.log(` ${output_1.pc.dim("Run")} ${output_1.pc.cyan("ironbee install --all")} ${output_1.pc.dim("later to apply, or")} ${output_1.pc.cyan("ironbee install")} ${output_1.pc.dim("in selected projects.")}`);
364
+ return;
365
+ }
366
+ else if ((0, prompt_1.isInteractive)()) {
367
+ const noun = others.length === 1 ? "this project" : `these ${others.length} projects`;
368
+ shouldApply = await (0, prompt_1.promptYesNo)(` Apply this change to ${noun} now?`, true);
369
+ }
370
+ else {
371
+ // Non-TTY (CI, piped). Don't hang on a prompt — print the hint and exit.
372
+ console.log(` ${output_1.pc.dim("Run")} ${output_1.pc.cyan("ironbee install --all")} ${output_1.pc.dim("to apply everywhere, or pass")} ${output_1.pc.cyan("--apply-all")} ${output_1.pc.dim("to skip this prompt.")}`);
373
+ return;
374
+ }
375
+ if (!shouldApply) {
376
+ console.log(` ${output_1.pc.dim("Skipped. Run")} ${output_1.pc.cyan("ironbee install --all")} ${output_1.pc.dim("later to apply.")}`);
377
+ return;
378
+ }
379
+ console.log();
380
+ await (0, install_1.runInstallAll)({});
381
+ }
382
+ async function runSet(key, rawValue, opts) {
383
+ if (key.length === 0) {
384
+ throw new Error("Key is required (dotted path, e.g. `collector.url`).");
385
+ }
386
+ const target = resolveWriteTarget(opts);
387
+ const value = parseValue(rawValue, opts.json === true);
388
+ const onDisk = readConfigFile(target.path);
389
+ const next = JSON.parse(JSON.stringify(onDisk));
390
+ setAtPath(next, key, value);
391
+ const projectDir = opts.projectDir ?? process.cwd();
392
+ const wantsRerender = opts.rerender !== false && affectsArtifacts(key);
393
+ let rerenderedClients = [];
394
+ if (wantsRerender) {
395
+ rerenderedClients = writeAndRerender(target.path, next, projectDir, opts.client);
396
+ }
397
+ else {
398
+ writeConfigFile(target.path, next);
399
+ }
400
+ console.log(`${output_1.pc.green("✓")} Set ${output_1.pc.cyan(key)} = ${output_1.pc.bold(formatValue(value))} in ${target.label} config (${output_1.pc.dim(target.path)}).`);
401
+ if (wantsRerender) {
402
+ if (rerenderedClients.length > 0) {
403
+ console.log(` ${output_1.pc.dim("Re-rendered artifacts for:")} ${output_1.pc.bold(rerenderedClients.join(", "))}`);
404
+ console.log(` ${output_1.pc.yellow("⚠")} Restart your editor / agent session for the change to take effect.`);
405
+ }
406
+ }
407
+ else if (opts.rerender === false && affectsArtifacts(key)) {
408
+ console.log(` ${output_1.pc.yellow("⚠")} --no-rerender set: artifacts may now be out of sync with config. Run ${output_1.pc.cyan("ironbee install")} to resync.`);
409
+ }
410
+ if (target.useGlobal) {
411
+ await maybeApplyToOtherProjects(projectDir, wantsRerender, opts.applyAll);
412
+ }
413
+ }
414
+ async function runUnset(key, opts) {
415
+ if (key.length === 0) {
416
+ throw new Error("Key is required (dotted path, e.g. `collector.url`).");
417
+ }
418
+ const target = resolveWriteTarget(opts);
419
+ const onDisk = readConfigFile(target.path);
420
+ const next = JSON.parse(JSON.stringify(onDisk));
421
+ const removed = unsetAtPath(next, key);
422
+ if (!removed) {
423
+ console.log(`${output_1.pc.dim("·")} ${output_1.pc.cyan(key)} not present in ${target.label} config (${output_1.pc.dim(target.path)}). No-op.`);
424
+ return;
425
+ }
426
+ const projectDir = opts.projectDir ?? process.cwd();
427
+ const wantsRerender = opts.rerender !== false && affectsArtifacts(key);
428
+ let rerenderedClients = [];
429
+ if (wantsRerender) {
430
+ rerenderedClients = writeAndRerender(target.path, next, projectDir, opts.client);
431
+ }
432
+ else {
433
+ writeConfigFile(target.path, next);
434
+ }
435
+ console.log(`${output_1.pc.green("✓")} Unset ${output_1.pc.cyan(key)} in ${target.label} config (${output_1.pc.dim(target.path)}).`);
436
+ if (wantsRerender && rerenderedClients.length > 0) {
437
+ console.log(` ${output_1.pc.dim("Re-rendered artifacts for:")} ${output_1.pc.bold(rerenderedClients.join(", "))}`);
438
+ console.log(` ${output_1.pc.yellow("⚠")} Restart your editor / agent session for the change to take effect.`);
439
+ }
440
+ if (target.useGlobal) {
441
+ await maybeApplyToOtherProjects(projectDir, wantsRerender, opts.applyAll);
442
+ }
443
+ }
444
+ function runGet(key, opts) {
445
+ const target = resolveReadTarget(opts);
446
+ const config = readForGet(target);
447
+ const value = getAtPath(config, key);
448
+ if (value === undefined) {
449
+ // Print nothing to stdout — make `ironbee config get` script-friendly
450
+ // (no value → empty output, exit 1). Diagnostic on stderr.
451
+ console.error(`${output_1.pc.dim("·")} ${output_1.pc.cyan(key)} ${output_1.pc.dim("not set in")} ${target.label} ${output_1.pc.dim("config")}`);
452
+ process.exit(1);
453
+ }
454
+ if (typeof value === "string") {
455
+ console.log(value);
456
+ }
457
+ else {
458
+ console.log(JSON.stringify(value, null, 2));
459
+ }
460
+ }
461
+ function runList(opts) {
462
+ const target = resolveReadTarget(opts);
463
+ const config = readForGet(target);
464
+ console.log(JSON.stringify(config, null, 2));
465
+ }
466
+ function runPath(opts) {
467
+ const target = resolveWriteTarget(opts);
468
+ console.log(target.path);
469
+ }
470
+ /**
471
+ * `ironbee config` parent command. Subcommands attached below; each one
472
+ * has its own `try/catch → process.exit(1)` so a single bad write doesn't
473
+ * surface as an unhandled rejection.
474
+ */
475
+ exports.configCommand = new commander_1.Command("config")
476
+ .description("Read or write IronBee configuration values (project or global). Smart re-render: artifact-affecting keys auto-update installed client files.");
477
+ exports.configCommand
478
+ .command("get <key>")
479
+ .description("Print the value at a dotted path. Default: merged effective value (global + project). --global / --project narrow to one source.")
480
+ .option("-p, --project-dir <dir>", "Project directory (default: cwd).")
481
+ .option("-g, --global", "Read from global config only (~/.ironbee/config.json).")
482
+ .option("--project", "Read from project config only (<project>/.ironbee/config.json).")
483
+ .action((key, opts) => {
484
+ try {
485
+ runGet(key, opts);
486
+ }
487
+ catch (e) {
488
+ console.error(`${output_1.pc.red("✗")} ${e instanceof Error ? e.message : e}`);
489
+ process.exit(1);
490
+ }
491
+ });
492
+ exports.configCommand
493
+ .command("set <key> <value>")
494
+ .description("Set a config value. Type-coerces (true/42/[…]/{…}) unless --json forces strict parsing. Re-renders client artifacts when the top-level key affects them. After a global write (`-g`) on an artifact-affecting key, prompts whether to apply the change to every other registered project.")
495
+ .option("-p, --project-dir <dir>", "Project directory (default: cwd).")
496
+ .option("-g, --global", "Write to global config (~/.ironbee/config.json).")
497
+ .option("--client <name>", `Filter clients for artifact rerender (${(0, registry_1.clientNames)()}), or "all". Default: detected clients.`)
498
+ .option("--no-rerender", "Skip artifact rerender even when the key normally triggers it.")
499
+ .option("--json", "Require value to parse as strict JSON (no string fallback).")
500
+ .option("--apply-all", "After a global write on an artifact-affecting key, apply the change to every registered project without prompting.")
501
+ .option("--no-apply-all", "After a global write on an artifact-affecting key, do NOT apply to other registered projects (suppress the prompt).")
502
+ .action(async (key, value, opts) => {
503
+ try {
504
+ await runSet(key, value, opts);
505
+ }
506
+ catch (e) {
507
+ console.error(`${output_1.pc.red("✗")} ${e instanceof Error ? e.message : e}`);
508
+ process.exit(1);
509
+ }
510
+ });
511
+ exports.configCommand
512
+ .command("unset <key>")
513
+ .description("Remove a config key. Idempotent — no-op when the key is absent. Re-renders client artifacts when the top-level key affects them. After a global unset (`-g`) on an artifact-affecting key, prompts whether to apply the change to every other registered project.")
514
+ .option("-p, --project-dir <dir>", "Project directory (default: cwd).")
515
+ .option("-g, --global", "Write to global config (~/.ironbee/config.json).")
516
+ .option("--client <name>", `Filter clients for artifact rerender (${(0, registry_1.clientNames)()}), or "all". Default: detected clients.`)
517
+ .option("--no-rerender", "Skip artifact rerender even when the key normally triggers it.")
518
+ .option("--apply-all", "After a global unset on an artifact-affecting key, apply the change to every registered project without prompting.")
519
+ .option("--no-apply-all", "After a global unset on an artifact-affecting key, do NOT apply to other registered projects (suppress the prompt).")
520
+ .action(async (key, opts) => {
521
+ try {
522
+ await runUnset(key, opts);
523
+ }
524
+ catch (e) {
525
+ console.error(`${output_1.pc.red("✗")} ${e instanceof Error ? e.message : e}`);
526
+ process.exit(1);
527
+ }
528
+ });
529
+ exports.configCommand
530
+ .command("list")
531
+ .description("Print the entire config. Default: merged effective config; --global / --project narrow to one source.")
532
+ .option("-p, --project-dir <dir>", "Project directory (default: cwd).")
533
+ .option("-g, --global", "Read from global config only.")
534
+ .option("--project", "Read from project config only.")
535
+ .action((opts) => {
536
+ try {
537
+ runList(opts);
538
+ }
539
+ catch (e) {
540
+ console.error(`${output_1.pc.red("✗")} ${e instanceof Error ? e.message : e}`);
541
+ process.exit(1);
542
+ }
543
+ });
544
+ exports.configCommand
545
+ .command("path")
546
+ .description("Print the on-disk path of the targeted config file (project by default, --global for global).")
547
+ .option("-p, --project-dir <dir>", "Project directory (default: cwd).")
548
+ .option("-g, --global", "Print global config path (~/.ironbee/config.json).")
549
+ .action((opts) => {
550
+ try {
551
+ runPath(opts);
552
+ }
553
+ catch (e) {
554
+ console.error(`${output_1.pc.red("✗")} ${e instanceof Error ? e.message : e}`);
555
+ process.exit(1);
556
+ }
557
+ });
558
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;;;AA+YH,wBAiCC;AAWD,4BAgCC;AAQD,wBAeC;AAED,0BAIC;AAED,0BAGC;AA3fD,yCAAoC;AACpC,2BAAoF;AACpF,2BAA6B;AAC7B,+BAAqC;AAErC,kDAA2G;AAC3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AC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACvE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,3 +1,17 @@
1
1
  import { Command } from "commander";
2
+ /**
3
+ * `install --all` driver — iterate every active registered project and
4
+ * run install on each, using either the project's recorded clients or an
5
+ * explicit `--client` override.
6
+ *
7
+ * Per-project failures are logged and the loop continues; the function
8
+ * returns the failure count so the action handler can pick the exit code.
9
+ */
10
+ export declare function runInstallAll(opts: {
11
+ client?: string;
12
+ }): Promise<{
13
+ failures: number;
14
+ total: number;
15
+ }>;
2
16
  export declare const installCommand: Command;
3
17
  //# sourceMappingURL=install.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASpC,eAAO,MAAM,cAAc,EAAE,OA8CvB,CAAC"}
1
+ {"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../src/commands/install.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoCpC;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAmD3G;AAED,eAAO,MAAM,cAAc,EAAE,OA+EvB,CAAC"}