---
title: "Your First Autohand Session"
description: "Install Autohand Code, set up OpenRouter as your AI provider, and complete your first coding task in under five minutes."
sidebar:
  label: "Your First Session"
---

Beginner · 5 min

```bash
autohand "Help me understand this project and suggest improvements"
```

## What you'll learn [#goals]

- How to install Autohand Code on your machine
- How to connect to OpenRouter and pick a model
- How to run your first prompt against a real project
- How to read agent output and continue the conversation

## Before you start

Make sure you have the following tools ready, then prepare a project to work with.

### Requirements

- **Node.js 22 or newer, if you install with npm.** The install script does not need Node.js. Run `node --version` to check. If you need to install or upgrade, visit [nodejs.org](https://nodejs.org).
- **An OpenRouter API key.** Sign up at [openrouter.ai](https://openrouter.ai) and create an API key from your dashboard. OpenRouter is the recommended provider and gives you access to 200+ models with a single key.

### Project setup

Open a terminal and navigate to any existing project you want to explore. A small-to-medium sized codebase is ideal for a first session.

```bash
cd path/to/your-project
```

:::tip
**Tip:** If you do not have a project handy, clone any public GitHub repository you are curious about. Autohand works equally well on unfamiliar codebases.
:::

## Step 1: Install Autohand Code [#step-1]

Install the CLI globally so you can run it from any directory.

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

`npm install -g autohand-cli`

Verify the installation succeeded.

```bash
autohand --version
# autohand 1.x.x
```

## Step 2: Run the onboarding wizard [#step-2]

Navigate to the root of your project and run `autohand` for the first time.

```bash
cd path/to/your-project
autohand
```

The CLI detects that this is a fresh install and launches the onboarding wizard. It walks you through three steps: choosing a provider, entering your API key, and picking a default model.

### Step 1: Choose a provider

The wizard shows a list of supported [AI model providers](/integrations/ai-model-providers). You can pick a cloud provider like OpenRouter, OpenAI, or xAI, or a local provider like Ollama or MLX.

```bash
Welcome to Autohand Code!

? Choose your AI provider:
  > OpenRouter (recommended)
    OpenAI
    xAI Grok
    Cerebras
    Azure AI Foundry
    GCP Vertex AI
    Ollama (local)
    MLX (local, Apple Silicon)
    llama.cpp (local)
```

For this tutorial, select **OpenRouter**. It gives you access to Claude, GPT-4, Gemini, Llama, and 200+ other models through a single API key. See the full [OpenRouter integration guide](/integrations/openrouter) for details.

### Step 2: Enter your API key

The wizard asks for your OpenRouter API key. Paste the key you created during the [before you start](#before-you-start) step.

```bash
? Enter your OpenRouter API key: sk-or-v1-xxxxxxxxxxxx

  Validating key... done
```

Autohand validates the key with a quick API call. If it fails, double-check the key on your [OpenRouter dashboard](https://openrouter.ai/keys).

:::tip
**Tip:** The key is saved as `openrouter.apiKey` in `~/.autohand/config.json`. The CLI does not read an `OPENROUTER_API_KEY` environment variable. To set the key without the wizard, run `autohand config set openrouter.apiKey "sk-or-v1-..."`.
:::

### Step 3: Pick a default model

The wizard shows a short list of recommended models for coding. You can change this later at any time.

```bash
? Choose your default model:
  > anthropic/claude-sonnet-5 (default)
    openrouter/auto
    openai/gpt-4o
    google/gemini-pro-1.5
    meta-llama/llama-3.1-70b
```

Select **anthropic/claude-sonnet-5**, the default OpenRouter model, for coding. OpenRouter bills the use to your OpenRouter account. The configuration is saved to `~/.autohand/config.json` and applies to all future sessions.

```bash
  Provider: OpenRouter
  Model:    anthropic/claude-sonnet-5
  Config:   ~/.autohand/config.json

  Setup complete. Starting session...
```

:::tip
**Tip:** To change your provider or model later, run `autohand config set provider openai` or `autohand config set openrouter.model openai/gpt-4o`, or run `autohand --setup` again. During a session, `/model` opens the model picker.
:::

## Step 3: Start coding [#step-3]

After the wizard finishes, Autohand drops you straight into an interactive session. The agent has access to your project files and is ready to receive instructions.

If you close this session and come back later, just run `autohand` again from your project directory. The wizard only runs once. Every session after that starts immediately.

## Step 4: Run your first prompt [#step-4]

Type the following prompt and press Enter.

```bash
Help me understand this project and suggest improvements
```

Watch as the agent starts working. You will see it read files, explore the directory structure, and build up context before responding. This is normal. The agent is doing the same thing a new developer would do when joining a project.

After a minute or two, the agent outputs a summary. It typically covers what the project does, how it is structured, and a short list of concrete improvement suggestions.

## Step 5: Read the output [#step-5]

The agent output shows you what happened and what it found. Here is what each part means.

- **File reads.** Lines that say `Reading: src/index.ts` show which files the agent examined. The agent uses these to understand your codebase before drawing any conclusions.
- **Analysis.** A plain-language summary of what the project does, what tech stack it uses, and how the pieces fit together.
- **Suggestions.** A numbered list of improvements. These range from small things like missing error handling to larger structural observations. Each suggestion is specific to your code, not generic advice.

:::tip
**Tip:** You do not need to act on every suggestion. The agent is giving you a starting point. Pick the one that looks most useful and continue from there.
:::

## Step 6: Follow up [#step-6]

The real power of Autohand comes from continuing the conversation. You can refine, drill down, or ask the agent to act on its own suggestions.

To implement a suggestion directly, try:

```bash
Now implement the first suggestion
```

To go deeper on a specific part of your code:

```bash
Explain the auth module in more detail
```

To ask about a specific file:

```bash
What does src/services/payment.ts do and are there any risks I should know about?
```

Each follow-up builds on the context already established. You do not need to re-explain the project. The agent remembers everything from earlier in the session.

:::tip
**Tip:** Shorter, more specific prompts usually get better results than long ones. If a response misses the mark, rephrase and try again.
:::

## What you learned [#recap]

- Installed Autohand Code and connected it to OpenRouter
- Ran the onboarding wizard to choose a provider and model
- Ran your first prompt and read the agent's analysis of a project
- Used follow-up prompts to drill deeper into a codebase

### Try next

```bash
autohand "Refactor the largest file in this project into smaller, focused modules"
```

<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." />

### Related tutorials

**[Setting Up a Project with AGENTS.md](/tutorials/setting-up-agents-md)**

Configure your project so Autohand understands your conventions from the start of every session.

**[Using Skills and Slash Commands](/tutorials/using-skills-and-commands)**

Speed up common tasks with built-in commands like /commit and /review-pr.
