Skip to main content

Overview

Aider is a Python-based AI coding assistant (aider-chat package) that runs as a terminal CLI with an optional Streamlit web GUI. It provides file editing, shell command execution, web scraping, and git integration through a prompt_toolkit/rich-based REPL.
Installation: pipx install aider-chat
Binary path: ~/.local/bin/aider
Config: ~/.aider/, <git_root>/.aider.conf.yml
Version: 0.86.3.dev (Apache-2.0 license, open source)

Sandbox Profile

The Aider profile (profiles/60-agents/aider.sb) grants access to:

Key Paths

Running Aider in Safehouse

Basic Usage

Shell Function Wrapper

Add to ~/.zshrc:

Authentication

Aider stores credentials in plain files (no keychain):

OAuth Flows

OpenRouter OAuth (browser + localhost callback):
  • Binds HTTP server on localhost:8484-8584
  • Opens browser to https://openrouter.ai/auth
  • Saves key to ~/.aider/oauth-keys.env
GitHub Copilot Token Exchange:
  • Exchanges GITHUB_COPILOT_TOKEN for ephemeral OpenAI key
  • Endpoint: https://api.github.com/copilot_internal/v2/token

Sandbox Considerations

Aider’s OAuth flow requires:
The default sandbox blocks port binding. For OAuth, use --append-profile with a custom policy allowing network-bind.

Capabilities

LLM Tools

Aider provides these capabilities to the LLM:
  1. File editing — Whole file replacement, diff-based edits, search/replace blocks
  2. Shell commands — Via /run and /test (user-invoked, LLM suggests)
  3. Git operations — Auto-commits via GitPython
  4. Web scraping/web command fetches URLs, optionally uses Playwright
  5. Linting/lint runs flake8 or configured linters
  6. Voice input/voice records audio and transcribes via OpenAI Whisper API
Aider’s /run and /test commands execute shell commands with full user privileges. The LLM can suggest commands but cannot execute them autonomously. Always review commands before running.

Subprocess Execution

Aider spawns subprocesses for:

Network Access

Required Endpoints

Disabling Analytics

Special Integrations

Streamlit Web GUI

Aider’s --gui mode launches a Streamlit web server:
Streamlit binds to localhost:8501 (default). The sandbox blocks this by default. For web GUI:

Playwright (Web Scraping)

The /web command can use Playwright for JavaScript-rendered pages:
Playwright downloads Chromium to ~/.cache/ms-playwright/. The sandbox profile does not grant this by default. Add:

Configuration Files

Search Order (Highest Priority First)

  1. --env-file (CLI arg)
  2. ./.env (current directory)
  3. <git_root>/.env
  4. ~/.env
  5. ~/.aider/oauth-keys.env
  1. .aider.conf.yml in CWD
  2. .aider.conf.yml in git root
  3. ~/.aider.conf.yml

Project Files

Security Considerations

Aider has NO built-in sandboxing. All operations run with full user privileges.

Attack Surface

  1. Shell command execution/run and /test commands execute with shell=True
  2. Runtime pip installs — Can download and run arbitrary Python code
  3. Clipboard polling — When --copy-paste enabled, polls every 0.5 seconds
  4. Git operations — Can modify .gitignore, git config, commit history
  5. File access — Unrestricted read/write (advisory .aiderignore)
  6. Network access — Makes requests to 10+ endpoints, arbitrary URLs via /web
  7. Analytics — PostHog enabled by default

Troubleshooting

”Cannot write to ~/.aider/analytics.json”

The sandbox blocks writes outside the workspace. Disable analytics:
Or grant access:

“OAuth callback server failed to bind”

The sandbox blocks port binding. Use API keys instead of OAuth:

“Git operations fail”

Git requires workspace write access: