# Aider

Aider runs in a terminal tab in any [pane](/docs/panes-and-worktrees), on that pane's branch. Pane has no Aider preset and doesn't resume its chat after a restart.

## Install

```bash
python -m pip install aider-install
aider-install
```

Or with pipx: `pipx install aider-chat`.

## Authenticate

Add the API key for your model to your shell profile:

```bash
export OPENAI_API_KEY="sk-..."         # only for OpenAI models
export ANTHROPIC_API_KEY="sk-ant-..."  # only for Anthropic models
```

See [aider.chat/docs/llms.html](https://aider.chat/docs/llms.html) for other providers.

## Launch

Open a terminal with <KeyCombo keys={["⌘", "⌥", "1"]} />, then type `aider`. Or add it as a [custom command](/docs/custom-agents).

<TerminalPreview lines={[
  { type: "command", text: "aider --model sonnet" },
  { type: "output",  text: "" },
  { type: "command", text: "Add dark mode toggle to the settings page" },
  { type: "success", text: "Applied edit to src/settings.tsx" }
]} />

<Toggle title="Useful flags">

| Flag | Description |
|------|-------------|
| `--model <model>` | Choose the AI model |
| `--auto-commits` | Commit after every edit (default on) |
| `--no-auto-commits` | Disable automatic commits |
| `--yes-always` | Auto-accept all confirmations |
| `--restore-chat-history` | Load the previous chat on start |
| `--lint` | Lint and fix the files you're editing |

Full reference: [aider.chat/docs](https://aider.chat/docs)

</Toggle>
