# .aider.conf.yml — Production Aider Configuration > Drop-in `.aider.conf.yml` template with project Aider settings — auto-test, lint, model split, file ignores. Production-tested from 36K-star community. ## Install Save in your project root: ## Quick Use 1. Copy the YAML below to your repo root as `.aider.conf.yml` 2. Adjust `test-cmd` and `lint-cmd` to your project's commands 3. Run `aider` — config loads automatically --- ## Intro `.aider.conf.yml` is Aider's per-project config file. Set the model, lint command, test command, files to auto-add, files to never touch — once. Aider reads it on every run, so you don't keep retyping flags. Best for: teams standardizing how Aider behaves in a specific repo. Works with: Aider 0.40+. Setup time: 30 seconds. --- ### Drop in this template ```yaml # .aider.conf.yml — checked into your repo root # Model selection (architect/editor split saves tokens) model: claude-3-5-sonnet-20241022 editor-model: claude-3-5-haiku-20241022 weak-model: claude-3-5-haiku-20241022 # Auto-run after each edit auto-test: true test-cmd: "pytest -x --no-cov" lint: true auto-lint: true lint-cmd: - "python: ruff check --fix" - "javascript: eslint --fix" # Repo behavior git: true auto-commits: true attribute-author: true attribute-committer: true gitignore: true # Files read: - README.md - docs/architecture.md - .clinerules file: - src/main.py # Never edit these (secrets, generated, vendored) no-edit: - .env - .env.* - "*.lock" - "package-lock.json" - "yarn.lock" - "src/generated/**" # Cost / speed knobs cache-prompts: true map-tokens: 1024 max-chat-history-tokens: 8000 ``` ### Per-repo overrides Aider also reads `~/.aider.conf.yml` (user-level) and `.aider.conf.yml` (repo-level). Repo overrides win. Useful pattern: user-level sets your default API keys + model preferences; repo-level adds project-specific lint commands and read files. ### Watch mode ```yaml watch-files: true ``` With this set, Aider watches your editor for AI-comment markers (`# AI:` or `// AI:`) and edits the file when you save. Trigger Aider from VS Code or vim without leaving the editor. --- ### FAQ **Q: Where do I put .aider.conf.yml?** A: Repo root works for project-specific config. ~/.aider.conf.yml works for user-wide defaults. Both can coexist — repo-level wins for any setting they both define. **Q: How does no-edit interact with .gitignore?** A: Aider already respects .gitignore by default (the `gitignore: true` flag). no-edit is for additional protected files that ARE in git but you don't want Aider touching — like generated code, lock files, .env templates. **Q: Will the architect/editor split actually save money?** A: Yes — typically 60-80% on long refactors. Architect (Sonnet) plans the change in expensive tokens once; Editor (Haiku, 10x cheaper) applies the actual edits. For small one-line changes the savings are smaller. --- ## Source & Thanks > Pattern derived from [Aider documentation](https://aider.chat/docs/config/options.html). Licensed under Apache-2.0. > > [Aider-AI/aider](https://github.com/Aider-AI/aider) — ⭐ 36,000+ --- ## 快速使用 1. 复制下面的 YAML 到仓库根目录命名 `.aider.conf.yml` 2. 把 `test-cmd` 和 `lint-cmd` 改成你项目的命令 3. 跑 `aider`,配置自动加载 --- ## 简介 `.aider.conf.yml` 是 Aider 的项目级配置文件。一次设好模型、lint 命令、测试命令、自动加入的文件、绝不能动的文件,每次跑 aider 自动读,不用重复打 flag。适合团队标准化 Aider 在某个仓库里的行为。需要 Aider 0.40+。装机时间 30 秒。 --- ### 直接用这份模板 ```yaml # .aider.conf.yml — 提交进仓库根目录 # 模型选择(architect/editor 分离省 token) model: claude-3-5-sonnet-20241022 editor-model: claude-3-5-haiku-20241022 weak-model: claude-3-5-haiku-20241022 # 每次编辑后自动跑 auto-test: true test-cmd: "pytest -x --no-cov" lint: true auto-lint: true lint-cmd: - "python: ruff check --fix" - "javascript: eslint --fix" # 仓库行为 git: true auto-commits: true attribute-author: true attribute-committer: true gitignore: true # 文件 read: - README.md - docs/architecture.md - .clinerules file: - src/main.py # 绝不能编辑(secrets、生成代码、vendored) no-edit: - .env - .env.* - "*.lock" - "package-lock.json" - "yarn.lock" - "src/generated/**" # 成本 / 速度旋钮 cache-prompts: true map-tokens: 1024 max-chat-history-tokens: 8000 ``` ### 按仓库覆盖 Aider 会同时读 `~/.aider.conf.yml`(用户级)和 `.aider.conf.yml`(仓库级)。仓库级覆盖用户级。常用模式:用户级设默认 API key 和模型偏好,仓库级加项目专属 lint 命令和 read 文件。 ### Watch 模式 ```yaml watch-files: true ``` 设上之后,Aider 监听编辑器里的 AI 注释标记(`# AI:` 或 `// AI:`),保存时自动编辑文件。在 VS Code 或 vim 里直接触发 Aider,不用切窗口。 --- ### FAQ **Q: .aider.conf.yml 放哪?** A: 项目专属放仓库根目录。用户级默认放 ~/.aider.conf.yml。两个可以共存 —— 都定义了某个设置时仓库级赢。 **Q: no-edit 跟 .gitignore 啥关系?** A: Aider 默认就尊重 .gitignore(`gitignore: true` flag)。no-edit 是额外的保护:那些已经入了 git 但你不想 Aider 改的文件 —— 比如生成代码、lock 文件、.env 模板。 **Q: architect/editor 分离真能省钱?** A: 能 —— 长重构通常省 60-80%。Architect(Sonnet)用贵 token 规划一次改动;Editor(Haiku,10 倍便宜)执行实际编辑。一行小改动的节省更小。 --- ## 来源与感谢 > Pattern derived from [Aider documentation](https://aider.chat/docs/config/options.html). Licensed under Apache-2.0. > > [Aider-AI/aider](https://github.com/Aider-AI/aider) — ⭐ 36,000+ --- Source: https://tokrepo.com/en/workflows/aider-conf-yml-production-aider-configuration Author: Aider