Autohand Code Agent SDK
Embed the Autohand Code runtime inside your own products, tools, and workflows. The SDK gives you the same agent loop that started in the CLI, with structured events and approvals your app can own.
Why we built this
Autohand Code started in the CLI. Teams then asked for editor integrations, so we added ACP and a JSON protocol for external clients. The next request was more direct: teams wanted the agent loop inside product surfaces, internal tools, terminals, dashboards, and deployment flows.
The Code Agent SDK is that embedding layer. Start an agent, stream every event, handle permission requests, and keep session state close to the app that owns the workflow.
Language status
The SDK family now includes the CLI-backed wrappers for TypeScript, Python, Go, Java, Rust, Ruby, C#/.NET, and C++, plus the native Swift SDK.
Ruby
Ruby gem with enumerator streams, Rails-friendly configuration, and JSON helpers.
Read the guideCore workflow
Every CLI-backed SDK page in this section follows the same runtime path.
- Start or create an agent session.
- Send a prompt or prompt params object.
- Stream
message_update,tool_*, andpermission_requestevents. - Reply to approvals when the runtime pauses.
- Wait for the final result or keep the session alive for the next run.
What you get
Stream the runtime
Build terminal UIs, approval flows, logs, and structured automations from typed events instead of scraping plain text output.
Control autonomy
Choose interactive review, restricted execution, or unattended runs, then answer approval requests from your own interface.
Keep context alive
Reuse an agent across prompts, preserve history, and separate planning steps from execution inside the same application flow.
Extend the agent
Use built-in file, shell, git, and search tools, then add MCP or custom tools when your product needs domain-specific actions.
Next steps
Quickstart
Pick a language, install the SDK, and run a first prompt with current package names.
Open quickstartApprovals
Wire the permission flow so your app can pause, ask, allow, or deny cleanly.
Read approvalsLanguage guides
Jump into the language-specific setup and event examples for your runtime.
Start with TypeScript