diff --git a/packages/diffci-cli/src/client/cli.ts b/packages/diffci-cli/src/client/cli.ts index cf7cef76..c70825a0 100644 --- a/packages/diffci-cli/src/client/cli.ts +++ b/packages/diffci-cli/src/client/cli.ts @@ -12,6 +12,9 @@ * init seed a repository with AI-agent instructions for using DiffCI * mcp run the stdio MCP server * verify fail-closed verification of a working-tree snapshot or commit range + * watch verify changes after each save + * agent-stop verify changes when an AI agent finishes a turn + * telemetry configure anonymous usage reporting * gate run a build's whole gate and record what DiffCI would have skipped (observe) * check analysis plus automatic paired runtime measurement * plan print Core's advisory JSON plan for a commit range (the input check-plan reads) @@ -19,9 +22,13 @@ * red-builds count a repository's red PR builds a check before the push could have prevented * observe analyse the checkout and write an observation report * verify-savings run a paired full-versus-selected timing check + * pilot run observation and verification savings + * pilot-packet generate a shareable compatibility packet * validate-specs block conflicting same-turn change specifications * verify-workflow check that a DiffCI job in this repository's workflows cannot affect other jobs * enforce-misses after a full run on main, find failures enforce mode would have skipped + * coverage build a test coverage map + * outcomes summarize previous verification outcomes * version print the observer version * * Exit codes: `observe` exits 0 even when it refuses or errors, because a broken observer must not @@ -1387,7 +1394,7 @@ Usage: [--redact-paths] [--json] [--quiet] [--fail-on-error] [--timeout-ms ] [--share-usage] diffci plan --base [--head ] [--repo ] diffci check-plan --plan --results - diffci red-builds [--runs ] [--workflow ] [--json ] + diffci red-builds [--runs ] [--workflow ] [--json ] [--check-jobs ] [--ci-only-jobs ] diffci pilot --full [--selected ] [--repo ] [--out-dir ] [--label ] diffci pilot-packet [--repo ] [--out-dir ] [--base --head ] [--label ] [--repository-url ] [--redact-paths] diff --git a/packages/diffci-cli/tests/client/cli-help.test.ts b/packages/diffci-cli/tests/client/cli-help.test.ts new file mode 100644 index 00000000..2254ce63 --- /dev/null +++ b/packages/diffci-cli/tests/client/cli-help.test.ts @@ -0,0 +1,66 @@ +import { strict as assert } from "node:assert"; +import { spawnSync } from "node:child_process"; +import { describe, it } from "node:test"; +import { dirname, join } from "node:path"; +import { fileURLToPath } from "node:url"; + +const ROOT = join(dirname(fileURLToPath(import.meta.url)), "../.."); +const CLI = join(ROOT, "dist-client", "src", "client", "cli.js"); + +// TODO: Update this list whenever a CLI command is added. +const COMMANDS = [ + "check-plan", + "plan", + "red-builds", + "telemetry", + "init", + "mcp", + "verify", + "watch", + "agent-stop", + "check", + "pilot", + "pilot-packet", + "observe", + "verify-savings", + "validate-specs", + "verify-workflow", + "gate", + "enforce-misses", + "coverage", + "outcomes", + "version", +]; + +describe("CLI help", () => { + it("lists every CLI command", () => { + const build = spawnSync( + process.execPath, + [ + join(ROOT, "node_modules", "typescript", "bin", "tsc"), + "-p", + "tsconfig.client.json", + ], + { cwd: ROOT, encoding: "utf8" }, + ); + + assert.ifError(build.error); + assert.equal(build.status, 0, build.stdout + build.stderr); + + const result = spawnSync(process.execPath, [CLI, "help"], { + cwd: ROOT, + encoding: "utf8", + timeout: 60_000, + }); + + assert.ifError(result.error); + assert.equal(result.status, 0, result.stdout + result.stderr); + + for (const command of COMMANDS) { + assert.ok( + result.stdout.includes(`diffci ${command}`), + `Help output is missing command: diffci ${command}`, + ); + } + }); +}); diff --git a/release-files.json b/release-files.json index b723f91a..33e2c373 100644 --- a/release-files.json +++ b/release-files.json @@ -352,6 +352,7 @@ "packages/diffci-cli/src/client/red-builds.ts", "packages/diffci-cli/tests/client/check-plan-cli.test.ts", "packages/diffci-cli/tests/client/plan-cli.test.ts", + "packages/diffci-cli/tests/client/cli-help.test.ts", "packages/diffci-cli/tests/client/check-plan-review.test.ts", "packages/diffci-cli/tests/client/check-plan.test.ts", "packages/diffci-cli/tests/client/red-builds.test.ts",