singularity-forge/packages/rpc-client/examples/basic-usage.ts
Lex Christopherson 2cc7653efb chore: auto-commit after complete-milestone
GSD-Unit: M002-gzq23a
2026-03-26 22:57:10 -06:00

13 lines
433 B
TypeScript

import { RpcClient } from '@gsd-build/rpc-client';
const client = new RpcClient({ cwd: process.cwd() });
await client.start();
const { sessionId } = await client.init({ clientId: 'my-app' });
console.log(`Session: ${sessionId}`);
await client.prompt('Create a hello world script');
for await (const event of client.events()) {
if (event.type === 'execution_complete') break;
console.log(event.type);
}
await client.shutdown();