feat(cli): route runtime commands and add bd diagnostics to status

This commit is contained in:
ZenchantLive 2026-03-02 21:19:12 -08:00
parent 654c8eb4c8
commit 34c2b7f4eb
5 changed files with 78 additions and 3 deletions

View file

@ -0,0 +1,20 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import path from 'node:path';
import { execFile } from 'node:child_process';
import { promisify } from 'node:util';
const execFileAsync = promisify(execFile);
const binPath = path.resolve('bin/beadboard.js');
test('bin routes status --json to launcher runtime command', async () => {
try {
const { stdout } = await execFileAsync(process.execPath, [binPath, 'status', '--json']);
const payload = JSON.parse(stdout);
assert.equal(payload.command, 'status');
} catch (error) {
const stdout = (error as { stdout?: string }).stdout || '';
const payload = stdout ? JSON.parse(stdout) : null;
assert.equal(payload?.command, 'status');
}
});