---
title: "Extend Autohand Code"
source: https://docs.autohand.ai/working-with-autohand-code/extensions/
---

# Extend Autohand Code

Use the Code Agent SDK to embed an agent in your own application, or use a CLI extension to add declarative capabilities and explicitly trusted runtime behavior directly to Autohand Code.

## Two ways to build

| Path | What you build | Best for | Runtime |
|---|---|---|---|
| Code Agent SDK | An application, service, workflow, or product powered by an Autohand agent | Custom interfaces, event streams, approvals, integrations, and application-owned orchestration | Your process controls the agent through a language SDK |
| CLI extension | A portable package of tools, agents, skills, and optional trusted runtime entrypoints | Adding team-specific CLI capabilities, commands, terminal UI, hooks, providers, or policy without changing CLI source | Autohand validates the package; compiled runtime code activates only after explicit trust |

**You can use both.** A service built with the Agent SDK can drive Autohand programmatically, while developers use CLI extensions for the same organization's local repository workflows.

## Choose the Agent SDK when you own the host application

The [Code Agent SDK](/agent-sdk/quickstart.html) is the programmatic integration surface. It is the right choice when your code needs to start and stop an agent, stream events, submit prompts, handle approvals, connect application data, or expose agent behavior through a UI or API.

The SDK documentation covers TypeScript, Python, Go, Java, Swift, Rust, Ruby, C#/.NET, and C++. Your application owns process lifecycle and user experience; the SDK provides the agent runtime contract.

-   Embed a coding agent in an internal developer portal.
-   Trigger repository work from a queue, webhook, scheduled job, or product workflow.
-   Build a custom approval interface or consume structured agent events.
-   Compose tools in application code when declarative shell tools are not enough.

[Open the Agent SDK quickstart →](/agent-sdk/quickstart.html)

## Choose CLI extensions when you want to customize Autohand Code

A CLI extension is a directory containing `autohand.extension.json` plus declared contribution files. The safe layer combines shell-backed meta-tools, Markdown or JSON agents, and portable `SKILL.md` packages without executing package code.

When that is not enough, the same Extension API v1 manifest can declare compiled runtime entrypoints. After review and installation with `--trust`, they can register slash commands, Ink UI, status/help lines, keyboard shortcuts, CLI flags, hooks, providers, and permission policy. Autohand does not transpile TypeScript or install dependencies.

``` bash
autohand extensions validate ./my-extension
autohand extensions install ./my-extension --scope project
autohand extensions show company.my-extension
autohand extensions doctor
```

Installed declarative tools participate in normal filtering, hooks, approval prompts, permission policies, lifecycle events, and accounting. Runtime extensions require an additional `--trust` decision because their code executes inside the Autohand process and is not sandboxed.

[Read the CLI extension lifecycle →](/working-with-autohand-code/extensions/cli-extensions.html)

## Decision checklist

| If you need to… | Start with |
|---|---|
| Add a reusable repository command and reviewer agent to every developer's CLI | CLI extension |
| Build a web or desktop product around streamed agent events | Agent SDK |
| Package existing meta-tools and external agents as one versioned unit | CLI extension |
| Add a slash command, Ink menu, provider, or custom shortcut to Autohand Code | Trusted CLI runtime extension |
| Ship reusable workflow instructions plus extension-owned evidence tools | Declarative CLI extension with an Agent Skill |
| Implement arbitrary application logic, custom storage, or a bespoke UI | Agent SDK |
| Keep Autohand Code barebone and add only approved team capabilities | CLI extension at project scope |
| Offer both a hosted automation and a local developer workflow | Agent SDK plus CLI extensions |

## Where to go next

[

Reference

### CLI extensions

Install, inspect, enable, disable, diagnose, and remove extension packages.

Read the lifecycle](/working-with-autohand-code/extensions/cli-extensions.html)[

### Extension API v1

Learn declarative tools, agents, skills, trusted runtime registrations, configuration, compatibility, and security.

Open the API contract](/working-with-autohand-code/extensions/extension-api.html)[

### Extension guides

Choose an architecture, compose a bare CLI, and plan safe distribution.

Browse guides](/guides/extensions/index.html)[

### Author your first extension

Build, validate, link, exercise, and remove a working tool-and-agent package.

Start the tutorial](/tutorials/extensions/authoring-your-first-extension.html)