samai-sdk
Production

CLI

Two commands: scaffold a runnable starter project, or serve a trace file as an interactive HTML timeline.

terminal
npx samai-sdk create <directory> [--provider anthropic|openai|groq|ollama]
npx samai-sdk trace <trace-file.json> [--port 4949]

samai-sdk create

Scaffolds a runnable starter project: package.json, tsconfig.json, .env.example, and a src/index.ts with one agent and one tool, wired to whichever provider you picked. Refuses to overwrite an existing directory.

samai-sdk trace

Serves renderTraceHTML()'s output for a saved RunTrace (or a RunResult, which has .trace on it) over a local HTTP server — see Reliability & tracing.

Tested against the real build

The CLI's test runs the actual built dist/cli.js binary and typechecks the generated src/index.ts against the repo's real, built types — not just a check that files exist.