Skip to content

Commit fa173b9

Browse files
Autowebassat-blipAI Worker
andauthored
Add run artifacts command (#724)
Co-authored-by: AI Worker <aiworker@MacBook-Air-de-Isam.local>
1 parent 76f6a83 commit fa173b9

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { describe, expect, it } from 'vitest';
2+
import { runsCmd } from './runs.js';
3+
4+
describe('run command registration', () => {
5+
it('registers cloud run subcommands', () => {
6+
const subcommands = runsCmd.commands.map((command) => command.name());
7+
8+
expect(subcommands).toContain('list');
9+
expect(subcommands).toContain('status');
10+
expect(subcommands).toContain('logs');
11+
expect(subcommands).toContain('artifacts');
12+
});
13+
});

packages/cli/src/commands/runs.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,16 @@ runsCmd
4646
console.log(kleur.dim(`[stub] run logs · id=${runId} · follow=${!!opts.follow}${target}`));
4747
// TODO: stream NDJSON-over-SSE from /v1/runs/:id/logs.
4848
});
49+
50+
runsCmd
51+
.command('artifacts <runId>')
52+
.description('List artifacts produced by one cloud run.')
53+
.option('--json', 'emit machine-readable JSON')
54+
.action((runId: string, opts: { json?: boolean }) => {
55+
if (opts.json) {
56+
console.log(JSON.stringify({ id: runId, artifacts: [] }, null, 2));
57+
return;
58+
}
59+
console.log(kleur.dim(`[stub] run artifacts · id=${runId}`));
60+
// TODO: GET /v1/runs/:id/artifacts.
61+
});

0 commit comments

Comments
 (0)