---
title: "Ruby SDK Code Agent SDK"
source: https://docs.autohand.ai/agent-sdk/ruby
---

# Ruby SDK

The Ruby gem starts the Autohand Code CLI in RPC mode and gives Ruby apps streaming events, run lifecycle helpers, permissions, skills, sessions, hooks, and Rails-friendly configuration.

**Repository:** [autohandai/code-agent-sdk-ruby](https://github.com/autohandai/code-agent-sdk-ruby). This SDK is in beta while the Agent SDK APIs stabilize. Pin commits or package versions in production.

## Requirements

-   Ruby 3.2 or newer.
-   Bundler.
-   Autohand Code CLI installed through \`bundle exec autohand-sdk install-cli\` or supplied with \`cli\_path:\`.

## 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

-   \`AutohandSDK::Agent\` and \`Run\` for host application code.
-   \`AutohandSDK::Client\` for direct session control.
-   Ruby enumerators for streaming message, tool, permission, and error events.
-   Optional Railtie support without making Rails a runtime dependency.

## Rails configuration

When Rails is loaded, configure the SDK in an initializer and keep CLI path and environment overrides explicit.

## Next steps

-   Use [Quickstart](quickstart.html) for the cross-language setup flow.
-   Open [Ruby API](ruby-api.html) for the reference surface.
-   Read [Stream responses in real-time](io/streaming.html) and [Handle approvals and user input](io/approvals.html) for shared runtime behavior.