Typescript SDK
Install / Import
export QODO_API_KEY=your_api_key_here
# export QODO_BASE_URL=https://api.qodo.ai # optional override// From the main package
import { QodoClient, agent, command, mode, jsonSchema } from '@qodo/command';
// Types only (optional):
// import type { AgentFileObject, CommandConfig, ModeConfig, MCPConfig, OutputSchema } from '@qodo/command';Quick Start (blocking)
const client = new QodoClient({
agentFile: 'agents/example.toml',
model: 'gpt-5.2-high', // optional model override
autoApproveTools: true, // default true
// New: Working directory UX
cwd: '/path/to/project', // default shell/git cwd if tool args omit cwd (auto-derives from agentFile if not provided)
projectRoots: ['/path/to/project', '/path/to/shared-lib'], // allowed roots for filesystem/ripgrep
});
const final = await client.run('build', {
args: { target: 'prod' },
});
// Prefer structured_output, fall back to final_output
console.log(final?.result?.structured_output ?? final?.result?.final_output);
await client.dispose();Streaming (typed event feed)
Defining agents in code (recommended for libraries)
Using agent content strings
Per-call output schema override
Session context and resumability
Working directory and allowed roots
Command and mode selection
Tool approvals
Event reference
Flags and advanced options
Cancellation and cleanup
Concurrency & isolation
Troubleshooting
Last updated