toolgovern-cli 0.1.0
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/cli.d.ts +27 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +176 -0
- package/dist/cli.js.map +1 -0
- package/package.json +35 -0
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* toolgovern-cli -- validate policy files and audit local gate traces without needing the
|
|
4
|
+
* hosted dashboard.
|
|
5
|
+
*
|
|
6
|
+
* toolgovern-cli validate ./toolgovern.policy.yml
|
|
7
|
+
* toolgovern-cli audit ./toolgovern-trace.jsonl --since 24h --decision deny
|
|
8
|
+
*
|
|
9
|
+
* Every command function below returns a `CliResult` (exit code + stdout/stderr text) instead of
|
|
10
|
+
* writing to `process.stdout`/`process.stderr` directly, so the command logic is testable in
|
|
11
|
+
* isolation -- `main()` is the only place that touches the real process streams.
|
|
12
|
+
*/
|
|
13
|
+
export interface CliResult {
|
|
14
|
+
readonly code: number;
|
|
15
|
+
readonly stdout: string;
|
|
16
|
+
readonly stderr: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ParsedFlags {
|
|
19
|
+
readonly positional: readonly string[];
|
|
20
|
+
readonly flags: Readonly<Record<string, string | boolean>>;
|
|
21
|
+
}
|
|
22
|
+
export declare function parseArgs(argv: readonly string[]): ParsedFlags;
|
|
23
|
+
export declare const USAGE: string;
|
|
24
|
+
export declare function validateCommand(policyFile: string | undefined): CliResult;
|
|
25
|
+
export declare function auditCommand(traceFile: string | undefined, flags: ParsedFlags['flags']): Promise<CliResult>;
|
|
26
|
+
export declare function runCommand(argv: readonly string[]): Promise<CliResult>;
|
|
27
|
+
//# sourceMappingURL=cli.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAcH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAC5D;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,WAAW,CAoB9D;AAED,eAAO,MAAM,KAAK,QASN,CAAC;AAEb,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,CAuBzE;AAID,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,GAC1B,OAAO,CAAC,SAAS,CAAC,CA4EpB;AAED,wBAAsB,UAAU,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,CAAC,CAiB5E"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* toolgovern-cli -- validate policy files and audit local gate traces without needing the
|
|
4
|
+
* hosted dashboard.
|
|
5
|
+
*
|
|
6
|
+
* toolgovern-cli validate ./toolgovern.policy.yml
|
|
7
|
+
* toolgovern-cli audit ./toolgovern-trace.jsonl --since 24h --decision deny
|
|
8
|
+
*
|
|
9
|
+
* Every command function below returns a `CliResult` (exit code + stdout/stderr text) instead of
|
|
10
|
+
* writing to `process.stdout`/`process.stderr` directly, so the command logic is testable in
|
|
11
|
+
* isolation -- `main()` is the only place that touches the real process streams.
|
|
12
|
+
*/
|
|
13
|
+
import { readFileSync } from 'node:fs';
|
|
14
|
+
import { pathToFileURL } from 'node:url';
|
|
15
|
+
import { parse as parseYaml } from 'yaml';
|
|
16
|
+
import { validatePolicy, filterTrace, readTrace, verifyChain, } from 'toolgovern';
|
|
17
|
+
export function parseArgs(argv) {
|
|
18
|
+
const positional = [];
|
|
19
|
+
const flags = {};
|
|
20
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
21
|
+
const arg = argv[i];
|
|
22
|
+
if (arg === undefined)
|
|
23
|
+
continue;
|
|
24
|
+
if (arg.startsWith('--')) {
|
|
25
|
+
const key = arg.slice(2);
|
|
26
|
+
const next = argv[i + 1];
|
|
27
|
+
if (next !== undefined && !next.startsWith('--')) {
|
|
28
|
+
flags[key] = next;
|
|
29
|
+
i += 1;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
flags[key] = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
positional.push(arg);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return { positional, flags };
|
|
40
|
+
}
|
|
41
|
+
export const USAGE = [
|
|
42
|
+
'Usage:',
|
|
43
|
+
' toolgovern-cli validate <policy-file>',
|
|
44
|
+
' toolgovern-cli audit <trace-file> [--since <window>] [--decision <allow|deny|require-approval>] [--agent <id>] [--rule <ruleId>] [--verify-chain] [--key-file <path>]',
|
|
45
|
+
'',
|
|
46
|
+
' --key-file Path to the secret key file used to verify hmac-sha256-signed trace entries.',
|
|
47
|
+
' Only needed if the trace was written with a TraceWriter secretKey. Entries',
|
|
48
|
+
' signed with the default unkeyed sha256 scheme verify without it.',
|
|
49
|
+
'',
|
|
50
|
+
].join('\n');
|
|
51
|
+
export function validateCommand(policyFile) {
|
|
52
|
+
if (!policyFile) {
|
|
53
|
+
return { code: 2, stdout: '', stderr: `validate requires a <policy-file> argument.\n${USAGE}` };
|
|
54
|
+
}
|
|
55
|
+
let raw;
|
|
56
|
+
try {
|
|
57
|
+
raw = parseYaml(readFileSync(policyFile, 'utf8'));
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
return {
|
|
61
|
+
code: 1,
|
|
62
|
+
stdout: '',
|
|
63
|
+
stderr: `Failed to read/parse "${policyFile}": ${error.message}\n`,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const result = validatePolicy(raw);
|
|
67
|
+
if (result.valid) {
|
|
68
|
+
return { code: 0, stdout: `OK ${policyFile} is a valid toolgovern policy.\n`, stderr: '' };
|
|
69
|
+
}
|
|
70
|
+
const stderr = [`INVALID ${policyFile}`, ...result.errors.map((e) => ` - ${e}`), ''].join('\n');
|
|
71
|
+
return { code: 1, stdout: '', stderr };
|
|
72
|
+
}
|
|
73
|
+
const VALID_DECISIONS = new Set(['allow', 'deny', 'require-approval']);
|
|
74
|
+
export async function auditCommand(traceFile, flags) {
|
|
75
|
+
if (!traceFile) {
|
|
76
|
+
return { code: 2, stdout: '', stderr: `audit requires a <trace-file> argument.\n${USAGE}` };
|
|
77
|
+
}
|
|
78
|
+
let entries;
|
|
79
|
+
try {
|
|
80
|
+
entries = await readTrace(traceFile);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
return {
|
|
84
|
+
code: 1,
|
|
85
|
+
stdout: '',
|
|
86
|
+
stderr: `Failed to read trace file "${traceFile}": ${error.message}\n`,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
let stdout = '';
|
|
90
|
+
if (flags['verify-chain']) {
|
|
91
|
+
let secretKey;
|
|
92
|
+
if (typeof flags['key-file'] === 'string') {
|
|
93
|
+
try {
|
|
94
|
+
secretKey = readFileSync(flags['key-file']);
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
return {
|
|
98
|
+
code: 1,
|
|
99
|
+
stdout: '',
|
|
100
|
+
stderr: `Failed to read --key-file "${flags['key-file']}": ${error.message}\n`,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const verification = verifyChain(entries, { secretKey });
|
|
105
|
+
if (!verification.valid) {
|
|
106
|
+
const stderr = [
|
|
107
|
+
`CHAIN INVALID ${traceFile}`,
|
|
108
|
+
...verification.issues.map((issue) => ` - ${issue.traceId}: ${issue.reason}`),
|
|
109
|
+
'',
|
|
110
|
+
].join('\n');
|
|
111
|
+
return { code: 1, stdout: '', stderr };
|
|
112
|
+
}
|
|
113
|
+
stdout += `Chain OK -- ${entries.length} entries verified.\n`;
|
|
114
|
+
}
|
|
115
|
+
const decisionFlag = typeof flags.decision === 'string' ? flags.decision : undefined;
|
|
116
|
+
if (decisionFlag && !VALID_DECISIONS.has(decisionFlag)) {
|
|
117
|
+
return {
|
|
118
|
+
code: 2,
|
|
119
|
+
stdout: '',
|
|
120
|
+
stderr: `--decision must be one of: allow, deny, require-approval (got "${decisionFlag}")\n`,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
const query = {
|
|
124
|
+
since: typeof flags.since === 'string' ? flags.since : undefined,
|
|
125
|
+
decision: decisionFlag,
|
|
126
|
+
agentId: typeof flags.agent === 'string' ? flags.agent : undefined,
|
|
127
|
+
ruleId: typeof flags.rule === 'string' ? flags.rule : undefined,
|
|
128
|
+
};
|
|
129
|
+
// filterTrace() throws on a malformed --since value (e.g. an unsupported unit like "1s") --
|
|
130
|
+
// that is a user input-validation error, not an unexpected crash, so it gets the same clean,
|
|
131
|
+
// no-stack-trace treatment as an invalid --decision above (exit code 2), not the generic
|
|
132
|
+
// "Unexpected error" handler in main().
|
|
133
|
+
let filtered;
|
|
134
|
+
try {
|
|
135
|
+
filtered = filterTrace(entries, query);
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
return { code: 2, stdout: '', stderr: `${error.message}\n` };
|
|
139
|
+
}
|
|
140
|
+
for (const entry of filtered) {
|
|
141
|
+
const rules = entry.rule_fired.length > 0 ? entry.rule_fired.join(', ') : '(no rule fired)';
|
|
142
|
+
stdout += `${entry.decision.toUpperCase().padEnd(16)} ${entry.agent_id} -> ${entry.tool} [${rules}] ${entry.timestamp}\n`;
|
|
143
|
+
}
|
|
144
|
+
stdout += `\n${filtered.length} of ${entries.length} trace entries matched.\n`;
|
|
145
|
+
return { code: 0, stdout, stderr: '' };
|
|
146
|
+
}
|
|
147
|
+
export async function runCommand(argv) {
|
|
148
|
+
const [command, ...rest] = argv;
|
|
149
|
+
const { positional, flags } = parseArgs(rest);
|
|
150
|
+
if (!command || command === '--help' || command === '-h') {
|
|
151
|
+
return { code: command ? 0 : 2, stdout: command ? USAGE : '', stderr: command ? '' : USAGE };
|
|
152
|
+
}
|
|
153
|
+
if (command === 'validate') {
|
|
154
|
+
return validateCommand(positional[0]);
|
|
155
|
+
}
|
|
156
|
+
if (command === 'audit') {
|
|
157
|
+
return auditCommand(positional[0], flags);
|
|
158
|
+
}
|
|
159
|
+
return { code: 2, stdout: '', stderr: `Unknown command "${command}".\n${USAGE}` };
|
|
160
|
+
}
|
|
161
|
+
async function main() {
|
|
162
|
+
const result = await runCommand(process.argv.slice(2));
|
|
163
|
+
if (result.stdout)
|
|
164
|
+
process.stdout.write(result.stdout);
|
|
165
|
+
if (result.stderr)
|
|
166
|
+
process.stderr.write(result.stderr);
|
|
167
|
+
process.exitCode = result.code;
|
|
168
|
+
}
|
|
169
|
+
const isMainModule = process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
170
|
+
if (isMainModule) {
|
|
171
|
+
main().catch((error) => {
|
|
172
|
+
process.stderr.write(`Unexpected error: ${error.stack ?? String(error)}\n`);
|
|
173
|
+
process.exitCode = 1;
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,Y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AC;AACL,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "toolgovern-cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI for toolgovern -- validate policy files and audit local gate traces.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/cli.js",
|
|
8
|
+
"types": "./dist/cli.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"toolgovern-cli": "./dist/cli.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/RudrenduPaul/toolgovern.git",
|
|
21
|
+
"directory": "packages/toolgovern-cli"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc -p tsconfig.json",
|
|
25
|
+
"typecheck": "tsc -p tsconfig.json --noEmit --strict",
|
|
26
|
+
"clean": "rm -rf dist"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"toolgovern": "0.1.0",
|
|
30
|
+
"yaml": "^2.6.1"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"typescript": "^5.7.2"
|
|
34
|
+
}
|
|
35
|
+
}
|