diff --git a/packages/cli/src/commands/runs.test.ts b/packages/cli/src/commands/runs.test.ts new file mode 100644 index 00000000..4107f455 --- /dev/null +++ b/packages/cli/src/commands/runs.test.ts @@ -0,0 +1,13 @@ +import { describe, expect, it } from 'vitest'; +import { runsCmd } from './runs.js'; + +describe('run command registration', () => { + it('registers cloud run subcommands', () => { + const subcommands = runsCmd.commands.map((command) => command.name()); + + expect(subcommands).toContain('list'); + expect(subcommands).toContain('status'); + expect(subcommands).toContain('logs'); + expect(subcommands).toContain('artifacts'); + }); +}); diff --git a/packages/cli/src/commands/runs.ts b/packages/cli/src/commands/runs.ts index fe67785b..8be6a7a0 100644 --- a/packages/cli/src/commands/runs.ts +++ b/packages/cli/src/commands/runs.ts @@ -46,3 +46,16 @@ runsCmd console.log(kleur.dim(`[stub] run logs · id=${runId} · follow=${!!opts.follow}${target}`)); // TODO: stream NDJSON-over-SSE from /v1/runs/:id/logs. }); + +runsCmd + .command('artifacts ') + .description('List artifacts produced by one cloud run.') + .option('--json', 'emit machine-readable JSON') + .action((runId: string, opts: { json?: boolean }) => { + if (opts.json) { + console.log(JSON.stringify({ id: runId, artifacts: [] }, null, 2)); + return; + } + console.log(kleur.dim(`[stub] run artifacts · id=${runId}`)); + // TODO: GET /v1/runs/:id/artifacts. + });