Skip to main content

RPC client examples

Example: Interactive Client (Node.js)

See test/rpc-example.ts for a complete interactive example, or src/modes/rpc/rpc-client.ts for a typed client implementation. examples/rpc-client.ts uses the exported RpcClient to run Atomic in a child process, stream events, and wait for the run to settle. Build the coding-agent package first, then run node examples/rpc-client.ts "Explain this repository" from a repository checkout. RpcClient launches the CLI under Bun by default; pass runtimeExecutable: process.execPath to run it under Node. For a complete example of handling the extension UI protocol, see examples/rpc-extension-ui.ts which pairs with the examples/extensions/rpc-demo.ts extension.