kirograph 0.13.1 → 0.14.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/README.md +191 -8
- package/dist/bin/commands/caveman.js +7 -2
- package/dist/bin/commands/caveman.js.map +2 -2
- package/dist/bin/commands/compression.js +109 -0
- package/dist/bin/commands/compression.js.map +7 -0
- package/dist/bin/commands/context.js +31 -24
- package/dist/bin/commands/context.js.map +2 -2
- package/dist/bin/commands/exec.js +107 -0
- package/dist/bin/commands/exec.js.map +7 -0
- package/dist/bin/commands/gain.js +119 -0
- package/dist/bin/commands/gain.js.map +7 -0
- package/dist/bin/commands/help.js +10 -1
- package/dist/bin/commands/help.js.map +2 -2
- package/dist/bin/commands/memory.js +483 -0
- package/dist/bin/commands/memory.js.map +7 -0
- package/dist/bin/commands/query.js +5 -1
- package/dist/bin/commands/query.js.map +2 -2
- package/dist/bin/commands/uninit.js +14 -2
- package/dist/bin/commands/uninit.js.map +2 -2
- package/dist/bin/commands/utils.js +16 -0
- package/dist/bin/commands/utils.js.map +2 -2
- package/dist/bin/installer/config-prompt.js +9 -2
- package/dist/bin/installer/config-prompt.js.map +2 -2
- package/dist/bin/installer/hooks.js +48 -71
- package/dist/bin/installer/hooks.js.map +2 -2
- package/dist/bin/installer/index.js +6 -1
- package/dist/bin/installer/index.js.map +2 -2
- package/dist/bin/installer/steering.js +116 -40
- package/dist/bin/installer/steering.js.map +2 -2
- package/dist/bin/installer/targets/index.js.map +1 -1
- package/dist/bin/installer/targets/kiro.js +4 -2
- package/dist/bin/installer/targets/kiro.js.map +2 -2
- package/dist/bin/kirograph.js +7 -1
- package/dist/bin/kirograph.js.map +3 -3
- package/dist/compression/filters/aws.js +418 -0
- package/dist/compression/filters/aws.js.map +7 -0
- package/dist/compression/filters/docker.js +153 -0
- package/dist/compression/filters/docker.js.map +7 -0
- package/dist/compression/filters/files.js +150 -0
- package/dist/compression/filters/files.js.map +7 -0
- package/dist/compression/filters/generic.js +86 -0
- package/dist/compression/filters/generic.js.map +7 -0
- package/dist/compression/filters/git.js +272 -0
- package/dist/compression/filters/git.js.map +7 -0
- package/dist/compression/filters/github.js +137 -0
- package/dist/compression/filters/github.js.map +7 -0
- package/dist/compression/filters/lint.js +280 -0
- package/dist/compression/filters/lint.js.map +7 -0
- package/dist/compression/filters/misc.js +212 -0
- package/dist/compression/filters/misc.js.map +7 -0
- package/dist/compression/filters/package.js +151 -0
- package/dist/compression/filters/package.js.map +7 -0
- package/dist/compression/filters/test.js +266 -0
- package/dist/compression/filters/test.js.map +7 -0
- package/dist/compression/index.js +144 -0
- package/dist/compression/index.js.map +7 -0
- package/dist/compression/naive-cost.js +94 -0
- package/dist/compression/naive-cost.js.map +7 -0
- package/dist/compression/tracker.js +228 -0
- package/dist/compression/tracker.js.map +7 -0
- package/dist/compression/types.js +17 -0
- package/dist/compression/types.js.map +7 -0
- package/dist/config.js +18 -1
- package/dist/config.js.map +2 -2
- package/dist/db/memory-schema.sql +51 -0
- package/dist/mcp/tool-names.js +3 -1
- package/dist/mcp/tool-names.js.map +2 -2
- package/dist/mcp/tools.js +170 -4
- package/dist/mcp/tools.js.map +3 -3
- package/dist/memory/compress.js +142 -0
- package/dist/memory/compress.js.map +7 -0
- package/dist/memory/database.js +375 -0
- package/dist/memory/database.js.map +7 -0
- package/dist/memory/index.js +239 -0
- package/dist/memory/index.js.map +7 -0
- package/dist/memory/symbols.js +54 -0
- package/dist/memory/symbols.js.map +7 -0
- package/dist/memory/types.js +17 -0
- package/dist/memory/types.js.map +7 -0
- package/dist/memory/vectors.js +199 -0
- package/dist/memory/vectors.js.map +7 -0
- package/package.json +1 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var exec_exports = {};
|
|
20
|
+
__export(exec_exports, {
|
|
21
|
+
register: () => register
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(exec_exports);
|
|
24
|
+
var import_child_process = require("child_process");
|
|
25
|
+
var import_compression = require("../../compression/index");
|
|
26
|
+
var import_tracker = require("../../compression/tracker");
|
|
27
|
+
var import_config = require("../../config");
|
|
28
|
+
var import_ui = require("../ui");
|
|
29
|
+
function register(program) {
|
|
30
|
+
program.command("exec").description("Run a shell command and return token-optimized output").option("-l, --level <level>", "Compression level: normal, aggressive, ultra").option("-t, --timeout <seconds>", "Timeout in seconds", "60").option("--raw", "Also print the raw output for comparison").option("--json", "Output result as JSON").allowUnknownOption(true).allowExcessArguments(true).action(async (opts, cmd) => {
|
|
31
|
+
const args = cmd.args;
|
|
32
|
+
if (args.length === 0) {
|
|
33
|
+
console.error(" Usage: kirograph exec <command...>");
|
|
34
|
+
console.error(" Example: kirograph exec git status");
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
const shellCommand = args.join(" ");
|
|
38
|
+
const cwd = process.cwd();
|
|
39
|
+
const timeout = (parseInt(opts.timeout || "60", 10) || 60) * 1e3;
|
|
40
|
+
let defaultLevel = "normal";
|
|
41
|
+
try {
|
|
42
|
+
const config = await (0, import_config.loadConfig)(cwd);
|
|
43
|
+
if (config.shellCompressionLevel && config.shellCompressionLevel !== "off") {
|
|
44
|
+
defaultLevel = config.shellCompressionLevel;
|
|
45
|
+
}
|
|
46
|
+
} catch {
|
|
47
|
+
}
|
|
48
|
+
const level = opts.level || defaultLevel;
|
|
49
|
+
const validLevels = ["normal", "aggressive", "ultra"];
|
|
50
|
+
if (!validLevels.includes(level)) {
|
|
51
|
+
console.error(` Unknown level: ${level}. Choose from: normal, aggressive, ultra`);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
let rawOutput;
|
|
55
|
+
let exitCode = 0;
|
|
56
|
+
try {
|
|
57
|
+
rawOutput = (0, import_child_process.execSync)(shellCommand, {
|
|
58
|
+
cwd,
|
|
59
|
+
timeout,
|
|
60
|
+
encoding: "utf8",
|
|
61
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
62
|
+
maxBuffer: 10 * 1024 * 1024
|
|
63
|
+
});
|
|
64
|
+
} catch (err) {
|
|
65
|
+
rawOutput = (err.stdout || "") + (err.stderr || "");
|
|
66
|
+
exitCode = err.status ?? 1;
|
|
67
|
+
}
|
|
68
|
+
const result = (0, import_compression.compress)(shellCommand, rawOutput, { level, preserveErrors: exitCode !== 0 });
|
|
69
|
+
const tracker = new import_tracker.TokenTracker(cwd);
|
|
70
|
+
tracker.record(shellCommand, result.originalTokens, result.compressedTokens, result.strategy);
|
|
71
|
+
if (opts.json) {
|
|
72
|
+
console.log(JSON.stringify({
|
|
73
|
+
command: shellCommand,
|
|
74
|
+
exitCode,
|
|
75
|
+
level,
|
|
76
|
+
strategy: result.strategy,
|
|
77
|
+
commandFamily: result.commandFamily,
|
|
78
|
+
originalTokens: result.originalTokens,
|
|
79
|
+
compressedTokens: result.compressedTokens,
|
|
80
|
+
savings: result.savings,
|
|
81
|
+
output: result.output
|
|
82
|
+
}, null, 2));
|
|
83
|
+
process.exit(exitCode);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (opts.raw) {
|
|
87
|
+
console.log(`${import_ui.dim}\u2500\u2500 raw (${result.originalTokens} tokens) \u2500\u2500${import_ui.reset}`);
|
|
88
|
+
console.log(rawOutput);
|
|
89
|
+
console.log(`${import_ui.dim}\u2500\u2500 compressed (${result.compressedTokens} tokens) \u2500\u2500${import_ui.reset}`);
|
|
90
|
+
}
|
|
91
|
+
if (exitCode !== 0) {
|
|
92
|
+
process.stderr.write(result.output + "\n");
|
|
93
|
+
} else {
|
|
94
|
+
console.log(result.output);
|
|
95
|
+
}
|
|
96
|
+
if (result.savings > 5) {
|
|
97
|
+
console.log(`
|
|
98
|
+
${import_ui.dim}[${import_ui.green}${result.savings}% saved${import_ui.reset}${import_ui.dim} | ${result.originalTokens}\u2192${result.compressedTokens} tokens | ${import_ui.violet}${result.strategy}${import_ui.reset}${import_ui.dim}]${import_ui.reset}`);
|
|
99
|
+
}
|
|
100
|
+
process.exit(exitCode);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
104
|
+
0 && (module.exports = {
|
|
105
|
+
register
|
|
106
|
+
});
|
|
107
|
+
//# sourceMappingURL=exec.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/bin/commands/exec.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * kirograph exec <command...> \u2014 Run a shell command with token-optimized output\n *\n * Examples:\n * kirograph exec git status\n * kirograph exec --level aggressive npm test\n * kirograph exec -l ultra ls -la src/\n */\n\nimport { Command } from 'commander';\nimport { execSync } from 'child_process';\nimport { compress } from '../../compression/index';\nimport { TokenTracker } from '../../compression/tracker';\nimport { loadConfig } from '../../config';\nimport { dim, green, reset, violet } from '../ui';\n\nexport function register(program: Command): void {\n program\n .command('exec')\n .description('Run a shell command and return token-optimized output')\n .option('-l, --level <level>', 'Compression level: normal, aggressive, ultra')\n .option('-t, --timeout <seconds>', 'Timeout in seconds', '60')\n .option('--raw', 'Also print the raw output for comparison')\n .option('--json', 'Output result as JSON')\n .allowUnknownOption(true)\n .allowExcessArguments(true)\n .action(async (opts: { level?: string; timeout?: string; raw?: boolean; json?: boolean }, cmd: Command) => {\n // Everything after \"exec\" and known options is the command to run\n const args = cmd.args;\n if (args.length === 0) {\n console.error(' Usage: kirograph exec <command...>');\n console.error(' Example: kirograph exec git status');\n process.exit(1);\n }\n\n const shellCommand = args.join(' ');\n const cwd = process.cwd();\n const timeout = (parseInt(opts.timeout || '60', 10) || 60) * 1000;\n\n // Read default level from config\n let defaultLevel: 'normal' | 'aggressive' | 'ultra' = 'normal';\n try {\n const config = await loadConfig(cwd);\n if (config.shellCompressionLevel && config.shellCompressionLevel !== 'off') {\n defaultLevel = config.shellCompressionLevel as 'normal' | 'aggressive' | 'ultra';\n }\n } catch { /* no config */ }\n\n const level = (opts.level as 'normal' | 'aggressive' | 'ultra') || defaultLevel;\n const validLevels = ['normal', 'aggressive', 'ultra'];\n if (!validLevels.includes(level)) {\n console.error(` Unknown level: ${level}. Choose from: normal, aggressive, ultra`);\n process.exit(1);\n }\n\n // Execute the command\n let rawOutput: string;\n let exitCode = 0;\n try {\n rawOutput = execSync(shellCommand, {\n cwd,\n timeout,\n encoding: 'utf8',\n stdio: ['pipe', 'pipe', 'pipe'],\n maxBuffer: 10 * 1024 * 1024,\n });\n } catch (err: any) {\n rawOutput = (err.stdout || '') + (err.stderr || '');\n exitCode = err.status ?? 1;\n }\n\n // Compress\n const result = compress(shellCommand, rawOutput, { level, preserveErrors: exitCode !== 0 });\n\n // Track savings\n const tracker = new TokenTracker(cwd);\n tracker.record(shellCommand, result.originalTokens, result.compressedTokens, result.strategy);\n\n // Output\n if (opts.json) {\n console.log(JSON.stringify({\n command: shellCommand,\n exitCode,\n level,\n strategy: result.strategy,\n commandFamily: result.commandFamily,\n originalTokens: result.originalTokens,\n compressedTokens: result.compressedTokens,\n savings: result.savings,\n output: result.output,\n }, null, 2));\n process.exit(exitCode);\n return;\n }\n\n if (opts.raw) {\n console.log(`${dim}\u2500\u2500 raw (${result.originalTokens} tokens) \u2500\u2500${reset}`);\n console.log(rawOutput);\n console.log(`${dim}\u2500\u2500 compressed (${result.compressedTokens} tokens) \u2500\u2500${reset}`);\n }\n\n // Print compressed output\n if (exitCode !== 0) {\n process.stderr.write(result.output + '\\n');\n } else {\n console.log(result.output);\n }\n\n // Print savings footer\n if (result.savings > 5) {\n console.log(`\\n${dim}[${green}${result.savings}% saved${reset}${dim} | ${result.originalTokens}\u2192${result.compressedTokens} tokens | ${violet}${result.strategy}${reset}${dim}]${reset}`);\n }\n\n process.exit(exitCode);\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,2BAAyB;AACzB,yBAAyB;AACzB,qBAA6B;AAC7B,oBAA2B;AAC3B,gBAA0C;AAEnC,SAAS,SAAS,SAAwB;AAC/C,UACG,QAAQ,MAAM,EACd,YAAY,uDAAuD,EACnE,OAAO,uBAAuB,8CAA8C,EAC5E,OAAO,2BAA2B,sBAAsB,IAAI,EAC5D,OAAO,SAAS,0CAA0C,EAC1D,OAAO,UAAU,uBAAuB,EACxC,mBAAmB,IAAI,EACvB,qBAAqB,IAAI,EACzB,OAAO,OAAO,MAA2E,QAAiB;AAEzG,UAAM,OAAO,IAAI;AACjB,QAAI,KAAK,WAAW,GAAG;AACrB,cAAQ,MAAM,sCAAsC;AACpD,cAAQ,MAAM,sCAAsC;AACpD,cAAQ,KAAK,CAAC;AAAA,IAChB;AAEA,UAAM,eAAe,KAAK,KAAK,GAAG;AAClC,UAAM,MAAM,QAAQ,IAAI;AACxB,UAAM,WAAW,SAAS,KAAK,WAAW,MAAM,EAAE,KAAK,MAAM;AAG7D,QAAI,eAAkD;AACtD,QAAI;AACF,YAAM,SAAS,UAAM,0BAAW,GAAG;AACnC,UAAI,OAAO,yBAAy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G,aAAG,4BAAkB,OAAO,gBAAgB,wBAAc,eAAK,EAAE;AAAA,IAClF;AAGA,QAAI,aAAa,GAAG;AAClB,cAAQ,OAAO,MAAM,OAAO,SAAS,IAAI;AAAA,IAC3C,OAAO;AACL,cAAQ,IAAI,OAAO,MAAM;AAAA,IAC3B;AAGA,QAAI,OAAO,UAAU,GAAG;AACtB,cAAQ,IAAI;AAAA,EAAK,aAAG,IAAI,eAAK,GAAG,OAAO,OAAO,UAAU,eAAK,GAAG,aAAG,MAAM,OAAO,cAAc,SAAI,OAAO,gBAAgB,aAAa,gBAAM,GAAG,OAAO,QAAQ,GAAG,eAAK,GAAG,aAAG,IAAI,eAAK,EAAE;AAAA,IACzL;AAEA,YAAQ,KAAK,QAAQ;AAAA,EACvB,CAAC;AACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var gain_exports = {};
|
|
20
|
+
__export(gain_exports, {
|
|
21
|
+
register: () => register
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(gain_exports);
|
|
24
|
+
function register(program) {
|
|
25
|
+
program.command("gain").description("Show token savings from kirograph_exec compression").option("--graph", "Show ASCII graph of daily savings").option("--history", "Show recent command history").option("--daily", "Show day-by-day breakdown").option("--period <period>", "Time period: session, today, week, all", "all").option("--json", "Output as JSON").action(async (opts) => {
|
|
26
|
+
const { TokenTracker } = await Promise.resolve().then(() => require("../../compression/tracker.js"));
|
|
27
|
+
const tracker = new TokenTracker(process.cwd());
|
|
28
|
+
if (opts.history) {
|
|
29
|
+
const history = tracker.getHistory(20);
|
|
30
|
+
if (history.length === 0) {
|
|
31
|
+
console.log(" No commands recorded yet. Use kirograph_exec to run commands with compression.");
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (opts.json) {
|
|
35
|
+
console.log(JSON.stringify(history, null, 2));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
console.log(" Recent compressed commands:\n");
|
|
39
|
+
for (const r of history) {
|
|
40
|
+
const date = new Date(r.timestamp).toLocaleString();
|
|
41
|
+
const savings = r.originalTokens > 0 ? Math.round((r.originalTokens - r.compressedTokens) / r.originalTokens * 100) : 0;
|
|
42
|
+
const cmd = r.command.length > 50 ? r.command.slice(0, 47) + "..." : r.command;
|
|
43
|
+
console.log(` ${date} ${cmd.padEnd(50)} ${savings}% saved (${r.strategy})`);
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (opts.daily || opts.graph) {
|
|
48
|
+
const daily = tracker.getDailyBreakdown(30);
|
|
49
|
+
if (daily.length === 0) {
|
|
50
|
+
console.log(" No data yet.");
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (opts.json) {
|
|
54
|
+
console.log(JSON.stringify(daily, null, 2));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (opts.graph) {
|
|
58
|
+
console.log(" Token savings (last 30 days):\n");
|
|
59
|
+
const maxSaved = Math.max(...daily.map((d) => d.saved), 1);
|
|
60
|
+
const barWidth = 40;
|
|
61
|
+
for (const day of daily) {
|
|
62
|
+
const bar = "\u2588".repeat(Math.round(day.saved / maxSaved * barWidth));
|
|
63
|
+
const label = day.date.slice(5);
|
|
64
|
+
console.log(` ${label} ${bar} ${day.saved.toLocaleString()} tokens (${day.commands} cmds)`);
|
|
65
|
+
}
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
console.log(" Daily breakdown:\n");
|
|
69
|
+
console.log(" Date Commands Tokens Saved");
|
|
70
|
+
console.log(" " + "\u2500".repeat(40));
|
|
71
|
+
for (const day of daily) {
|
|
72
|
+
console.log(` ${day.date} ${String(day.commands).padStart(8)} ${day.saved.toLocaleString().padStart(12)}`);
|
|
73
|
+
}
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const period = opts.period;
|
|
77
|
+
const stats = tracker.getStats(period);
|
|
78
|
+
if (stats.totalCommands === 0) {
|
|
79
|
+
console.log(" No savings recorded yet.");
|
|
80
|
+
console.log(" Use kirograph tools and kirograph exec . Savings are tracked automatically.");
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (opts.json) {
|
|
84
|
+
console.log(JSON.stringify(stats, null, 2));
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
console.log(`
|
|
88
|
+
Token Savings (${period}):`);
|
|
89
|
+
console.log(` ${"\u2500".repeat(50)}`);
|
|
90
|
+
console.log(` Total calls: ${stats.totalCommands}`);
|
|
91
|
+
console.log(` Tokens without KiroGraph: ~${stats.totalOriginal.toLocaleString()}`);
|
|
92
|
+
console.log(` Tokens with KiroGraph: ~${stats.totalCompressed.toLocaleString()}`);
|
|
93
|
+
console.log(` Saved: ~${stats.totalSaved.toLocaleString()} (${stats.savingsPercent}%)`);
|
|
94
|
+
if (stats.bySource.exec.count > 0 || stats.bySource.graph.count > 0) {
|
|
95
|
+
console.log(`
|
|
96
|
+
By source:`);
|
|
97
|
+
if (stats.bySource.graph.count > 0) {
|
|
98
|
+
console.log(` \u{1F4CA} Graph tools: ${String(stats.bySource.graph.count).padStart(4)} calls ~${stats.bySource.graph.saved.toLocaleString()} tokens saved (vs file reads/grep)`);
|
|
99
|
+
}
|
|
100
|
+
if (stats.bySource.exec.count > 0) {
|
|
101
|
+
console.log(` \u26A1 Compression: ${String(stats.bySource.exec.count).padStart(4)} calls ~${stats.bySource.exec.saved.toLocaleString()} tokens saved (vs raw output)`);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
if (Object.keys(stats.byFamily).length > 0) {
|
|
105
|
+
console.log(`
|
|
106
|
+
By family:`);
|
|
107
|
+
for (const [family, data] of Object.entries(stats.byFamily)) {
|
|
108
|
+
const icon = family.startsWith("graph") ? "\u{1F4CA}" : "\u26A1";
|
|
109
|
+
console.log(` ${icon} ${family.padEnd(20)} ${String(data.count).padStart(4)} calls ${data.savings}% avg savings`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
console.log();
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
116
|
+
0 && (module.exports = {
|
|
117
|
+
register
|
|
118
|
+
});
|
|
119
|
+
//# sourceMappingURL=gain.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/bin/commands/gain.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * kirograph gain \u2014 Token savings analytics CLI command\n */\n\nimport { Command } from 'commander';\n\nexport function register(program: Command): void {\n program\n .command('gain')\n .description('Show token savings from kirograph_exec compression')\n .option('--graph', 'Show ASCII graph of daily savings')\n .option('--history', 'Show recent command history')\n .option('--daily', 'Show day-by-day breakdown')\n .option('--period <period>', 'Time period: session, today, week, all', 'all')\n .option('--json', 'Output as JSON')\n .action(async (opts: { graph?: boolean; history?: boolean; daily?: boolean; period: string; json?: boolean }) => {\n const { TokenTracker } = await Promise.resolve().then(() => require('../../compression/tracker.js'));\n const tracker = new TokenTracker(process.cwd());\n\n if (opts.history) {\n const history = tracker.getHistory(20);\n if (history.length === 0) {\n console.log(' No commands recorded yet. Use kirograph_exec to run commands with compression.');\n return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(history, null, 2));\n return;\n }\n\n console.log(' Recent compressed commands:\\n');\n for (const r of history) {\n const date = new Date(r.timestamp).toLocaleString();\n const savings = r.originalTokens > 0\n ? Math.round(((r.originalTokens - r.compressedTokens) / r.originalTokens) * 100)\n : 0;\n const cmd = r.command.length > 50 ? r.command.slice(0, 47) + '...' : r.command;\n console.log(` ${date} ${cmd.padEnd(50)} ${savings}% saved (${r.strategy})`);\n }\n return;\n }\n\n if (opts.daily || opts.graph) {\n const daily = tracker.getDailyBreakdown(30);\n if (daily.length === 0) {\n console.log(' No data yet.');\n return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(daily, null, 2));\n return;\n }\n\n if (opts.graph) {\n console.log(' Token savings (last 30 days):\\n');\n const maxSaved = Math.max(...daily.map(d => d.saved), 1);\n const barWidth = 40;\n\n for (const day of daily) {\n const bar = '\u2588'.repeat(Math.round((day.saved / maxSaved) * barWidth));\n const label = day.date.slice(5); // MM-DD\n console.log(` ${label} ${bar} ${day.saved.toLocaleString()} tokens (${day.commands} cmds)`);\n }\n return;\n }\n\n console.log(' Daily breakdown:\\n');\n console.log(' Date Commands Tokens Saved');\n console.log(' ' + '\u2500'.repeat(40));\n for (const day of daily) {\n console.log(` ${day.date} ${String(day.commands).padStart(8)} ${day.saved.toLocaleString().padStart(12)}`);\n }\n return;\n }\n\n // Default: summary stats\n const period = opts.period as 'session' | 'today' | 'week' | 'all';\n const stats = tracker.getStats(period);\n\n if (stats.totalCommands === 0) {\n console.log(' No savings recorded yet.');\n console.log(' Use kirograph tools and kirograph exec . Savings are tracked automatically.');\n return;\n }\n\n if (opts.json) {\n console.log(JSON.stringify(stats, null, 2));\n return;\n }\n\n console.log(`\\n Token Savings (${period}):`);\n console.log(` ${'\u2500'.repeat(50)}`);\n console.log(` Total calls: ${stats.totalCommands}`);\n console.log(` Tokens without KiroGraph: ~${stats.totalOriginal.toLocaleString()}`);\n console.log(` Tokens with KiroGraph: ~${stats.totalCompressed.toLocaleString()}`);\n console.log(` Saved: ~${stats.totalSaved.toLocaleString()} (${stats.savingsPercent}%)`);\n\n // Source breakdown\n if (stats.bySource.exec.count > 0 || stats.bySource.graph.count > 0) {\n console.log(`\\n By source:`);\n if (stats.bySource.graph.count > 0) {\n console.log(` \uD83D\uDCCA Graph tools: ${String(stats.bySource.graph.count).padStart(4)} calls ~${stats.bySource.graph.saved.toLocaleString()} tokens saved (vs file reads/grep)`);\n }\n if (stats.bySource.exec.count > 0) {\n console.log(` \u26A1 Compression: ${String(stats.bySource.exec.count).padStart(4)} calls ~${stats.bySource.exec.saved.toLocaleString()} tokens saved (vs raw output)`);\n }\n }\n\n if (Object.keys(stats.byFamily).length > 0) {\n console.log(`\\n By family:`);\n for (const [family, data] of Object.entries(stats.byFamily)) {\n const icon = family.startsWith('graph') ? '\uD83D\uDCCA' : '\u26A1';\n console.log(` ${icon} ${family.padEnd(20)} ${String(data.count).padStart(4)} calls ${data.savings}% avg savings`);\n }\n }\n\n console.log();\n });\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,SAAS,SAAS,SAAwB;AAC/C,UACG,QAAQ,MAAM,EACd,YAAY,oDAAoD,EAChE,OAAO,WAAW,mCAAmC,EACrD,OAAO,aAAa,6BAA6B,EACjD,OAAO,WAAW,2BAA2B,EAC7C,OAAO,qBAAqB,0CAA0C,KAAK,EAC3E,OAAO,UAAU,gBAAgB,EACjC,OAAO,OAAO,SAAkG;AAC/G,UAAM,EAAE,aAAa,IAAI,MAAM,QAAQ,QAAQ,EAAE,KAAK,MAAM,QAAQ,8BAA8B,CAAC;AACnG,UAAM,UAAU,IAAI,aA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BAAwB,OAAO,MAAM,SAAS,MAAM,KAAK,EAAE,SAAS,CAAC,CAAC,YAAY,MAAM,SAAS,MAAM,MAAM,eAAe,CAAC,oCAAoC;AAAA,MAC/K;AACA,UAAI,MAAM,SAAS,KAAK,QAAQ,GAAG;AACjC,gBAAQ,IAAI,4BAAuB,OAAO,MAAM,SAAS,KAAK,KAAK,EAAE,SAAS,CAAC,CAAC,YAAY,MAAM,SAAS,KAAK,MAAM,eAAe,CAAC,+BAA+B;AAAA,MACvK;AAAA,IACF;AAEA,QAAI,OAAO,KAAK,MAAM,QAAQ,EAAE,SAAS,GAAG;AAC1C,cAAQ,IAAI;AAAA,aAAgB;AAC5B,iBAAW,CAAC,QAAQ,IAAI,KAAK,OAAO,QAAQ,MAAM,QAAQ,GAAG;AAC3D,cAAM,OAAO,OAAO,WAAW,OAAO,IAAI,cAAO;AACjD,gBAAQ,IAAI,OAAO,IAAI,IAAI,OAAO,OAAO,EAAE,CAAC,IAAI,OAAO,KAAK,KAAK,EAAE,SAAS,CAAC,CAAC,WAAW,KAAK,OAAO,eAAe;AAAA,MACtH;AAAA,IACF;AAEA,YAAQ,IAAI;AAAA,EACd,CAAC;AACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -89,6 +89,9 @@ function printColoredHelp() {
|
|
|
89
89
|
title: "\u2699\uFE0F Agent & Configuration",
|
|
90
90
|
commands: [
|
|
91
91
|
{ name: "caveman", args: "[mode]", desc: "Set agent communication style (off | lite | full | ultra)" },
|
|
92
|
+
{ name: "compression", args: "[level]", desc: "Set shell compression level (off | normal | aggressive | ultra)" },
|
|
93
|
+
{ name: "exec", args: "<command...>", desc: "Run a shell command with token-optimized output", opts: ["-l, --level <l> normal | aggressive | ultra", "-t, --timeout <s> Timeout in seconds (default 60)", "--raw Show raw + compressed for comparison", "--json Output as JSON"] },
|
|
94
|
+
{ name: "gain", desc: "Show token savings from compressed command outputs", opts: ["--graph ASCII graph (last 30 days)", "--history Recent command history", "--daily Day-by-day breakdown", "--period <p> session | today | week | all"] },
|
|
92
95
|
{ name: "serve", desc: "Start the MCP server", opts: ["--mcp Run as MCP stdio server", "--path <p> Project path"] },
|
|
93
96
|
{ name: "dashboard", desc: "Manage the Qdrant or Typesense dashboard server", opts: ["start [path] Start server and open dashboard", "stop [path] Stop the running server"] }
|
|
94
97
|
]
|
|
@@ -113,7 +116,7 @@ ${c.bold}${c.paleLavender}USAGE${c.reset}`);
|
|
|
113
116
|
console.log(`${prefix}${namePart}${pad}${c.gray}${cmd.desc}${c.reset}`);
|
|
114
117
|
if (isCaveman) {
|
|
115
118
|
const inspiredPad = " ".repeat(3 + nameWidth);
|
|
116
|
-
console.log(`${inspiredPad}${c.dim}Inspired by Caveman
|
|
119
|
+
console.log(`${inspiredPad}${c.dim}Inspired by Caveman , original idea by github.com/JuliusBrussee/caveman${c.reset}`);
|
|
117
120
|
console.log();
|
|
118
121
|
}
|
|
119
122
|
if (cmd.opts) {
|
|
@@ -184,6 +187,12 @@ ${c.bold}${c.paleLavender}USAGE${c.reset}`);
|
|
|
184
187
|
examples: [
|
|
185
188
|
["kirograph caveman full", "Enable full caveman mode for the agent"],
|
|
186
189
|
["kirograph caveman off", "Disable caveman mode"],
|
|
190
|
+
["kirograph compression aggressive", "Set compression to aggressive level"],
|
|
191
|
+
["kirograph compression off", "Disable compression hook (tool still available)"],
|
|
192
|
+
["kirograph exec git status", "Run git status with compression"],
|
|
193
|
+
["kirograph exec --level ultra npm test", "Run tests with ultra compression"],
|
|
194
|
+
["kirograph exec --raw cargo build", "Show raw vs compressed comparison"],
|
|
195
|
+
["kirograph gain --graph", "Show token savings graph"],
|
|
187
196
|
["kirograph serve --mcp", "Start the MCP server"]
|
|
188
197
|
]
|
|
189
198
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/bin/commands/help.ts"],
|
|
4
|
-
"sourcesContent": ["import { Command } from 'commander';\nimport { printBanner } from '../banner';\n\ntype CommandEntry = { name: string; args?: string; desc: string; opts?: string[] };\ntype Group = { title: string; commands: CommandEntry[] };\n\nexport function printColoredHelp(): void {\n const c = {\n reset: '\\x1b[0m',\n bold: '\\x1b[1m',\n dim: '\\x1b[2m',\n violet: '\\x1b[38;5;99m',\n purple: '\\x1b[38;5;135m',\n lavender: '\\x1b[38;5;141m',\n paleLavender: '\\x1b[38;5;183m',\n gray: '\\x1b[90m',\n brown: '\\x1b[38;5;130m',\n };\n\n const groups: Group[] = [\n {\n title: '\uD83D\uDD27 Workspace Setup',\n commands: [\n { name: 'install', desc: 'Wire up MCP/instructions for an agent workspace', opts: ['--target <t> kiro | claude | codex'] },\n { name: 'init', args: '[path]', desc: 'Initialize KiroGraph in a project', opts: ['-i, --index Index immediately after init'] },\n { name: 'uninit', args: '[path]', desc: 'Remove KiroGraph from a project', opts: ['--force Skip confirmation', '--target <t> kiro | claude | codex | all'] },\n { name: 'uninstall', args: '[path]', desc: 'Alias for uninit', opts: ['--force Skip confirmation', '--target <t> kiro | claude | codex | all'] },\n ],\n },\n {\n title: '\uD83D\uDCE6 Indexing',\n commands: [\n { name: 'index', args: '[path]', desc: 'Full re-index of a project', opts: ['--force Force re-index all files'] },\n { name: 'sync', args: '[path]', desc: 'Incremental sync of changed files', opts: ['--files <f> Specific files to sync'] },\n { name: 'sync-if-dirty', args: '[path]', desc: 'Sync only if a dirty marker is present', opts: ['-q, --quiet Suppress output'] },\n { name: 'mark-dirty', args: '[path]', desc: 'Write a dirty marker for deferred sync' },\n { name: 'unlock', args: '[path]', desc: 'Force-release a stale lock file' },\n ],\n },\n {\n title: '\uD83D\uDD0D Search & Exploration',\n commands: [\n { name: 'status', args: '[path]', desc: 'Show index statistics and health' },\n { name: 'query', args: '<search>', desc: 'Search for symbols by name', opts: ['--kind <k> Filter by kind', '--limit <n> Max results (default 10)'] },\n { name: 'context', args: '<task>', desc: 'Build relevant code context for a task', opts: ['--max-nodes <n> Max symbols (default 20)', '--no-code Exclude code snippets', '--format <fmt> markdown | json'] },\n { name: 'files', args: '[path]', desc: 'Show project file structure from the index', opts: ['--format <fmt> tree | flat | grouped', '--filter <path> Filter by directory prefix', '--pattern <glob> Filter by glob', '--max-depth <n> Limit tree depth', '--json Output as JSON'] },\n { name: 'path', args: '<from> <to>', desc: 'Find the shortest path between two symbols', opts: ['--format <fmt> table | json'] },\n { name: 'export build', args: '[path]', desc: 'Generate the interactive graph dashboard (.kirograph/export/)', opts: ['-o, --output <dir> Custom output directory', '--include-contains Include structural contains edges'] },\n { name: 'export start', args: '[path]', desc: 'Generate and open the dashboard in the browser', opts: ['-o, --output <dir> Custom output directory', '--include-contains Include structural contains edges'] },\n { name: 'affected', args: '[files...]', desc: 'Find test files affected by changed source files', opts: ['--stdin Read file list from stdin', '-d, --depth <n> Max traversal depth (default 5)', '-f, --filter <g> Custom test file glob', '-j, --json Output as JSON', '-q, --quiet File paths only'] },\n ],\n },\n {\n title: '\uD83D\uDCCA Graph Insights',\n commands: [\n { name: 'hotspots', args: '[path]', desc: 'Find most-connected symbols by edge degree', opts: ['--limit <n> Max results (default 20)', '--format <f> table | json'] },\n { name: 'surprising', args: '[path]', desc: 'Find non-obvious cross-file connections', opts: ['--limit <n> Max results (default 20)', '--format <f> table | json'] },\n { name: 'dead-code', args: '[path]', desc: 'Find unexported symbols with no incoming references', opts: ['--limit <n> Max results (default 50)', '--format <f> table | json'] },\n { name: 'snapshot', desc: 'Save or list graph snapshots for structural diffing', opts: ['save [label] Save current graph state', 'list List saved snapshots', 'diff [label] Diff current graph vs a snapshot --format summary|full|json'] },\n ],\n },\n {\n title: '\uD83C\uDFDB\uFE0F Architecture Analysis',\n commands: [\n { name: 'architecture', args: '[path]', desc: 'Show package graph and layer map', opts: ['--packages Show packages only', '--layers Show layers only', '--format <f> json'] },\n { name: 'coupling', args: '[path]', desc: 'Show coupling metrics per package', opts: ['--sort <s> instability | ca | ce | name', '--package <n> Detail view for one package', '--format <f> json'] },\n { name: 'package', args: '<name>', desc: 'Inspect a package: deps, files, metrics', opts: ['--no-files Omit file list', '--format <f> json'] },\n ],\n },\n {\n title: '\u2699\uFE0F Agent & Configuration',\n commands: [\n { name: 'caveman', args: '[mode]', desc: 'Set agent communication style (off | lite | full | ultra)' },\n { name: 'serve', desc: 'Start the MCP server', opts: ['--mcp Run as MCP stdio server', '--path <p> Project path'] },\n { name: 'dashboard', desc: 'Manage the Qdrant or Typesense dashboard server', opts: ['start [path] Start server and open dashboard', 'stop [path] Stop the running server'] },\n ],\n },\n ];\n\n console.log(`\\n${c.bold}${c.paleLavender}USAGE${c.reset}`);\n console.log(` ${c.lavender}kirograph${c.reset} ${c.gray}<command>${c.reset} ${c.dim}[options]${c.reset}\\n`);\n\n // Compute max name+args width across ALL groups for alignment\n const allCmds = groups.flatMap(g => g.commands);\n const nameWidth = Math.max(...allCmds.map(cmd => (cmd.name + (cmd.args ? ' ' + cmd.args : '')).length)) + 2;\n\n for (const group of groups) {\n console.log(`${c.bold}${c.paleLavender}${group.title.toUpperCase()}${c.reset}\\n`);\n for (const cmd of group.commands) {\n const signature = cmd.name + (cmd.args ? ' ' + cmd.args : '');\n const isCaveman = cmd.name === 'caveman';\n const nameColor = isCaveman ? c.brown : c.lavender;\n const prefix = isCaveman ? '\uD83E\uDEA8 ' : ' ';\n const namePart = `${nameColor}${cmd.name}${c.reset}${cmd.args ? ' ' + c.dim + cmd.args + c.reset : ''}`;\n const pad = ' '.repeat(Math.max(0, nameWidth - signature.length));\n console.log(`${prefix}${namePart}${pad}${c.gray}${cmd.desc}${c.reset}`);\n if (isCaveman) {\n // desc starts at: emoji prefix (3 display cols: \uD83E\uDEA8 + space) + nameWidth\n const inspiredPad = ' '.repeat(3 + nameWidth);\n console.log(`${inspiredPad}${c.dim}Inspired by Caveman \u2014 original idea by github.com/JuliusBrussee/caveman${c.reset}`);\n console.log();\n }\n if (cmd.opts) {\n for (const opt of cmd.opts) {\n const [flag, ...rest] = opt.split(/ +/);\n const optPad = ' '.repeat(nameWidth + 2);\n console.log(` ${optPad}${c.purple}${flag}${c.reset}${rest.length ? ' ' + c.dim + rest.join(' ') + c.reset : ''}`);\n }\n console.log();\n }\n }\n if (!groups[groups.length - 1].commands.includes(group.commands[group.commands.length - 1])) {\n // extra spacing between groups handled by opts blank line; add one if no opts\n const lastHasOpts = group.commands[group.commands.length - 1].opts;\n if (!lastHasOpts) console.log();\n }\n }\n\n console.log(`${c.bold}${c.paleLavender}GLOBAL FLAGS${c.reset}\\n`);\n console.log(` ${c.purple}-h, --help${c.reset} ${c.gray}Show this help${c.reset}`);\n console.log(` ${c.purple}-V, --version${c.reset} ${c.gray}Show version number${c.reset}\\n`);\n\n console.log(`${c.bold}${c.paleLavender}EXAMPLES${c.reset}\\n`);\n\n const exampleGroups: Array<{ title: string; examples: [string, string][] }> = [\n {\n title: '\uD83D\uDD27 Setup & indexing',\n examples: [\n ['kirograph install', 'Wire up Kiro MCP + hooks + steering for the current workspace'],\n ['kirograph install --target claude', 'Wire up Claude Code MCP + project memory'],\n ['kirograph install --target codex', 'Install Codex project instructions and print MCP config'],\n ['kirograph init --index', 'Init and immediately index the project'],\n ['kirograph sync', 'Incremental sync of changed files'],\n ],\n },\n {\n title: '\uD83D\uDD0D Search & exploration',\n examples: [\n ['kirograph query useState', 'Find all symbols named useState'],\n ['kirograph context \"add dark mode\"', 'Get relevant code context for a task'],\n ['kirograph files --format grouped', 'Show files grouped by directory'],\n ['kirograph path LoginController DatabasePool', 'Find how two symbols are connected'],\n ['kirograph affected src/auth.ts', 'Find tests affected by a change'],\n ['git diff --name-only | kirograph affected --stdin', 'Affected tests from a git diff'],\n ['kirograph export start', 'Open the interactive graph dashboard in the browser'],\n ['kirograph export build -o /tmp/graph', 'Export the dashboard to a custom directory'],\n ],\n },\n {\n title: '\uD83D\uDCCA Graph insights',\n examples: [\n ['kirograph hotspots --limit 10', 'Top 10 most-connected symbols'],\n ['kirograph surprising', 'Find unexpected cross-module connections'],\n ['kirograph dead-code', 'Find unreferenced unexported symbols'],\n ['kirograph snapshot save pre-refactor', 'Save a named snapshot before a refactor'],\n ['kirograph snapshot diff pre-refactor', 'Diff current graph vs the named snapshot'],\n ],\n },\n {\n title: '\uD83C\uDFDB\uFE0F Architecture',\n examples: [\n ['kirograph architecture --packages', 'List all detected packages'],\n ['kirograph coupling --sort instability', 'Show packages ranked by instability'],\n ['kirograph package src/auth', 'Inspect the auth package'],\n ],\n },\n {\n title: '\u2699\uFE0F Agent',\n examples: [\n ['kirograph caveman full', 'Enable full caveman mode for the agent'],\n ['kirograph caveman off', 'Disable caveman mode'],\n ['kirograph serve --mcp', 'Start the MCP server'],\n ],\n },\n ];\n\n for (const eg of exampleGroups) {\n console.log(` ${c.dim}${eg.title}${c.reset}`);\n for (const [ex, desc] of eg.examples) {\n console.log(` ${c.violet}$${c.reset} ${c.lavender}${ex}${c.reset}`);\n console.log(` ${c.dim}${desc}${c.reset}`);\n }\n console.log();\n }\n}\n\nexport function register(program: Command): void {\n program.configureHelp({ formatHelp: () => '' });\n program.addHelpText('afterAll', '');\n program.helpInformation = () => {\n printBanner();\n printColoredHelp();\n return '';\n };\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAA4B;AAKrB,SAAS,mBAAyB;AACvC,QAAM,IAAI;AAAA,IACR,OAAc;AAAA,IACd,MAAc;AAAA,IACd,KAAc;AAAA,IACd,QAAc;AAAA,IACd,QAAc;AAAA,IACd,UAAc;AAAA,IACd,cAAc;AAAA,IACd,MAAc;AAAA,IACd,OAAc;AAAA,EAChB;AAEA,QAAM,SAAkB;AAAA,IACtB;AAAA,MACE,OAAO;AAAA,MACP,UAAU;AAAA,QACR,EAAE,MAAM,WAAiB,MAAM,mDAAmD,MAAM,CAAC,qCAAqC,EAAE;AAAA,QAChI,EAAE,MAAM,QAAiB,MAAM,UAAU,MAAM,qCAAqC,MAAM,CAAC,2CAA2C,EAAE;AAAA,QACxI,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,GAAG,WAAW,GAAG,EAAE,GAAG
|
|
4
|
+
"sourcesContent": ["import { Command } from 'commander';\nimport { printBanner } from '../banner';\n\ntype CommandEntry = { name: string; args?: string; desc: string; opts?: string[] };\ntype Group = { title: string; commands: CommandEntry[] };\n\nexport function printColoredHelp(): void {\n const c = {\n reset: '\\x1b[0m',\n bold: '\\x1b[1m',\n dim: '\\x1b[2m',\n violet: '\\x1b[38;5;99m',\n purple: '\\x1b[38;5;135m',\n lavender: '\\x1b[38;5;141m',\n paleLavender: '\\x1b[38;5;183m',\n gray: '\\x1b[90m',\n brown: '\\x1b[38;5;130m',\n };\n\n const groups: Group[] = [\n {\n title: '\uD83D\uDD27 Workspace Setup',\n commands: [\n { name: 'install', desc: 'Wire up MCP/instructions for an agent workspace', opts: ['--target <t> kiro | claude | codex'] },\n { name: 'init', args: '[path]', desc: 'Initialize KiroGraph in a project', opts: ['-i, --index Index immediately after init'] },\n { name: 'uninit', args: '[path]', desc: 'Remove KiroGraph from a project', opts: ['--force Skip confirmation', '--target <t> kiro | claude | codex | all'] },\n { name: 'uninstall', args: '[path]', desc: 'Alias for uninit', opts: ['--force Skip confirmation', '--target <t> kiro | claude | codex | all'] },\n ],\n },\n {\n title: '\uD83D\uDCE6 Indexing',\n commands: [\n { name: 'index', args: '[path]', desc: 'Full re-index of a project', opts: ['--force Force re-index all files'] },\n { name: 'sync', args: '[path]', desc: 'Incremental sync of changed files', opts: ['--files <f> Specific files to sync'] },\n { name: 'sync-if-dirty', args: '[path]', desc: 'Sync only if a dirty marker is present', opts: ['-q, --quiet Suppress output'] },\n { name: 'mark-dirty', args: '[path]', desc: 'Write a dirty marker for deferred sync' },\n { name: 'unlock', args: '[path]', desc: 'Force-release a stale lock file' },\n ],\n },\n {\n title: '\uD83D\uDD0D Search & Exploration',\n commands: [\n { name: 'status', args: '[path]', desc: 'Show index statistics and health' },\n { name: 'query', args: '<search>', desc: 'Search for symbols by name', opts: ['--kind <k> Filter by kind', '--limit <n> Max results (default 10)'] },\n { name: 'context', args: '<task>', desc: 'Build relevant code context for a task', opts: ['--max-nodes <n> Max symbols (default 20)', '--no-code Exclude code snippets', '--format <fmt> markdown | json'] },\n { name: 'files', args: '[path]', desc: 'Show project file structure from the index', opts: ['--format <fmt> tree | flat | grouped', '--filter <path> Filter by directory prefix', '--pattern <glob> Filter by glob', '--max-depth <n> Limit tree depth', '--json Output as JSON'] },\n { name: 'path', args: '<from> <to>', desc: 'Find the shortest path between two symbols', opts: ['--format <fmt> table | json'] },\n { name: 'export build', args: '[path]', desc: 'Generate the interactive graph dashboard (.kirograph/export/)', opts: ['-o, --output <dir> Custom output directory', '--include-contains Include structural contains edges'] },\n { name: 'export start', args: '[path]', desc: 'Generate and open the dashboard in the browser', opts: ['-o, --output <dir> Custom output directory', '--include-contains Include structural contains edges'] },\n { name: 'affected', args: '[files...]', desc: 'Find test files affected by changed source files', opts: ['--stdin Read file list from stdin', '-d, --depth <n> Max traversal depth (default 5)', '-f, --filter <g> Custom test file glob', '-j, --json Output as JSON', '-q, --quiet File paths only'] },\n ],\n },\n {\n title: '\uD83D\uDCCA Graph Insights',\n commands: [\n { name: 'hotspots', args: '[path]', desc: 'Find most-connected symbols by edge degree', opts: ['--limit <n> Max results (default 20)', '--format <f> table | json'] },\n { name: 'surprising', args: '[path]', desc: 'Find non-obvious cross-file connections', opts: ['--limit <n> Max results (default 20)', '--format <f> table | json'] },\n { name: 'dead-code', args: '[path]', desc: 'Find unexported symbols with no incoming references', opts: ['--limit <n> Max results (default 50)', '--format <f> table | json'] },\n { name: 'snapshot', desc: 'Save or list graph snapshots for structural diffing', opts: ['save [label] Save current graph state', 'list List saved snapshots', 'diff [label] Diff current graph vs a snapshot --format summary|full|json'] },\n ],\n },\n {\n title: '\uD83C\uDFDB\uFE0F Architecture Analysis',\n commands: [\n { name: 'architecture', args: '[path]', desc: 'Show package graph and layer map', opts: ['--packages Show packages only', '--layers Show layers only', '--format <f> json'] },\n { name: 'coupling', args: '[path]', desc: 'Show coupling metrics per package', opts: ['--sort <s> instability | ca | ce | name', '--package <n> Detail view for one package', '--format <f> json'] },\n { name: 'package', args: '<name>', desc: 'Inspect a package: deps, files, metrics', opts: ['--no-files Omit file list', '--format <f> json'] },\n ],\n },\n {\n title: '\u2699\uFE0F Agent & Configuration',\n commands: [\n { name: 'caveman', args: '[mode]', desc: 'Set agent communication style (off | lite | full | ultra)' },\n { name: 'compression', args: '[level]', desc: 'Set shell compression level (off | normal | aggressive | ultra)' },\n { name: 'exec', args: '<command...>', desc: 'Run a shell command with token-optimized output', opts: ['-l, --level <l> normal | aggressive | ultra', '-t, --timeout <s> Timeout in seconds (default 60)', '--raw Show raw + compressed for comparison', '--json Output as JSON'] },\n { name: 'gain', desc: 'Show token savings from compressed command outputs', opts: ['--graph ASCII graph (last 30 days)', '--history Recent command history', '--daily Day-by-day breakdown', '--period <p> session | today | week | all'] },\n { name: 'serve', desc: 'Start the MCP server', opts: ['--mcp Run as MCP stdio server', '--path <p> Project path'] },\n { name: 'dashboard', desc: 'Manage the Qdrant or Typesense dashboard server', opts: ['start [path] Start server and open dashboard', 'stop [path] Stop the running server'] },\n ],\n },\n ];\n\n console.log(`\\n${c.bold}${c.paleLavender}USAGE${c.reset}`);\n console.log(` ${c.lavender}kirograph${c.reset} ${c.gray}<command>${c.reset} ${c.dim}[options]${c.reset}\\n`);\n\n // Compute max name+args width across ALL groups for alignment\n const allCmds = groups.flatMap(g => g.commands);\n const nameWidth = Math.max(...allCmds.map(cmd => (cmd.name + (cmd.args ? ' ' + cmd.args : '')).length)) + 2;\n\n for (const group of groups) {\n console.log(`${c.bold}${c.paleLavender}${group.title.toUpperCase()}${c.reset}\\n`);\n for (const cmd of group.commands) {\n const signature = cmd.name + (cmd.args ? ' ' + cmd.args : '');\n const isCaveman = cmd.name === 'caveman';\n const nameColor = isCaveman ? c.brown : c.lavender;\n const prefix = isCaveman ? '\uD83E\uDEA8 ' : ' ';\n const namePart = `${nameColor}${cmd.name}${c.reset}${cmd.args ? ' ' + c.dim + cmd.args + c.reset : ''}`;\n const pad = ' '.repeat(Math.max(0, nameWidth - signature.length));\n console.log(`${prefix}${namePart}${pad}${c.gray}${cmd.desc}${c.reset}`);\n if (isCaveman) {\n // desc starts at: emoji prefix (3 display cols: \uD83E\uDEA8 + space) + nameWidth\n const inspiredPad = ' '.repeat(3 + nameWidth);\n console.log(`${inspiredPad}${c.dim}Inspired by Caveman , original idea by github.com/JuliusBrussee/caveman${c.reset}`);\n console.log();\n }\n if (cmd.opts) {\n for (const opt of cmd.opts) {\n const [flag, ...rest] = opt.split(/ +/);\n const optPad = ' '.repeat(nameWidth + 2);\n console.log(` ${optPad}${c.purple}${flag}${c.reset}${rest.length ? ' ' + c.dim + rest.join(' ') + c.reset : ''}`);\n }\n console.log();\n }\n }\n if (!groups[groups.length - 1].commands.includes(group.commands[group.commands.length - 1])) {\n // extra spacing between groups handled by opts blank line; add one if no opts\n const lastHasOpts = group.commands[group.commands.length - 1].opts;\n if (!lastHasOpts) console.log();\n }\n }\n\n console.log(`${c.bold}${c.paleLavender}GLOBAL FLAGS${c.reset}\\n`);\n console.log(` ${c.purple}-h, --help${c.reset} ${c.gray}Show this help${c.reset}`);\n console.log(` ${c.purple}-V, --version${c.reset} ${c.gray}Show version number${c.reset}\\n`);\n\n console.log(`${c.bold}${c.paleLavender}EXAMPLES${c.reset}\\n`);\n\n const exampleGroups: Array<{ title: string; examples: [string, string][] }> = [\n {\n title: '\uD83D\uDD27 Setup & indexing',\n examples: [\n ['kirograph install', 'Wire up Kiro MCP + hooks + steering for the current workspace'],\n ['kirograph install --target claude', 'Wire up Claude Code MCP + project memory'],\n ['kirograph install --target codex', 'Install Codex project instructions and print MCP config'],\n ['kirograph init --index', 'Init and immediately index the project'],\n ['kirograph sync', 'Incremental sync of changed files'],\n ],\n },\n {\n title: '\uD83D\uDD0D Search & exploration',\n examples: [\n ['kirograph query useState', 'Find all symbols named useState'],\n ['kirograph context \"add dark mode\"', 'Get relevant code context for a task'],\n ['kirograph files --format grouped', 'Show files grouped by directory'],\n ['kirograph path LoginController DatabasePool', 'Find how two symbols are connected'],\n ['kirograph affected src/auth.ts', 'Find tests affected by a change'],\n ['git diff --name-only | kirograph affected --stdin', 'Affected tests from a git diff'],\n ['kirograph export start', 'Open the interactive graph dashboard in the browser'],\n ['kirograph export build -o /tmp/graph', 'Export the dashboard to a custom directory'],\n ],\n },\n {\n title: '\uD83D\uDCCA Graph insights',\n examples: [\n ['kirograph hotspots --limit 10', 'Top 10 most-connected symbols'],\n ['kirograph surprising', 'Find unexpected cross-module connections'],\n ['kirograph dead-code', 'Find unreferenced unexported symbols'],\n ['kirograph snapshot save pre-refactor', 'Save a named snapshot before a refactor'],\n ['kirograph snapshot diff pre-refactor', 'Diff current graph vs the named snapshot'],\n ],\n },\n {\n title: '\uD83C\uDFDB\uFE0F Architecture',\n examples: [\n ['kirograph architecture --packages', 'List all detected packages'],\n ['kirograph coupling --sort instability', 'Show packages ranked by instability'],\n ['kirograph package src/auth', 'Inspect the auth package'],\n ],\n },\n {\n title: '\u2699\uFE0F Agent',\n examples: [\n ['kirograph caveman full', 'Enable full caveman mode for the agent'],\n ['kirograph caveman off', 'Disable caveman mode'],\n ['kirograph compression aggressive', 'Set compression to aggressive level'],\n ['kirograph compression off', 'Disable compression hook (tool still available)'],\n ['kirograph exec git status', 'Run git status with compression'],\n ['kirograph exec --level ultra npm test', 'Run tests with ultra compression'],\n ['kirograph exec --raw cargo build', 'Show raw vs compressed comparison'],\n ['kirograph gain --graph', 'Show token savings graph'],\n ['kirograph serve --mcp', 'Start the MCP server'],\n ],\n },\n ];\n\n for (const eg of exampleGroups) {\n console.log(` ${c.dim}${eg.title}${c.reset}`);\n for (const [ex, desc] of eg.examples) {\n console.log(` ${c.violet}$${c.reset} ${c.lavender}${ex}${c.reset}`);\n console.log(` ${c.dim}${desc}${c.reset}`);\n }\n console.log();\n }\n}\n\nexport function register(program: Command): void {\n program.configureHelp({ formatHelp: () => '' });\n program.addHelpText('after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