---
title: "Autohand Code CLI"
description: "Autohand Code is an AI coding agent that reads repository context, plans changes, edits files, and runs development tools from your terminal. Start an interactive session for supervised work or use command mode for a scoped instruction, then review the diff and validation results."
sidebar:
  label: "Overview"
seo:
  description: "Autohand Code CLI is an autonomous LLM-powered coding agent that runs in your terminal. Understand your codebase, plan changes, and execute them with full agent control."
---

> Autohand Code is a coding agent that runs in your terminal. It turns ideas into working software, debugs problems across your codebase, and runs autonomous development loops with built-in safety controls.

![Autohand Code CLI introduction demo](/assets/autohand-intro-De56OJPs.gif)

## Get started in 30 seconds [#get-started]

**Prerequisites:**

- An [Autohand account](https://autohand.ai) or API key from your preferred provider:
    - [OpenRouter](/integrations/openrouter) - Access 200+ models including Claude, GPT-4, Llama (recommended)
    - [Ollama](/integrations/ollama) - Run models on your own machine
    - [llama.cpp](/integrations/llama-cpp) - Maximum performance with GGUF models
    - [MLX](/integrations/mlx) - Native Apple Silicon acceleration (M1/M2/M3/M4)

**Install Autohand Code CLI:**

**curl (macOS/Linux)**

```bash
curl -fsSL https://autohand.ai/install.sh | sh
```

**Homebrew**

```bash
brew tap autohandai/code && brew install autohand-code
```

**npm**

Requires [Node.js 22 or newer](https://nodejs.org/en/download/):

```bash
npm i -g autohand-cli
```

**Windows**

Open PowerShell and run:

```powershell
iwr -useb https://autohand.ai/install.ps1 | iex
```

**Start a session:**

```bash
cd your-project
autohand
```

You will be prompted to log in on first use. That's it. [Continue with Configuration](/working-with-autohand-code/configuration)

:::tip
Autohand Code CLI tells you when an update is available. Run `autohand update` when you're ready to update. See [uninstall instructions](/working-with-autohand-code/configuration#uninstall) to remove it.
:::

## Quick start

Here are the most common ways to use Autohand Code from the terminal:

```bash
# Start an interactive session
autohand

# Use pipe mode for Unix composability
git diff | autohand 'explain these changes'

# Start with a specific model
autohand --model claude-4-sonnet

# Run in plan mode (read-only exploration first)
autohand --plan

# Auto-mode with safety limits
autohand --automode --max-iterations 10 --max-cost 5

# Enable extended thinking for deep reasoning
autohand --thinking
```

## See work across coding agents [#agent-traces]

Official installers include the separately built `ahtraces` companion. It stays off until you choose a consent mode, then it can build a local Work Map from 19 supported coding agents or sync explicitly selected trace data to Autohand Console.

```bash
autohand --traces-on
ahtraces status
```

Cloud trace sync is included with paid Autohand Code plans, including Team, and does not count against Autohand API usage. Open [Traces in Console](https://console.autohand.ai/traces), follow the [setup tutorial](/tutorials/set-up-agent-traces), or read the complete [Agent traces and Work Map reference](/working-with-autohand-code/agent-traces).

## Modes of operation [#modes]

Autohand Code supports several modes to fit different workflows:

- **Interactive mode** (default) - Start a conversation, give instructions, review changes as they happen.
- **[Pipe mode](/working-with-autohand-code/pipe-mode)** - Feed data via stdin for Unix composability. `echo "explain this" | autohand` outputs structured results to stdout.
- **[Plan mode](/working-with-autohand-code/plan-mode)** - Turn on with /plan, or press Shift+Tab to cycle edit, plan, auto and YOLO modes. The agent explores your codebase with read-only tools first, then executes only after your approval.
- **Auto-mode** - Autonomous development loops where the agent plans, codes, tests, and iterates. Built-in guardrails limit iterations and cost.
- **[YOLO mode](/working-with-autohand-code/yolo-mode)** - Use `--yolo` for granular auto-approve patterns. Skip confirmation prompts for commands you trust.
- **[Headless mode](/working-with-autohand-code/headless-mode)** - For CI/CD pipelines and automation. No interactive prompts, pure programmatic control.

## Key features

- **Agent Teams** - Orchestrate multiple agents working in parallel on different parts of a task. Split large projects across specialized workers.
- **[Skills System](/working-with-autohand-code/skills)** - Modular workflow packages you can install, share, and create. Auto-skill generation turns repeated patterns into reusable skills.
- **[MCP Support](/working-with-autohand-code/mcp-servers)** - Connect external tools, databases, and APIs through the Model Context Protocol.
- **Extended Thinking** - Use `--thinking` for deep reasoning on hard problems. The agent shows its chain of thought before acting.
- **Session History** - Browse and resume past sessions with `/history`. Pick up where you left off.
- **[Context Compaction](/working-with-autohand-code/context-compaction)** - Automatic conversation summarization keeps the agent effective during long sessions.
- **[Custom System Prompts](/working-with-autohand-code/system-prompt)** - Shape agent behavior with `--sys-prompt` and `--append-sys-prompt` for project-specific instructions.
- **[50+ slash commands](/working-with-autohand-code/slash-commands)** - Quick actions for common tasks like `/commit`, `/review`, `/test`, and more.
- **50+ built-in tools** - File editing, search, git operations, web fetch, and more available out of the box.
- **[15+ language localizations](/working-with-autohand-code/localization)** - Use Autohand in your preferred language.
- **IDE detection** - The `/ide` command detects your editor and opens files directly in it.

## See it in action [#feature-demos]

Watch Autohand Code handle real tasks from your terminal. Each demo runs a single command and shows the full agent workflow.

**Auto Mode**

Autonomous development loop: the agent plans, codes, tests, and iterates without manual intervention.

<video src="/assets/autohand-auto-mode-CGNXflQN.mp4" autoPlay loop muted playsInline controls style={{ width: "100%", borderRadius: "var(--blume-radius)" }} />

**Bug Fixing**

Describe a bug or paste an error. The agent finds the root cause and writes a fix across your codebase.

<video src="/assets/autohand-bugfix-DmMOrupb.mp4" autoPlay loop muted playsInline controls style={{ width: "100%", borderRadius: "var(--blume-radius)" }} />

**Code Refactoring**

Restructure, rename, and clean up code while keeping everything working. Multi-file aware.

<video src="/assets/autohand-refactor-DKY8ODy3.mp4" autoPlay loop muted playsInline controls style={{ width: "100%", borderRadius: "var(--blume-radius)" }} />

**Scaffolding**

Generate new components, modules, or entire project structures from a description.

<video src="/assets/autohand-scaffold-BJMrdGai.mp4" autoPlay loop muted playsInline controls style={{ width: "100%", borderRadius: "var(--blume-radius)" }} />

**Code Review**

Get a thorough review of staged changes with suggestions before you commit.

<video src="/assets/autohand-review-DWSEQ2cn.mp4" autoPlay loop muted playsInline controls style={{ width: "100%", borderRadius: "var(--blume-radius)" }} />

**Test Generation**

Generate unit and integration tests that match your project's testing patterns.

<video src="/assets/autohand-tests-Y7d1vdjA.mp4" autoPlay loop muted playsInline controls style={{ width: "100%", borderRadius: "var(--blume-radius)" }} />

**Git Commits**

Analyze your changes and create meaningful commit messages automatically.

<video src="/assets/autohand-commit-DCmIvdhk.mp4" autoPlay loop muted playsInline controls style={{ width: "100%", borderRadius: "var(--blume-radius)" }} />

**Dry Run**

Preview what changes the agent would make without writing anything to disk.

<video src="/assets/autohand-dry-run-5a7BNyDM.mp4" autoPlay loop muted playsInline controls style={{ width: "100%", borderRadius: "var(--blume-radius)" }} />

## What Autohand Code does for you [#what-it-does]

- **Build features from descriptions:** Tell Autohand what you want to build in plain English. It plans, writes the code, and verifies it works.
- **Debug and fix issues:** Describe a bug or paste an error message. Autohand analyzes your codebase, finds the problem, and implements a fix.
- **Navigate any codebase:** Ask anything about your project and get a clear answer. Autohand maintains awareness of your entire project structure and can pull up-to-date information from the web.
- **Automate tedious tasks:** Fix lint issues, resolve merge conflicts, write release notes, and migrate legacy code in a single command from your terminal or automatically in CI.

## Why developers love Autohand Code [#why-developers-love]

- **Works in your terminal:** Not another chat window. Not another IDE. Autohand meets you where you already work, with the tools you already use.
- **Takes action:** Autohand edits files, runs commands, creates commits, and delegates work to agent teams for parallel execution.
- **Unix philosophy:** Composable and scriptable. `tail -f app.log | autohand -p "alert me if you see anomalies"` works. Your CI can run `autohand -p "translate new strings and raise a PR"`.
- **Provider flexibility:** Connect to OpenRouter, Ollama, OpenAI, or run local models with llama.cpp and MLX. Use the provider that fits your needs and budget.

## Detailed documentation [#detailed-docs]

**[Pipe Mode](/working-with-autohand-code/pipe-mode)**

Unix-style composable workflows with structured output

**[Plan Mode](/working-with-autohand-code/plan-mode)**

Read-only exploration before execution

**[YOLO Mode](/working-with-autohand-code/yolo-mode)**

Granular auto-approve patterns for trusted commands

**[Slash Commands](/working-with-autohand-code/slash-commands)**

50+ quick actions for common tasks

**[Skills](/working-with-autohand-code/skills)**

Modular workflow packages and auto-skill generation

**[MCP Servers](/working-with-autohand-code/mcp-servers)**

Connect external tools, databases, and APIs

**[Hooks](/working-with-autohand-code/hooks)**

Lifecycle hooks for custom automation

**[Configuration](/working-with-autohand-code/configuration)**

Set up providers, permissions, and workspace preferences

**[Context Compaction](/working-with-autohand-code/context-compaction)**

Automatic conversation summarization for long sessions

**[System Prompts](/working-with-autohand-code/system-prompt)**

Shape agent behavior with custom instructions

<AcademyCta course="autohand-code-101" title="Autohand Code 101" blurb="Install the CLI, complete a real task, and learn to instruct, supervise and review an agent." />

## Additional resources

**[GitHub](https://github.com/autohand/cli)**

Source code and issue tracker

## Frequently asked questions [#faq]

**What is Autohand Code CLI?**

Autohand Code CLI is a terminal-based autonomous coding agent that understands your full codebase, generates multi-file changes, and runs development loops through natural language commands. It supports over 50 slash commands, agent teams, MCP server integrations, and works with any programming language.

**How do I install Autohand Code CLI?**

Install Autohand Code CLI by running curl -fsSL https://autohand.ai/install.sh | sh on macOS or Linux. Homebrew users can run brew tap autohandai/code && brew install autohand-code. npm users can run npm i -g autohand-cli. Windows users should use the PowerShell installer at autohand.ai/install.ps1.

**What AI models does Autohand Code CLI support?**

Autohand Code CLI works with multiple AI providers including OpenRouter (200+ models), Ollama (local models), OpenAI, llama.cpp (GGUF models), and MLX (Apple Silicon acceleration). Switch providers at any time with the /model command or the --model CLI flag.

**Is Autohand Code CLI free to use?**

Autohand Code CLI is free to install and use. You need an API key from a supported provider like OpenRouter, OpenAI, or Ollama for local models. Costs depend on the model and provider you choose. Local models through Ollama or llama.cpp run entirely on your hardware at no additional cost.
