LinuxCommandLibrary

aider

Edit code with AI assistance collaboratively

TLDR

Start a new project or work with an existing code base

$ aider --model [model_name] --api-key [your_api_key]
copy

Add new features or test cases to specific files
$ aider [path/to/file1 path/to/file2 ...]
copy

Describe a bug and let aider fix it
$ aider [path/to/file] --describe "[bug_description]"
copy

Refactor code in a specific file
$ aider [path/to/file] --refactor
copy

Update documentation
$ aider [path/to/file] --update-docs
copy

Display help
$ aider --help
copy

SYNOPSIS

aider [--model MODEL] [--openai-api-key KEY] [--message MSG] [FILES_OR_DIRS...]

PARAMETERS

--model, -m MODEL
    LLM model, e.g. gpt-4o, claude-3.5-sonnet

--openai-api-key KEY
    OpenAI API key (or set OPENAI_API_KEY)

--anthropic-api-key KEY
    Anthropic API key (or set ANTHROPIC_API_KEY)

--message, -M MSG
    Initial chat message

--file FILE
    Add file to editing session

--no-auto-commits
    Disable automatic git commits

--dry-run
    Simulate edits without writing files

--verbose, -v
    Increase verbosity

--quiet, -q
    Reduce output

--help
    Show help and exit

--version
    Show version info

--ollama-model MODEL
    Use local Ollama model

--top-p N
    Nucleus sampling parameter (default 0.95)

--temperature N
    Sampling temperature (default 0)

DESCRIPTION

Aider is an open-source command-line tool for pair programming with AI large language models (LLMs) like GPT-4o, Claude, or local models. It lets you describe code changes in natural language via a chat interface, and the AI edits files in your git repository, proposing diffs for review.

Key capabilities include multi-file editing, automatic context gathering from your codebase, git integration for commits, and support for various providers (OpenAI, Anthropic, Ollama). Start with aider file.py, chat about changes, approve edits, and iterate. It excels at refactoring, bug fixes, new features, and tests without leaving the terminal.

Aider maps your repo structure, tracks edits, and avoids hallucinations by grounding in existing code. It's lightweight, privacy-focused (edits stay local except API calls), and works on any git repo. Ideal for developers seeking fast prototyping or assistance on complex tasks. Over 10k GitHub stars reflect its popularity since launch.

CAVEATS

Requires Python 3.9+, git, and API keys/internet for cloud LLMs. Heavy git usage; ensure repo is clean. Edits are AI-generated—always review. Rate limits apply to APIs.

INSTALLATION

pip install aider-chat
Or curl -LsSf https://aider.chat/install.sh | sh
Requires API keys from providers.

BASIC USAGE

aider *.py to edit Python files.
Chat: '/add file.go' to include more.
Type /run test.py to test code.

HISTORY

Created by Paul Gauthier in 2023 as aider-chat on GitHub. Evolved rapidly with LLM releases, adding multi-model support and local inference by 2024. Widely used for its simplicity over VS Code extensions.

SEE ALSO

git(1)

Copied to clipboard