Skip to content

Commit de60106

Browse files
author
Gemini MB
committed
feat: make check command CI-runnable with JSON output and fixtures
1 parent f5c2c6e commit de60106

2 files changed

Lines changed: 37 additions & 8 deletions

File tree

‎bin/cli.mjs‎

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ function usage() {
4545
console.log(`IDE Agent Kit v${pkg.version}
4646
4747
Usage:
48-
ide-agent-kit check [--config <path>]
48+
ide-agent-kit check [--config <path>] [--json]
4949
Run environment and configuration sanity check.
50-
ide-agent-kit check [--config <path>]
50+
ide-agent-kit check [--config <path>] [--json]
5151
Run environment and configuration sanity check.
5252
ide-agent-kit serve [--config <path>]
5353
Start webhook relay server for inbound GitHub events.
@@ -192,14 +192,24 @@ async function main() {
192192
if (command === 'check') {
193193
const opts = parseKV(args, 'check');
194194
const config = loadConfig(opts.config);
195-
console.log('Running IDE Agent Kit sanity check...\n');
196195
const { runSanityCheck } = await import('../src/common/check.mjs');
197196
const results = await runSanityCheck(config);
198-
results.forEach(r => {
199-
const icon = r.status === 'ok' ? '✅' : (r.status === 'warn' ? '⚠' : '⠌');
200-
console.log(`${icon} ${r.name}: ${r.detail}`);
201-
});
202-
console.log('\nCheck complete.');
197+
198+
if (opts.json) {
199+
console.log(JSON.stringify(results, null, 2));
200+
} else {
201+
console.log('Running IDE Agent Kit sanity check...\n');
202+
results.forEach(r => {
203+
const icon = r.status === 'ok' ? '✅' : (r.status === 'warn' ? '⚠' : '⠌');
204+
console.log(`${icon} ${r.name}: ${r.detail}`);
205+
});
206+
console.log('\nCheck complete.');
207+
}
208+
209+
const hasFailures = results.some(r => r.status === 'fail');
210+
if (hasFailures) {
211+
process.exit(1);
212+
}
203213
return;
204214
}
205215
if (!command || command === '--help' || command === '-h') {

‎test/fixtures/basic-config.json‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"listen": {
3+
"host": "127.0.0.1",
4+
"port": 8787
5+
},
6+
"queue": {
7+
"path": "./test-queue.jsonl"
8+
},
9+
"receipts": {
10+
"path": "./test-receipts.jsonl",
11+
"stdout_tail_lines": 10
12+
},
13+
"poller": {
14+
"rooms": "test-room",
15+
"api_key": "antfarm_test",
16+
"handle": "@testbot",
17+
"interval_sec": 60
18+
}
19+
}

0 commit comments

Comments
 (0)