---
title: "Getting Started with Autohand Code"
description: "Complete guide to installing and using Autohand Code. Learn how to set up your first AI-assisted coding workflow in minutes."
sidebar:
  label: "Getting Started"
seo:
  description: "Complete guide to getting started with Autohand Code. Learn installation, setup, first project, and best practices for AI-assisted coding."
---

:::tip
**Quick Start:** Install Autohand Code in under 5 minutes and start coding with AI assistance. [Jump to installation](#installation) or try our [interactive first session](/getting-started/first-session).
:::

## What is Autohand Code? [#what-is-autohand]

Autohand Code is an AI-powered coding assistant that helps developers write better code faster. It combines advanced AI models with deep understanding of your codebase to provide intelligent suggestions, complete code, and help you solve complex problems.

### Key features

- **Intelligent code completion** - Context-aware suggestions that understand your project
- **Multi-language support** - Works with 50+ programming languages and frameworks
- **IDE integration** - VS Code and Zed, plus JetBrains and other ACP clients through `autohand --acp`
- **CLI tools** - Powerful command-line interface for automation and scripting
- **Team collaboration** - Share knowledge and patterns across your development team

## Installation

Choose the installation method that works best for your workflow:

### Option 1: Install with npm (Recommended)

```bash
# Install Autohand Code globally
npm install -g autohand-cli

# Verify installation
autohand --version
```

### Option 2: Install with curl

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

# Add to PATH (if not automatically added)
export PATH="$HOME/.autohand/bin:$PATH"
```

### Option 3: Download directly

Visit [autohand.ai/downloads](https://autohand.ai/downloads) to download the latest version for your platform:

- Windows (x64)
- macOS (Intel & Apple Silicon)
- Linux (x64, ARM64)

### System requirements

- Node.js 22+ (for npm installation)
- 4GB RAM minimum (8GB recommended)
- 2GB disk space
- Internet connection for AI model access

## First Configuration

After installation, run the initial setup to configure Autohand Code:

```bash
# Run the setup wizard (it also starts on first launch if no provider is configured)
autohand --setup

# The wizard walks you through:
# - AI provider, API key and model
# - Permission mode
# - Preferences
# - Creating an AGENTS.md for the project (optional)
```

### Authentication

To use Autohand Code's AI features, you'll need to authenticate:

```bash
# Sign in with your Autohand account
autohand login

# Or set an API key for your provider (for example OpenRouter)
autohand config set openrouter.apiKey YOUR_API_KEY
```

### IDE Setup

Connect Autohand Code to your editor:

#### VS Code

```bash
# Install from VS Code marketplace
code --install-extension autohandai.vscode-autohand

# Or install from command palette
# Ctrl+Shift+P -> "Extensions: Install Extensions" -> Search "Autohand Code"
```

#### Zed

Add Autohand as a custom external agent in Zed. See the [Zed integration guide](/guides/zed-integration).

#### JetBrains IDEs and other ACP clients

There is no JetBrains plugin. JetBrains IDEs and other ACP clients run Autohand through `autohand --acp`. Add Autohand as a custom ACP agent in AI Assistant by following [JetBrains IDEs through ACP](/working-with-autohand-code/code/jetbrains/getting-started).

## Your First Project [#first-project]

Let's create your first AI-assisted project with Autohand Code:

### Step 1: Create a new project

```bash
# Create a new project directory
mkdir my-first-ai-project
cd my-first-ai-project

# Create an AGENTS.md with project instructions for Autohand Code
autohand init
```

### Step 2: Generate your first code

Open your IDE and create a new file. Type a comment or description and let Autohand Code generate the code:

```js
// Create a simple REST API with Express.js
// Include endpoints for GET, POST, PUT, DELETE users
// Add basic error handling and validation
```

Autohand Code will generate the complete implementation:

```js
const express = require('express');
const app = express();
const port = 3000;

// Middleware
app.use(express.json());
app.use(express.urlencoded({ extended: true }));

// In-memory user storage (for demo)
let users = [
  { id: 1, name: 'John Doe', email: 'john@example.com' },
  { id: 2, name: 'Jane Smith', email: 'jane@example.com' }
];
let nextId = 3;

// GET all users
app.get('/api/users', (req, res) => {
  res.json(users);
});

// GET user by ID
app.get('/api/users/:id', (req, res) => {
  const user = users.find(u => u.id === parseInt(req.params.id));
  if (!user) {
    return res.status(404).json({ error: 'User not found' });
  }
  res.json(user);
});

// POST new user
app.post('/api/users', (req, res) => {
  const { name, email } = req.body;
  
  // Basic validation
  if (!name || !email) {
    return res.status(400).json({ error: 'Name and email are required' });
  }
  
  const newUser = {
    id: nextId++,
    name,
    email
  };
  
  users.push(newUser);
  res.status(201).json(newUser);
});

// PUT update user
app.put('/api/users/:id', (req, res) => {
  const userIndex = users.findIndex(u => u.id === parseInt(req.params.id));
  
  if (userIndex === -1) {
    return res.status(404).json({ error: 'User not found' });
  }
  
  const { name, email } = req.body;
  if (name) users[userIndex].name = name;
  if (email) users[userIndex].email = email;
  
  res.json(users[userIndex]);
});

// DELETE user
app.delete('/api/users/:id', (req, res) => {
  const userIndex = users.findIndex(u => u.id === parseInt(req.params.id));
  
  if (userIndex === -1) {
    return res.status(404).json({ error: 'User not found' });
  }
  
  users.splice(userIndex, 1);
  res.status(204).send();
});

// Error handling middleware
app.use((err, req, res, next) => {
  console.error(err.stack);
  res.status(500).json({ error: 'Something went wrong!' });
});

// 404 handler
app.use((req, res) => {
  res.status(404).json({ error: 'Route not found' });
});

app.listen(port, () => {
  console.log(`Server running at http://localhost:${port}`);
});
```

### Step 3: Test your code

```bash
# Install dependencies
npm init -y
npm install express

# Run your application
node app.js

# Test the API
curl http://localhost:3000/api/users
```

## Essential Commands

Master these core Autohand Code commands to boost your productivity:

### Code Generation

```bash
# Generate code from description
autohand -p "Create a REST API with Express.js in app.js"

# Generate tests for existing code
autohand -p "Write Jest tests for app.js"

# Refactor existing code (preview as a patch first)
autohand -p "Refactor legacy.js to modern ES6+" --patch --output refactor.patch
```

### Project Management

```bash
# Create a new project and an AGENTS.md for it
mkdir my-project && cd my-project
autohand init

# Add a new feature in an isolated git worktree
autohand --worktree auth -p "Add user authentication"

# Or work interactively
autohand
```

### Code Analysis

```bash
# Analyze code quality (read-only plan mode)
autohand -p "Review the code quality of src/" --plan

# Find security issues
autohand -p "Scan src/ for security issues and list them by severity" --plan

# Generate documentation
autohand -p "Write developer documentation for src/ in docs/"
```

## Best Practices for Success [#best-practices]

### Start Small

- Begin with simple code generation tasks
- Use Autohand Code for repetitive boilerplate code
- Gradually move to more complex features

### Provide Clear Context

- Write descriptive comments and requirements
- Include examples of expected output
- Specify coding standards and patterns

### Review and Iterate

- Always review generated code before committing
- Use Autohand Code's suggestions as a starting point
- Iterate on prompts to improve results

### Team Integration

- Share successful prompts with your team
- Establish coding standards for AI-generated code
- Use Autohand Code to maintain consistency across projects

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

## Next Steps

Now that you're set up with Autohand Code, explore these resources to maximize your productivity:

**[Interactive First Session](/getting-started/first-session)**

Step-by-step guided tutorial with hands-on exercises.

_15 min_

**[CLI Reference](/working-with-autohand-code/cli-reference)**

Complete command-line interface documentation.

_20 min_

**[VS Code Integration](/working-with-autohand-code/code/vscode/getting-started)**

Master the VS Code extension features.

_10 min_

**[Writing Effective Prompts](/guides/beginners/instructing-autohand)**

Learn how to communicate effectively with Autohand Code.

_12 min_

## Common Issues & Solutions [#troubleshooting]

### Installation Problems

**Issue: "command not found: autohand"**

**Solution:** Make sure the Autohand Code binary is in your PATH. Add it to your shell configuration:

```bash
# For bash/zsh
echo 'export PATH="$HOME/.autohand/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
```

### Authentication Issues

**Issue: "Authentication failed"**

**Solution:** Check your API key or login credentials. Ensure you have an active subscription:

```bash
# Check the installation, config and account
autohand doctor

# Sign in again
autohand logout
autohand login
```

Inside a session, `/status` shows the current provider, model, API connectivity and account.

### Performance Issues

**Issue: Slow code generation**

**Solution:** Try these optimizations:

- Use a more specific prompt
- Limit the scope of generation
- Check your internet connection
- Consider upgrading to a higher tier for faster models
