Rust SDK
The Rust SDK wraps the Autohand CLI in JSON-RPC mode and exposes async, typed APIs for prompts, event streams, permissions, and structured output.
Repository: autohandai/code-agent-sdk-rust. This SDK is in beta while the Agent SDK APIs stabilize. Pin commits or package versions in production.
Requirements
- Rust 1.80 or newer.
- Tokio runtime.
- Autohand CLI installed, authenticated, and configured.
Install
Run your first agent
Start with the high-level agent API when you want the SDK to own the run lifecycle and final result collection.
API shape
- High-level `Agent` and `Run` APIs for application workflows.
- Low-level `AutohandSdk` for direct JSON-RPC control.
- Typed `SdkEvent` helpers for message deltas, tool events, permissions, and errors.
- Structured JSON helpers through `run_json` and `JsonRunOptions`.
Low-level control
Use `AutohandSdk` when your host needs direct access to plan mode, model switching, permission responses, or raw JSON-RPC calls.
Next steps
- Use Quickstart for the cross-language setup flow.
- Open Rust API for the reference surface.
- Read Stream responses in real-time and Handle approvals and user input for shared runtime behavior.