feat: add ECC consult command

This commit is contained in:
Affaan Mustafa
2026-04-30 06:57:53 -04:00
committed by Affaan Mustafa
parent 708a8fd715
commit 9a3f72712b
8 changed files with 603 additions and 0 deletions

View File

@@ -69,6 +69,7 @@ function main() {
assert.match(result.stdout, /list-installed/);
assert.match(result.stdout, /doctor/);
assert.match(result.stdout, /auto-update/);
assert.match(result.stdout, /consult/);
assert.match(result.stdout, /loop-status/);
}],
['delegates explicit install command', () => {
@@ -103,6 +104,13 @@ function main() {
assert.strictEqual(payload.id, 'framework:nextjs');
assert.deepStrictEqual(payload.moduleIds, ['framework-language']);
}],
['delegates consult command', () => {
const result = runCli(['consult', 'security', 'reviews', '--json']);
assert.strictEqual(result.status, 0, result.stderr);
const payload = parseJson(result.stdout);
assert.strictEqual(payload.schemaVersion, 'ecc.consult.v1');
assert.strictEqual(payload.matches[0].componentId, 'capability:security');
}],
['delegates lifecycle commands', () => {
const homeDir = createTempDir('ecc-cli-home-');
const projectRoot = createTempDir('ecc-cli-project-');
@@ -188,6 +196,11 @@ function main() {
assert.strictEqual(result.status, 0, result.stderr);
assert.match(result.stdout, /node scripts\/catalog\.js show <component-id>/);
}],
['supports help for the consult subcommand', () => {
const result = runCli(['help', 'consult']);
assert.strictEqual(result.status, 0, result.stderr);
assert.match(result.stdout, /node scripts\/consult\.js "security reviews"/);
}],
['fails on unknown commands instead of treating them as installs', () => {
const result = runCli(['bogus']);
assert.strictEqual(result.status, 1);