Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/cli/src/commands/runs.test.ts
Original file line number Diff line number Diff line change
@@ -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');
});
});
13 changes: 13 additions & 0 deletions packages/cli/src/commands/runs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <runId>')
.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.
});
Loading