[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-MatthewZMD--aidermacs":3,"tool-MatthewZMD--aidermacs":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",146793,2,"2026-04-08T23:32:35",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108111,"2026-04-08T11:23:26",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":77,"owner_email":78,"owner_twitter":73,"owner_website":79,"owner_url":80,"languages":81,"stars":86,"forks":87,"last_commit_at":88,"license":89,"difficulty_score":32,"env_os":90,"env_gpu":91,"env_ram":91,"env_deps":92,"category_tags":99,"github_topics":100,"view_count":32,"oss_zip_url":77,"oss_zip_packed_at":77,"status":17,"created_at":109,"updated_at":110,"faqs":111,"releases":142},5794,"MatthewZMD\u002Faidermacs","aidermacs","AI Pair Programming in Emacs with Aider","Aidermacs 是一款专为 Emacs 用户打造的 AI 结对编程工具，它将强大的开源 AI 助手 Aider 无缝集成到经典的 Emacs 编辑环境中。如果你习惯了 Emacs 的高效工作流，却又羡慕 Cursor 等现代编辑器中的智能编码辅助功能，Aidermacs 正是为你而来的解决方案。它让你无需离开熟悉的界面，即可享受大模型带来的代码生成、重构和调试能力。\n\n该工具主要解决了 Emacs 用户在拥抱 AI 编程浪潮时面临的生态割裂问题，避免了在不同编辑器间切换的繁琐。它特别适合习惯使用 Emacs 的软件开发者和极客用户，尤其是那些重视键盘操作效率、追求高度可定制化开发环境的程序员。\n\nAidermacs 的技术亮点在于其深度集成了 Emacs 原生的 Ediff 工具，能够以清晰的对比视图展示 AI 生成的代码变更，方便用户审查与合并。此外，它支持多种 AI 后端模型，提供灵活的上下文内容添加方式，并拥有类似 Transient 的便捷菜单交互设计。无论是配置本地大模型还是连接云端 API，Aidermacs 都能通过简洁的配置快速启动，帮助开发者在保留 Emacs 灵","Aidermacs 是一款专为 Emacs 用户打造的 AI 结对编程工具，它将强大的开源 AI 助手 Aider 无缝集成到经典的 Emacs 编辑环境中。如果你习惯了 Emacs 的高效工作流，却又羡慕 Cursor 等现代编辑器中的智能编码辅助功能，Aidermacs 正是为你而来的解决方案。它让你无需离开熟悉的界面，即可享受大模型带来的代码生成、重构和调试能力。\n\n该工具主要解决了 Emacs 用户在拥抱 AI 编程浪潮时面临的生态割裂问题，避免了在不同编辑器间切换的繁琐。它特别适合习惯使用 Emacs 的软件开发者和极客用户，尤其是那些重视键盘操作效率、追求高度可定制化开发环境的程序员。\n\nAidermacs 的技术亮点在于其深度集成了 Emacs 原生的 Ediff 工具，能够以清晰的对比视图展示 AI 生成的代码变更，方便用户审查与合并。此外，它支持多种 AI 后端模型，提供灵活的上下文内容添加方式，并拥有类似 Transient 的便捷菜单交互设计。无论是配置本地大模型还是连接云端 API，Aidermacs 都能通过简洁的配置快速启动，帮助开发者在保留 Emacs 灵魂的同时，轻松驾驭前沿的 AI 编程体验。","\u003Cp align=\"center\">\n  \u003Cimg style='height: auto; width: 40%; object-fit: contain' src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMatthewZMD_aidermacs_readme_c8d3196a1637.png\">\n\u003C\u002Fp>\n\n# Aidermacs: AI Pair Programming in Emacs\n\n[![MELPA](https:\u002F\u002Fmelpa.org\u002Fpackages\u002Faidermacs-badge.svg)](https:\u002F\u002Fmelpa.org\u002F#\u002Faidermacs)\n[![MELPA Stable](https:\u002F\u002Fstable.melpa.org\u002Fpackages\u002Faidermacs-badge.svg)](https:\u002F\u002Fstable.melpa.org\u002F#\u002Faidermacs)\n[![NonGNU-devel ELPA](https:\u002F\u002Felpa.nongnu.org\u002Fnongnu-devel\u002Faidermacs.svg)](https:\u002F\u002Felpa.nongnu.org\u002Fnongnu-devel\u002Faidermacs.html)\n[![NonGNU ELPA](https:\u002F\u002Felpa.nongnu.org\u002Fnongnu\u002Faidermacs.svg)](https:\u002F\u002Felpa.nongnu.org\u002Fnongnu\u002Faidermacs.html)\n[![EMACS](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FEmacs-26.1-922793?logo=gnu-emacs&logoColor=b39ddb&.svg)](https:\u002F\u002Fwww.gnu.org\u002Fsavannah-checkouts\u002Fgnu\u002Femacs\u002Femacs.html)\n[![LICENSE](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002FMatthewZMD\u002Faidermacs?logo=apache&.svg)](https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fblob\u002Fmain\u002FLICENSE)\n[![CONTRIBUTORS](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fcontributors\u002FMatthewZMD\u002Faidermacs.svg)](https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fgraphs\u002Fcontributors)\n\nAidermacs brings AI-powered development to Emacs by integrating [Aider](https:\u002F\u002Fgithub.com\u002Fpaul-gauthier\u002Faider), one of the most powerful open-source AI pair programming tools. If you're missing [Cursor](https:\u002F\u002Fcursor.sh) but prefer living in Emacs, Aidermacs provides similar AI capabilities while staying true to Emacs workflows.\n\n\u003Cimg style='height: auto; width: 80%; object-fit: contain' src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMatthewZMD_aidermacs_readme_03b87a25b50f.png\">\n\n### Key Features\n\n- Intelligent model selection with multiple backends\n- Built-in Ediff integration for AI-generated changes\n- Enhanced file management from Emacs\n- Great customizability and flexible ways to add content\n\n### Community Speaks\n\nHere's what the community is saying about Aidermacs:\n\n> \"Are you using aidermacs? For me superior to cursor.\" - u\u002Fberenddeboer\n\n> \"This is amazing... every time I upgrade my packages I see your new commits. I feel this the authentic aider for emacs\" - u\u002Fwchmbo\n\n> \"Between Aidermacs and Gptel it's wild how bleeding edge Emacs is with this stuff. My workplace is exploring MCP registries and even clients that are all the rage (E.g Cursor) lag behind what I can do with mcp.el and gptel for tool use.\" - u\u002Fno_good_names_avail\n\n> \"This looks amazing... I have been using ellama with local llms, looks like that will work here too. Great stuff!!\" - u\u002Flugpocalypse\n\n> \"Honestly huge fan of this. Thank you for the updates!\" - u\u002Fieoa\n\n## Quick Start\n\n1. Requirements\n- Emacs ≥ 26.1\n- [Aider](https:\u002F\u002Fgithub.com\u002FAider-AI\u002Faider) or its community fork [Aider Community Experimentation](https:\u002F\u002Fgithub.com\u002Fdwash96\u002Faider-ce).\n- [Transient](https:\u002F\u002Fgithub.com\u002Fmagit\u002Ftransient)\n2. Download Aidermacs through [Melpa](https:\u002F\u002Fmelpa.org\u002F#\u002Faidermacs) or [Non-GNU Elpa](https:\u002F\u002Felpa.nongnu.org\u002Fnongnu\u002Faidermacs.html), or clone manually\n3. Modify this **sample config** and place it in your Emacs `init.el`:\n```emacs-lisp\n(use-package aidermacs\n  :bind ((\"C-c a\" . aidermacs-transient-menu))\n  :config\n  ; Set API_KEY in .bashrc, that will automatically picked up by aider or in elisp\n  (setenv \"ANTHROPIC_API_KEY\" \"sk-...\")\n  ; defun my-get-openrouter-api-key yourself elsewhere for security reasons\n  (setenv \"OPENROUTER_API_KEY\" (my-get-openrouter-api-key))\n  :custom\n  ; See the Configuration section below\n  (aidermacs-default-chat-mode 'architect)\n  (aidermacs-default-model \"sonnet\"))\n```\n4. Open a project and run `M-x aidermacs-transient-menu` or `SPC a a` (or your chosen binding).\n5. Add files and start coding with AI!\n\n### Spacemacs\n\nFor **Spacemacs** users:\n\n1. Add `aidermacs` to your `dotspacemacs-additional-packages` list in your `.spacemacs` file:\n```emacs-lisp\ndotspacemacs-additional-packages '(\n  (aidermacs :variables\n              aidermacs-default-chat-mode 'architect\n              aidermacs-default-model \"sonnet\")\n)\n```\n\n2. Add the keybinding to your `dotspacemacs\u002Fuser-config` function in `.spacemacs`:\n```emacs-lisp\n(defun dotspacemacs\u002Fuser-config ()\n  ;; Set leader key for Aidermacs\n  (spacemacs\u002Fset-leader-keys \"aa\" 'aidermacs-transient-menu) ; Example binding SPC a a\n)\n```\n3. Open a project and run `M-x aidermacs-transient-menu` or `SPC a a` (or your chosen binding).\n4. Add files and start coding with AI!\n\n## Usage\n\n### Getting Started\n\nThe main interface to Aidermacs is through its transient menu system (similar to Magit). Access it with:\n\n```\nM-x aidermacs-transient-menu\n```\n\nOr bind it to a key in your config:\n\n```emacs-lisp\n(global-set-key (kbd \"C-c a\") 'aidermacs-transient-menu)\n```\n\nOnce the transient menu is open, you can navigate and execute commands using the displayed keys. Here's a summary of the main menu structure:\n\n##### Core\n- `a`: Start\u002FOpen Session (auto-detects project root)\n- `.`: Start in Current Directory (good for monorepos)\n- `l`: Clear Chat History\n- `s`: Reset Session\n- `x`: Exit Session\n\n##### Persistent Modes\n- `1`: Code Mode\n- `2`: Chat\u002FAsk Mode\n- `3`: Architect Mode\n- `4`: Help Mode\n\n##### Utilities\n- `^`: Show Last Commit (if auto-commits enabled)\n- `u`: Undo Last Commit (if auto-commits enabled)\n- `R`: Refresh Repo Map\n- `h`: Session History\n- `o`: Change Main Model\n- `v`: Send Voice Command\n- `W`: Fetch Web Content\n- `?`: Aider Meta-level Help\n\n##### File Actions\n- `f`: Add File (C-u: read-only)\n- `F`: Add Current File\n- `d`: Add From Directory (same type)\n- `w`: Add From Window\n- `m`: Add From Dired (marked)\n- `j`: Drop File\n- `J`: Drop Current File\n- `k`: Drop From Dired (marked)\n- `K`: Drop All Files\n- `S`: Create Session Scratchpad\n- `G`: Add File to Session\n- `A`: List Added Files\n\n##### Code Actions\n- `c`: Code Change\n- `e`: Question Code\n- `r`: Architect Change\n- `q`: General Question\n- `p`: Question This Symbol\n- `g`: Accept Proposed Changes\n- `i`: Implement TODO\n- `t`: Write Test\n- `T`: Fix Test\n- `!`: Debug Exception\n\nThe `All File Actions` and `All Code Actions` entries open submenus with more specialized commands. Use the displayed keys to navigate these submenus.\n\n### File Management and AI Interaction\n\nWhen using Aidermacs, you have the flexibility to decide which files the AI should read and edit. Here are some guidelines:\n\n- **Editable Files**: Add files you want the AI to potentially edit. This grants the AI permission to both read and modify these files if necessary.\n- **Read-Only Files**: If you want the AI to read a file without editing it, you can add it as read-only. In Aidermacs, all add file commands can be prefixed with `C-u` to specify read-only access.\n- **Session Scratchpads**: Use the session scratchpads (`S`) to paste notes or documentation that will be fed to the AI as read-only.\n- **External Files**: The \"Add file to session\" (`G`) command allows you to include files outside the current project (or files in `.gitignore`), as Aider doesn't automatically include these files in its context.\n\nThe AI can sometimes determine relevant files on its own, depending on the model and the context of the codebase. However, for precise control, it's often beneficial to manually specify files, especially when dealing with complex projects.\n\nAider encourages a collaborative approach, similar to working with a human co-worker. Sometimes the AI will need explicit guidance, while other times it can infer the necessary context on its own.\n\n### Prompt Files Minor Mode\n\nAidermacs provides a minor mode that makes it easy to work with prompt files and other Aider-related files.\nWhen enabled, the minor mode provides these convenient keybindings:\n\n- `C-c C-n` or `C-\u003Creturn>`: Send line\u002Fregion line-by-line\n- `C-c C-c`: Send block\u002Fregion as whole\n- `C-c C-z`: Switch to Aidermacs buffer\n\nThe minor mode is automatically enabled for:\n- `.aider.prompt.org` files (create with `M-x aidermacs-open-prompt-file`)\n- `.aider.chat.md` files\n- `.aider.chat.history.md` files\n- `.aider.input.history` files\n\n## Configuration\n\n#### Pre-Run Hook\n\nYou can use the `aidermacs-before-run-backend-hook` to run custom setup code before starting the Aider backend. This is particularly useful for:\n\n- Setting environment variables\n- Injecting secrets\n- Performing any other pre-run configuration\n\nExample usage to securely set an OpenAI API key from password-store:\n\n```elisp\n(add-hook 'aidermacs-before-run-backend-hook\n          (lambda ()\n            (setenv \"OPENAI_API_KEY\" (password-store-get \"code\u002Fopenai_api_key\"))))\n```\n\nAn copy of `process-environment` is used when running the hook and starting Aider, ensuring environment variables set in the hook only affect the Aider backend. This approach keeps sensitive information out of your dotfiles while still making it available to Aidermacs.\n\n### Default Model Selection\n\nYou can customize the default AI model used by Aidermacs. The model is determined in the following order of priority:\n\n1.  The value of the Emacs variable `aidermacs-default-model` if you have set it (e.g., via `setq`).\n2.  The value of the `AIDER_MODEL` environment variable, if set.\n3.  A built-in default value (e.g., `\"sonnet\"`).\n\nTo set it in Emacs:\n```emacs-lisp\n(setq aidermacs-default-model \"sonnet\")\n```\n\nThis enables easy switching between different AI models without modifying the `aidermacs-extra-args` variable.\n\n*Note: This configuration will be overwritten by the existence of an `.aider.conf.yml` file (see [details](#Overwrite-Configuration-with-Configuration-File)).*\n\n### Dynamic Model Selection\n\nAidermacs offers intelligent model selection for solo (non-Architect) mode, automatically detecting and integrating with multiple AI providers:\n\n- Automatically fetches available models from supported providers (OpenAI, Anthropic, DeepSeek, Google Gemini, OpenRouter)\n- Caches model lists for quick access\n- Supports both popular pre-configured models and dynamically discovered ones\n- Handles API keys and authentication automatically from your .bashrc\n- Provides model compatibility checking\n\nThe dynamic model selection is only for the solo (non-Architect) mode.\n\nTo change models in solo mode:\n1. Use `M-x aidermacs-change-model` or press `o` in the transient menu\n2. Select from either:\n   - Popular pre-configured models (fast)\n   - Dynamically fetched models from all supported providers (comprehensive)\n\nThe system will automatically filter models to only show ones that are:\n- Supported by your current Aider version\n- Available through your configured API keys\n- Compatible with your current workflow\n\n### Architect Mode - Separating Code Reasoning and Editing Models\n\nAidermacs features an experimental mode using two specialized models for each coding task: an Architect model for reasoning and an Editor model for code generation. This approach has **achieved state-of-the-art (SOTA) results on aider's code editing benchmark**, as detailed in [this blog post](https:\u002F\u002Faider.chat\u002F2024\u002F09\u002F26\u002Farchitect.html).\n\nTo start new sessions in Architect mode by default, set `aidermacs-default-chat-mode` to `'architect`.\n\n`aidermacs-use-architect-mode` is **deprecated** and will be removed in a future release.\n\n`architect` mode will default to using `aidermacs-default-model`. You may also configure the `aidermacs-architect-model` variable to specify the model to use for the Architect role if you prefer a different main model when using `architect` mode.\n\nBy default, the `aidermacs-editor-model` is the same as `aidermacs-default-model`. You only need to set `aidermacs-editor-model` if you want to use a different model for the Editor role. This variable also respects the `AIDER_EDITOR_MODEL` environment variable, following the same priority as `aidermacs-default-model`.\n\n```emacs-lisp\n(setq aidermacs-default-chat-mode 'architect)\n```\n\nYou can switch to it persistently by `M-x aidermacs-switch-to-architect-mode` (`3` in `aidermacs-transient-menu`), or temporarily with `M-x aidermacs-architect-this-code` (`r` in `aidermacs-transient-menu`).\n\nYou can configure each model independently:\n\n```emacs-lisp\n;; Default model used for all modes unless overridden\n(setq aidermacs-default-model \"sonnet\")\n\n;; Optional: Set specific model for architect reasoning\n(setq aidermacs-architect-model \"deepseek\u002Fdeepseek-reasoner\")\n\n;; Optional: Set specific model for code generation\n(setq aidermacs-editor-model \"deepseek\u002Fdeepseek-chat\")\n```\n\nThe model hierarchy works as follows:\n- When Architect mode is enabled:\n    - The Architect model handles high-level reasoning and solution design\n    - The Editor model executes the actual code changes\n- When Architect mode is disabled, only `aidermacs-default-model` is used\n- You can configure specific models or let them automatically use the default model\n\nModels will reflect changes to `aidermacs-default-model` unless they've been explicitly set to a different value.\n\n*Note: These configurations will be overwritten by the existence of an `.aider.conf.yml` file (see [details](#Overwrite-Configuration-with-Configuration-File)).*\n\n### Customize Weak Model\n\nThe Weak model is used for commit messages (if you have `aidermacs-auto-commits` set to `t`) and chat history summarization (default depends on –model). You can customize it using the `aidermacs-weak-model` variable, which also respects the `AIDER_WEAK_MODEL` environment variable.\n\n```emacs-lisp\n;; default to nil\n(setq aidermacs-weak-model \"deepseek\u002Fdeepseek-chat\")\n```\n\nYou can change the Weak model during a session by using `C-u o` (`aidermacs-change-model` with a prefix argument). In most cases, you won't need to change this as Aider will automatically select an appropriate Weak model based on your main model.\n\n*Note: These configurations will be overwritten by the existence of an `.aider.conf.yml` file (see [details](#Overwrite-Configuration-with-Configuration-File)).*\n\n#### Architect Mode Confirmation\n\nBy default, Aidermacs requires explicit confirmation before applying changes proposed in Architect mode. This gives you a chance to review the AI's plan before any code is modified.\n\nIf you prefer to automatically accept all Architect mode changes without confirmation (similar to Aider's default behavior), you can enable this with:\n\n```emacs-lisp\n(setq aidermacs-auto-accept-architect t)\n```\n\n*Note: These configurations will be overwritten by the existence of an `.aider.conf.yml` file (see [details](#Overwrite-Configuration-with-Configuration-File)).*\n\n### Terminal Backend Selection\n\nChoose your preferred terminal backend by setting `aidermacs-backend`:\n\n`vterm` offers better terminal compatibility, while `comint` provides a simple, built-in option that remains fully compatible with Aidermacs.\n\n```emacs-lisp\n;; Use vterm backend (default is comint)\n(setq aidermacs-backend 'vterm)\n```\n\nAvailable backends:\n- `comint` (default): Uses Emacs' built-in terminal emulation\n- `vterm`: Leverages vterm for better terminal compatibility\n\n### Emacs theme support\nThe vterm backend will use the faces defined by your active Emacs theme to set the colors for aider. It tries to guess some reasonable color values based on your themes. In some cases this will not work perfectly; if text is unreadable for you, you can turn this off as follows:\n\n``` emacs-lisp\n;; don't match emacs theme colors\n(setopt aidermacs-vterm-use-theme-colors nil)\n```\n\n### Multiline Input Configuration\n\nYou can customize keybindings for multiline input, this key allows you to enter multiple lines without sending the command to Aider. Press `RET` normally to send the command.\n\n```emacs-lisp\n;; Comint backend:\n(setq aidermacs-comint-multiline-newline-key \"S-\u003Creturn>\")\n;; Vterm backend:\n(setq aidermacs-vterm-multiline-newline-key \"S-\u003Creturn>\")\n```\n\n### Remote File Support with Tramp\n\nAidermacs fully supports working with remote files through Emacs' Tramp mode. This allows you to use Aidermacs on files hosted on remote servers via SSH, Docker, and other protocols supported by Tramp.\n\nWhen working with remote files:\n- File paths are automatically localized for the remote system\n- All Aidermacs features work seamlessly across local and remote files\n- Edits are applied directly to the remote files\n- Diffs and change reviews work as expected\n\nExample usage:\n```emacs-lisp\n;; Open a remote file via SSH\n(find-file \"\u002Fssh:user@remotehost:\u002Fpath\u002Fto\u002Ffile.py\")\n\n;; Start Aidermacs session - it will automatically detect the remote context\nM-x aidermacs-transient-menu\n```\n\n### Prompt Selection and History\n\nAidermacs makes it easy to reuse prompts through:\n\n1. **Prompt History** - Your previously used prompts are saved and can be quickly selected\n2. **Common Prompts** - A curated list of frequently used prompts for common tasks defined in `aidermacs-common-prompts`:\n\nWhen entering a prompt, you can:\n- Select from your history or common prompts using completion\n- Still type custom prompts when needed\n\nThe prompt history and common prompts are available across all sessions.\n\n### File Watching\n\nEnable watching for AI coding instructions in your repository files with `aidermacs-watch-files`:\n\n```emacs-lisp\n;; Enable file watching\n(setq aidermacs-watch-files t)\n```\n\nWhen enabled, Aidermacs will will watch all files in your repo and look for any AI coding instructions you add using your favorite IDE or text editor.\n\nSpecifically, aider looks for one-liner comments (`# ...`, `\u002F\u002F ...` or `-- ...`, regardless of the comment style that language supports) that either start or end with `AI`, `AI!` or `AI?` like these:\n```\n# Make a snake game. AI!\n# What is the purpose of this method AI?\n\n\u002F\u002F Write a protein folding prediction engine. AI!\n```\nAidermacs will take note of all the comments that start or end with `AI`. Comments that include `AI!` with an exclamation point or `AI?` with a question mark are special. They trigger aider to take action to collect all the AI comments and use them as your instructions.\n\n- `AI!` triggers aider to make changes to your code.\n- `AI?` triggers aider to answer your question.\n\n*Note: This feature currently only works in the vterm mode.*\n\n*Note: These configurations will be overwritten by the existence of an `.aider.conf.yml` file (see [details](#Overwrite-Configuration-with-Configuration-File)).*\n\n### Read-Only Files\n\nYou can configure certain files to always be added as read-only when starting any Aidermacs session by setting the `aidermacs-global-read-only-files` and `aidermacs-project-read-only-files`.\n\n```emacs-lisp\n;; Always add these files as read-only to all Aidermacs sessions\n;; For files that exists outside the project directory\n(setq aidermacs-global-read-only-files '(\"~\u002F.aider\u002FAI_RULES.md\"))\n;; For files that exists within the project directory\n(setq aidermacs-project-read-only-files '(\"CONVENTIONS.md\" \"README.md\"))\n```\n\nWhen an Aidermacs session starts, these files will be automatically added as read-only if they exist in the project. This is useful for documentation files or other references that you want the AI to be aware of but not modify.\n\n### Diff and Change Review\n\nControl whether to show diffs for AI-generated changes with `aidermacs-show-diff-after-change`:\n\n```emacs-lisp\n;; Enable\u002Fdisable showing diffs after changes (default: t)\n(setq aidermacs-show-diff-after-change t)\n```\n\nWhen enabled, Aidermacs will:\n- Capture the state of files before AI edits\n- Show diffs using Emacs' built-in ediff interface\n- Allow you to review and accept\u002Freject changes\n\n### Re-Enable Auto-Commits\n\nAider automatically commits AI-generated changes by default. We consider this behavior *very* intrusive, so we've disabled it. You can re-enable auto-commits by setting `aidermacs-auto-commits` to `t`:\n\n```emacs-lisp\n;; Enable auto-commits\n(setq aidermacs-auto-commits t)\n```\n\nWith auto-commits disabled, you must manually commit changes using your preferred Git workflow.\n\n*Note: This configuration will be overwritten by the existence of an `.aider.conf.yml` file (see [details](#Overwrite-Configuration-with-Configuration-File)).*\n\n### Control Buffer Killing on Exit\n\nBy default, when you exit an Aidermacs session using `aidermacs-exit` (or `x` in the transient menu), the Aidermacs buffer remains open. If you prefer the buffer to be automatically killed upon exiting the session, you can customize this behavior:\n\n```emacs-lisp\n;; Kill the Aider buffer when exiting the session\n(setq aidermacs-exit-kills-buffer t)\n```\n\n### Customize Aider Options with `aidermacs-extra-args`\n\nIf these configurations aren't sufficient, the `aidermacs-extra-args` variable enables passing any Aider-supported command-line options.\n\nSee the [Aider configuration documentation](https:\u002F\u002Faider.chat\u002Fdocs\u002Fconfig\u002Foptions.html) for a full list of available options.\n\n```emacs-lisp\n;; Set the verbosity:\n(add-to-list 'aidermacs-extra-args \"--verbose\")\n```\n\nThese arguments will be appended to the Aider command when it is run. Note that the `--model` argument is automatically handled by `aidermacs-default-model` and should not be included in `aidermacs-extra-args`.\n\n### Overwrite Configuration with Configuration File\n\nAidermacs supports project-specific configurations via `.aider.conf.yml` files. To enable this:\n\n1.  Create a `.aider.conf.yml` in your home dir, project's root, or the current directory, defining your desired settings. See the [Aider documentation](https:\u002F\u002Faider.chat\u002Fdocs\u002Fconfig\u002Faider_conf.html) for available options.\n\n2.  Tell Aidermacs to use the config file in one of two ways:\n\n    ```emacs-lisp\n    ;; Set the `aidermacs-config-file` variable in your Emacs config:\n    (setq aidermacs-config-file \"\u002Fpath\u002Fto\u002Fyour\u002Fproject\u002F.aider.conf.yml\")\n    ;; *Or*, include the `--config` or `-c` flag in `aidermacs-extra-args`:\n    (setq aidermacs-extra-args '(\"--config\" \"\u002Fpath\u002Fto\u002Fyour\u002Fproject\u002F.aider.conf.yml\"))\n    ```\n\n*Note: You can also rely on Aider's default behavior of automatically searching for `.aider.conf.yml` in the home directory, project root, or current directory, in that order. In this case, you do not need to set `aidermacs-config-file` or include `--config` in `aidermacs-extra-args`.*\n\n* **Important: Configuration Precedence**\n\nWhen an Aidermacs session starts, it determines which settings to use based on the following hierarchy:\n\n1.  **Aider Configuration File (`.aider.conf.yml`):** If a config file is found (either in a default location or specified via `aidermacs-config-file` or `aidermacs-extra-args`), it takes **highest priority**. Aidermacs will **ignore** its own Emacs variables (like `aidermacs-default-model`) and let the `aider` tool manage settings directly from the file. The precedence is then determined by `aider` itself (where command-line arguments override environment variables, which override the config file).\n\n2.  **Emacs Configuration (if no config file is used):** If no `.aider.conf.yml` is present, Aidermacs will build the command-line arguments for `aider`. The values it uses are determined by this order of priority:\n    a. **Emacs Variables (Highest):** Values you set in your `init.el` (e.g., `(setq aidermacs-default-model \"...\")`).\n    b. **Environment Variables:** If an Emacs variable is not set, its value is taken from the corresponding environment variable (e.g., `AIDER_MODEL`).\n    c. **Built-in Defaults (Lowest):** If neither of the above are set, a hardcoded default is used.\n\n**To avoid conflicts:** When using a `.aider.conf.yml` file, you should define all your settings within that file. Do not set variables like `aidermacs-default-model` in Emacs or pass arguments like `--model` in `aidermacs-extra-args`, as they will be ignored and can cause confusion.\n\n### Claude Sonnet 3.7, 4, 4.5 Thinking Tokens\n\nAider can work with Sonnet 3.7's [new thinking tokens](https:\u002F\u002Fwww.anthropic.com\u002Fnews\u002Fclaude-3-7-sonnet) and newer models in this series. You can now enable and configure thinking tokens more easily using the following methods:\n\n1.  **In-Chat Command:** Use the `\u002Fthink-tokens` command followed by the desired token budget. For example: `\u002Fthink-tokens 8k` or `\u002Fthink-tokens 10000`. Supported formats include `8096`, `8k`, `10.5k`, and `0.5M`.\n\n2.  **Command-Line Argument:** Set the `--thinking-tokens` argument when starting Aidermacs. For example, you can add this to your `aidermacs-extra-args`:\n\n    ```emacs-lisp\n    (setq aidermacs-extra-args '(\"--thinking-tokens\" \"16k\"))\n    ```\n\nThese methods provide a more streamlined way to control thinking tokens without requiring manual configuration of `.aider.model.settings.yml` files.\n\n*Note: If you are using an `.aider.conf.yml` file, you can also set the `thinking_tokens` option there.*\n\n#### Working with Prompt Files\n\nThe `.aider.prompt.org` file is particularly useful for:\n- Storing frequently used prompts\n- Documenting common workflows\n- Quick access to complex instructions\n\nYou can customize which files automatically enable the minor mode by configuring `aidermacs-auto-mode-files`:\n\n```emacs-lisp\n(setq aidermacs-auto-mode-files\n      '(\".aider.prompt.org\"\n        \".aider.chat.md\"\n        \".aider.chat.history.md\"\n        \".aider.input.history\"\n        \"my-custom-aider-file.org\"))  ; Add your own files\n```\n\n\n## FAQ\n\n### Aider?\nPlease check [Aider's FAQ](https:\u002F\u002Faider.chat\u002Fdocs\u002Ffaq.html) for Aider related questions.\n\n### Can I use my own AI models?\nYes! Aidermacs supports any OpenAI-compatible API endpoint. Check Aider documentation on [Ollama](https:\u002F\u002Faider.chat\u002Fdocs\u002Fllms\u002Follama.html) and [LiteLLM](https:\u002F\u002Faider.chat\u002Fdocs\u002Fllms\u002Fother.html).\n\n### Is my code sent to the AI provider?\nYes, the code you add to the session is sent to the AI provider. Be mindful of sensitive code.\n\n### Why aider not support Python 3.13\nAider only support Python 3.12 currently, you can use [uv](https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fuv) install aider:\n\n```bash\nuv tool install --force --python python3.12 aider-chat@latest\n```\n\nIf you encounter a proxy-related [issue](https:\u002F\u002Fgithub.com\u002FAider-AI\u002Faider\u002Fissues\u002F2984) , such as the error indicating that the 'socksio' package is not installed, please use:\n\n```bash\nuv tool install --force --python python3.12 aider-chat@latest --with 'httpx[socks]'\n```\n\nAnd adjust aidermacs program with below config.\n\n```elisp\n(setq aidermacs-program (expand-file-name \"~\u002F.local\u002Fbin\u002Faider\"))\n```\n\n### Local models prefer English, even if the prompt language is different\n\nSome local models in aider may default to English, even if you use a different language in your prompt. To ensure the chat language matches your preference (e.g., Russian), add the following to your Emacs configuration:\n\n```emacs-lisp\n(add-to-list 'aidermacs-extra-args \"--chat-language ru\")\n```\n\nThis will instruct aider to use Russian for chat interactions.\n\n### Aidermacs or Aider ignores command-line arguments and prompts for provider selection when using Ollama\n\nIf the `~\u002F.aider` directory exists (even if empty), Aidermacs or Aider may silently ignore command-line arguments and unexpectedly prompt for provider selection (e.g., forcing OpenRouter), even if your configuration is correct for Ollama or other providers.\n\n**Workaround:**\nRemove the existing aider directory and restart Emacs:\n\n```bash\nrm -rf ~\u002F.aider*\n```\n\nAfter this, Aidermacs should start as expected with your configured provider (e.g., Ollama).\n\n### Aidermacs vs Aider CLI vs aider.el?\n\nAidermacs is designed to provide a more Emacs-native experience while integrating with [Aider CLI](https:\u002F\u002Fgithub.com\u002Fpaul-gauthier\u002Faider). It began as a fork of `aider.el`, but has since diverged significantly to prioritize Emacs workflow integration, built by Emacser, for Emacser.\n\nWhile aider.el tries to mirror Aider's CLI behavior, Aidermacs is built around Emacs-specific features and paradigms. This design philosophy allows you to harness Aider's powerful capabilities through a natural, Emacs-native coding experience.\n\nWith Aidermacs, you get:\n\n1. Built-in Ediff Integration for AI-Generated Changes\n   - Seamless Code Review: Automatically shows diffs for all AI-modified files using Emacs' powerful `ediff` interface\n   - Familiar Interface: Uses Emacs' native `ediff` workflow for reviewing changes\n   - Interactive Workflow: Accept or reject changes with standard `ediff` commands\n   - Syntax Highlighting: Maintains proper syntax highlighting during comparisons\n   - Safe Change Management: Preserves original file states for easy comparison and rollback\n\n2. Intelligent Model Selection\n   - Automatic discovery of available models from multiple providers\n   - Real-time model compatibility checking\n   - Seamless integration with your configured API keys\n   - Caching for quick access to frequently used models\n   - Support for both popular pre-configured models and dynamically discovered ones\n\n3. Flexible Terminal Backend Support\n   - Aidermacs supports multiple terminal backends (comint and vterm) for better compatibility and performance\n   - Easy configuration to choose your preferred terminal emulation\n   - Extensible architecture for adding new backends\n\n4. Smarter Syntax Highlighting\n   - AI-generated code appears with proper syntax highlighting in major languages.\n   - Ensures clarity and readability without additional configuration.\n\n5. Better Support for Multiline Input\n   - Aider is designed as a CLI program, where multiline input is restricted by terminal limitations.\n   - Terminal-based tools require special syntax or manual formatting to handle multiline input, which can be cumbersome and unintuitive.\n   - Aidermacs eliminates these restrictions by handling multiline prompts natively within Emacs, allowing you to compose complex AI requests just like any other text input.\n   - Whether you're pasting blocks of code or refining AI-generated responses, multiline interactions in Aidermacs feel natural and seamless.\n\n6. Enhanced File Management from Emacs\n   - List files currently in chat with `M-x aidermacs-list-added-files`\n   - Drop specific files from chat with `M-x aidermacs-drop-file`\n   - View output history with `M-x aidermacs-show-output-history`\n   - Interactively select files to add with `M-x aidermacs-add-files-interactively`\n   - Add content from any file to a specific session with `M-x aidermacs-add-file-to-session`\n   - Create a temporary file for adding code snippets or notes to the Aider session with `M-x aidermacs-create-session-scratchpad`\n   - Full support for remote files via Tramp (SSH, Docker, etc.)\n   - and more\n\n7. Greater Configurability\n   - Aidermacs offers more customization options to tailor the experience to your preferences.\n\n8. Streamlined Transient Menu Selection\n   - The transient menus have been completely redesigned to encompass functionality and ergonomics, prioritizing user experience.\n\n9. Flexible Ways to Add Content\n   - Aidermacs provides multiple ways to add content to the Aider session, including adding files, creating temporary scratchpad files, and more.\n\n10. Community-Driven Development\n    - Aidermacs is actively developed and maintained by the community, incorporating user feedback and contributions.\n    - We prioritize features and improvements that directly benefit Emacs users, ensuring a tool that evolves with your needs.\n\n... and more to come 🚀\n\n## Video Demo\n\n[\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMatthewZMD_aidermacs_readme_198f773f6acd.jpg\" width=600>](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=fB3-ie6zs4Y)\n\n## Community-Driven Development\n\nAidermacs thrives on community involvement. We believe collaborative development with user and contributor input creates the best software. We encourage you to:\n\n- Contribute Code: Submit pull requests with bug fixes, new features, or improvements to existing functionality.\n- Report Issues: Let us know about any bugs, unexpected behavior, or feature requests through GitHub Issues.\n- Share Ideas: Participate in discussions and propose new ideas for making Aidermacs even better.\n- Improve Documentation: Help us make the documentation clearer, more comprehensive, and easier to use.\n\nYour contributions are essential for making Aidermacs the best AI pair programming tool in Emacs!\n\n\u003Ca href = \"https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg src = \"https:\u002F\u002Fcontrib.rocks\u002Fimage?repo=MatthewZMD\u002Faidermacs\"\u002F>\n\u003C\u002Fa>\n","\u003Cp align=\"center\">\n  \u003Cimg style='height: auto; width: 40%; object-fit: contain' src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMatthewZMD_aidermacs_readme_c8d3196a1637.png\">\n\u003C\u002Fp>\n\n# Aidermacs：在 Emacs 中实现 AI 配对编程\n\n[![MELPA](https:\u002F\u002Fmelpa.org\u002Fpackages\u002Faidermacs-badge.svg)](https:\u002F\u002Fmelpa.org\u002F#\u002Faidermacs)\n[![MELPA Stable](https:\u002F\u002Fstable.melpa.org\u002Fpackages\u002Faidermacs-badge.svg)](https:\u002F\u002Fstable.melpa.org\u002F#\u002Faidermacs)\n[![NonGNU-devel ELPA](https:\u002F\u002Felpa.nongnu.org\u002Fnongnu-devel\u002Faidermacs.svg)](https:\u002F\u002Felpa.nongnu.org\u002Fnongnu-devel\u002Faidermacs.html)\n[![NonGNU ELPA](https:\u002F\u002Felpa.nongnu.org\u002Fnongnu\u002Faidermacs.svg)](https:\u002F\u002Felpa.nongnu.org\u002Fnongnu\u002Faidermacs.html)\n[![EMACS](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FEmacs-26.1-922793?logo=gnu-emacs&logoColor=b39ddb&.svg)](https:\u002F\u002Fwww.gnu.org\u002Fsavannah-checkouts\u002Fgnu\u002Femacs\u002Femacs.html)\n[![LICENSE](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002FMatthewZMD\u002Faidermacs?logo=apache&.svg)](https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fblob\u002Fmain\u002FLICENSE)\n[![CONTRIBUTORS](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fcontributors\u002FMatthewZMD\u002Faidermacs.svg)](https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fgraphs\u002Fcontributors)\n\nAidermacs 通过集成 [Aider](https:\u002F\u002Fgithub.com\u002Fpaul-gauthier\u002Faider)，这款功能最强大的开源 AI 配对编程工具之一，将 AI 驱动的开发引入到 Emacs 中。如果你怀念 [Cursor](https:\u002F\u002Fcursor.sh)，但又更喜欢在 Emacs 中工作，那么 Aidermacs 就能提供类似的 AI 功能，同时保持与 Emacs 工作流一致。\n\n\u003Cimg style='height: auto; width: 80%; object-fit: contain' src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMatthewZMD_aidermacs_readme_03b87a25b50f.png\">\n\n### 核心特性\n\n- 多后端智能模型选择\n- 内置 Ediff 集成，用于处理 AI 生成的更改\n- 从 Emacs 中增强的文件管理功能\n- 极高的可定制性以及灵活的内容添加方式\n\n### 社区评价\n\n以下是社区对 Aidermacs 的评价：\n\n> “你在用 Aidermacs 吗？对我来说比 Cursor 更好。” - u\u002Fberenddeboer\n\n> “太棒了……每次我升级包时，都能看到你的新提交。我觉得这才是真正的 Emacs 版 Aider。” - u\u002Fwchmbo\n\n> “在 Aidermacs 和 Gptel 的加持下，Emacs 在这些前沿技术上的表现真是令人惊叹。我的工作单位正在探索 MCP 注册表，甚至那些炙手可热的工具（如 Cursor）也比不上我用 mcp.el 和 gptel 所能做到的。” - u\u002Fno_good_names_avail\n\n> “看起来太棒了……我一直使用 Ellama 结合本地 LLM，看来这里也能行。太厉害了！！” - u\u002Flugpocalypse\n\n> “说实话，我是这个项目的超级粉丝。感谢你的更新！” - u\u002Fieoa\n\n## 快速入门\n\n1. 系统要求\n- Emacs ≥ 26.1\n- [Aider](https:\u002F\u002Fgithub.com\u002FAider-AI\u002Faider) 或其社区分支 [Aider Community Experimentation](https:\u002F\u002Fgithub.com\u002Fdwash96\u002Faider-ce)。\n- [Transient](https:\u002F\u002Fgithub.com\u002Fmagit\u002Ftransient)\n2. 通过 [Melpa](https:\u002F\u002Fmelpa.org\u002F#\u002Faidermacs) 或 [Non-GNU Elpa](https:\u002F\u002Felpa.nongnu.org\u002Fnongnu\u002Faidermacs.html) 下载 Aidermacs，或者手动克隆\n3. 修改以下**示例配置**并将其放入你的 Emacs `init.el` 文件中：\n```emacs-lisp\n(use-package aidermacs\n  :bind ((\"C-c a\" . aidermacs-transient-menu))\n  :config\n  ; 将 API_KEY 设置在 .bashrc 中，这样它会自动被 Aider 或者 elisp 拾取\n  (setenv \"ANTHROPIC_API_KEY\" \"sk-...\")\n  ; 为安全起见，请自行定义 my-get-openrouter-api-key 函数\n  (setenv \"OPENROUTER_API_KEY\" (my-get-openrouter-api-key))\n  :custom\n  ; 参见下方的配置部分\n  (aidermacs-default-chat-mode 'architect)\n  (aidermacs-default-model \"sonnet\"))\n```\n4. 打开一个项目，然后运行 `M-x aidermacs-transient-menu` 或 `SPC a a`（或你选择的绑定键）。\n5. 添加文件，开始与 AI 一起编码吧！\n\n### Spacemacs\n\n对于 **Spacemacs** 用户：\n\n1. 将 `aidermacs` 添加到你的 `.spacemacs` 文件中的 `dotspacemacs-additional-packages` 列表中：\n```emacs-lisp\ndotspacemacs-additional-packages '(\n  (aidermacs :variables\n              aidermacs-default-chat-mode 'architect\n              aidermacs-default-model \"sonnet\")\n)\n```\n\n2. 在 `.spacemacs` 的 `dotspacemacs\u002Fuser-config` 函数中添加快捷键绑定：\n```emacs-lisp\n(defun dotspacemacs\u002Fuser-config ()\n  ;; 设置 Aidermacs 的 leader 键\n  (spacemacs\u002Fset-leader-keys \"aa\" 'aidermacs-transient-menu) ; 示例绑定 SPC a a\n)\n```\n3. 打开一个项目，然后运行 `M-x aidermacs-transient-menu` 或 `SPC a a`（或你选择的绑定键）。\n4. 添加文件，开始与 AI 一起编码吧！\n\n## 使用方法\n\n### 入门指南\n\nAidermacs 的主要界面是通过其瞬态菜单系统（类似于 Magit）。你可以通过以下命令访问：\n\n```\nM-x aidermacs-transient-menu\n```\n\n或者在你的配置中将其绑定到某个键上：\n\n```emacs-lisp\n(global-set-key (kbd \"C-c a\") 'aidermacs-transient-menu)\n```\n\n一旦瞬态菜单打开，你就可以使用显示的按键来导航和执行命令。以下是主菜单结构的概览：\n\n##### 核心功能\n- `a`: 开始\u002F打开会话（自动检测项目根目录）\n- `.`: 在当前目录开始（适用于 monorepo）\n- `l`: 清除聊天历史\n- `s`: 重置会话\n- `x`: 退出会话\n\n##### 持久模式\n- `1`: 代码模式\n- `2`: 聊天\u002F提问模式\n- `3`: 建筑师模式\n- `4`: 帮助模式\n\n##### 实用工具\n- `^`: 显示最近一次提交（如果启用了自动提交）\n- `u`: 撤销最近一次提交（如果启用了自动提交）\n- `R`: 刷新仓库地图\n- `h`: 会话历史\n- `o`: 更改主模型\n- `v`: 发送语音命令\n- `W`: 获取网页内容\n- `?`: Aider 元级别帮助\n\n##### 文件操作\n- `f`: 添加文件（C-u: 只读）\n- `F`: 添加当前文件\n- `d`: 从目录添加（同类型）\n- `w`: 从窗口添加\n- `m`: 从 Dired 添加（已标记）\n- `j`: 放置文件\n- `J`: 放置当前文件\n- `k`: 从 Dired 放置（已标记）\n- `K`: 放置所有文件\n- `S`: 创建会话草稿本\n- `G`: 将文件添加到会话\n- `A`: 列出已添加的文件\n\n##### 代码操作\n- `c`: 代码更改\n- `e`: 质问代码\n- `r`: 建筑师更改\n- `q`: 一般性问题\n- `p`: 质问当前符号\n- `g`: 接受建议的更改\n- `i`: 实现 TODO\n- `t`: 编写测试\n- `T`: 修复测试\n- `!`: 调试异常\n\n“全部文件操作”和“全部代码操作”条目会打开包含更多专业命令的子菜单。请使用显示的按键来导航这些子菜单。\n\n### 文件管理与 AI 交互\n\n在使用 Aidermacs 时，您可以灵活地决定让 AI 阅读和编辑哪些文件。以下是一些指导原则：\n\n- **可编辑文件**：添加您希望 AI 可能编辑的文件。这将授予 AI 在必要时读取和修改这些文件的权限。\n- **只读文件**：如果您希望 AI 仅读取文件而不进行编辑，可以将其添加为只读文件。在 Aidermacs 中，所有添加文件的命令都可以加上 `C-u` 前缀来指定只读访问权限。\n- **会话草稿板**：使用会话草稿板（`S`）粘贴笔记或文档，这些内容将以只读方式提供给 AI。\n- **外部文件**：通过“将文件添加到会话”（`G`）命令，您可以包含当前项目之外的文件（或 `.gitignore` 中的文件），因为 Aider 不会自动将这些文件纳入其上下文。\n\nAI 有时可以根据模型和代码库的上下文自行确定相关文件。然而，为了实现精确控制，尤其是在处理复杂项目时，手动指定文件通常更为有利。\n\nAider 鼓励采用协作式方法，类似于与人类同事合作的方式。有时 AI 需要明确的指导，而另一些时候它则能够自行推断出必要的上下文。\n\n### Prompt 文件次要模式\n\nAidermacs 提供了一个次要模式，方便您处理 prompt 文件及其他与 Aider 相关的文件。启用该模式后，将提供以下便捷的快捷键绑定：\n\n- `C-c C-n` 或 `C-\u003Creturn>`：逐行发送当前行或选区\n- `C-c C-c`：整体发送块或选区\n- `C-c C-z`：切换到 Aidermacs 缓冲区\n\n该次要模式会自动为以下文件类型启用：\n- `.aider.prompt.org` 文件（可通过 `M-x aidermacs-open-prompt-file` 创建）\n- `.aider.chat.md` 文件\n- `.aider.chat.history.md` 文件\n- `.aider.input.history` 文件\n\n## 配置\n\n#### 运行前钩子\n\n您可以使用 `aidermacs-before-run-backend-hook` 来在启动 Aider 后端之前运行自定义的设置代码。这尤其适用于：\n\n- 设置环境变量\n- 注入密钥\n- 执行其他运行前配置\n\n例如，从密码存储中安全地设置 OpenAI API 密钥：\n\n```elisp\n(add-hook 'aidermacs-before-run-backend-hook\n          (lambda ()\n            (setenv \"OPENAI_API_KEY\" (password-store-get \"code\u002Fopenai_api_key\"))))\n```\n\n在运行钩子并启动 Aider 时，会使用 `process-environment` 的副本，以确保在钩子中设置的环境变量仅影响 Aider 后端。这种方法可以将敏感信息保留在您的 dotfiles 之外，同时仍可供 Aidermacs 使用。\n\n### 默认模型选择\n\n您可以自定义 Aidermacs 使用的默认 AI 模型。模型的选择按以下优先级顺序确定：\n\n1. 如果您已设置 Emacs 变量 `aidermacs-default-model`（例如通过 `setq`），则使用该值。\n2. 如果设置了 `AIDER_MODEL` 环境变量，则使用该值。\n3. 使用内置的默认值（例如 `\"sonnet\"`）。\n\n在 Emacs 中设置默认模型的方法如下：\n\n```emacs-lisp\n(setq aidermacs-default-model \"sonnet\")\n```\n\n这样可以在不修改 `aidermacs-extra-args` 变量的情况下，轻松切换不同的 AI 模型。\n\n*注意：如果存在 `.aider.conf.yml` 文件，此配置将被覆盖（详见 [使用配置文件覆盖配置](#Overwrite-Configuration-with-Configuration-File)）。*\n\n### 动态模型选择\n\nAidermacs 为单人（非 Architect）模式提供了智能的模型选择功能，能够自动检测并集成多个 AI 提供者：\n\n- 自动从支持的提供商（OpenAI、Anthropic、DeepSeek、Google Gemini、OpenRouter）获取可用模型\n- 缓存模型列表以便快速访问\n- 支持流行的预配置模型以及动态发现的模型\n- 自动从您的 `.bashrc` 中处理 API 密钥和身份验证\n- 提供模型兼容性检查\n\n动态模型选择功能仅适用于单人（非 Architect）模式。\n\n要在单人模式下更改模型：\n\n1. 使用 `M-x aidermacs-change-model` 或在瞬态菜单中按 `o`\n2. 从以下选项中选择：\n   - 流行的预配置模型（速度快）\n   - 从所有支持的提供商动态获取的模型（全面）\n\n系统会自动筛选出符合以下条件的模型：\n- 您当前 Aider 版本支持的模型\n- 您已配置的 API 密钥可用的模型\n- 与您当前工作流程兼容的模型\n\n### Architect 模式——分离代码推理与编辑模型\n\nAidermacs 提供一种实验性模式，针对每个编码任务使用两种专门的模型：一个 Architect 模型用于推理，另一个 Editor 模型用于代码生成。这种方法已在 Aider 的代码编辑基准测试中取得了最先进的（SOTA）成果，详情请参阅[这篇博客文章](https:\u002F\u002Faider.chat\u002F2024\u002F09\u002F26\u002Farchitect.html)。\n\n要使新会话默认以 Architect 模式启动，请将 `aidermacs-default-chat-mode` 设置为 `'architect`。\n\n`aidermacs-use-architect-mode` 已被弃用，并将在未来的版本中移除。\n\n`architect` 模式将默认使用 `aidermacs-default-model`。如果您在使用 `architect` 模式时希望使用不同的主模型，也可以配置 `aidermacs-architect-model` 变量来指定 Architect 角色使用的模型。\n\n默认情况下，`aidermacs-editor-model` 与 `aidermacs-default-model` 相同。只有当您希望为 Editor 角色使用不同模型时，才需要设置 `aidermacs-editor-model`。该变量同样会遵循与 `aidermacs-default-model` 相同的优先级规则，尊重 `AIDER_EDITOR_MODEL` 环境变量。\n\n```emacs-lisp\n(setq aidermacs-default-chat-mode 'architect)\n```\n\n您可以通过 `M-x aidermacs-switch-to-architect-mode`（在 `aidermacs-transient-menu` 中按 `3`）永久切换到该模式，或者通过 `M-x aidermacs-architect-this-code`（在 `aidermacs-transient-menu` 中按 `r`）临时切换。\n\n您可以独立配置每个模型：\n\n```emacs-lisp\n;; 默认模型，除非被覆盖\n(setq aidermacs-default-model \"sonnet\")\n\n;; 可选：为 Architect 推理设置特定模型\n(setq aidermacs-architect-model \"deepseek\u002Fdeepseek-reasoner\")\n\n;; 可选：为代码生成设置特定模型\n(setq aidermacs-editor-model \"deepseek\u002Fdeepseek-chat\")\n```\n\n模型层次结构如下：\n\n- 当 Architect 模式启用时：\n    - Architect 模型负责高层次的推理和解决方案设计\n    - Editor 模型执行实际的代码更改\n- 当 Architect 模式禁用时，仅使用 `aidermacs-default-model`\n- 您可以配置特定模型，也可以让它们自动使用默认模型。\n\n模型会反映对 `aidermacs-default-model` 的更改，除非它们已被显式设置为不同的值。\n\n*注意：这些配置将被 `.aider.conf.yml` 文件的存在所覆盖（详见 [使用配置文件覆盖配置](#Overwrite-Configuration-with-Configuration-File)）。*\n\n### 自定义弱模型\n\n弱模型用于提交消息（如果您将 `aidermacs-auto-commits` 设置为 `t`）以及聊天历史摘要（默认值取决于 `--model`）。您可以通过 `aidermacs-weak-model` 变量对其进行自定义，该变量同样会尊重 `AIDER_WEAK_MODEL` 环境变量。\n\n```emacs-lisp\n;; 默认为 nil\n(setq aidermacs-weak-model \"deepseek\u002Fdeepseek-chat\")\n```\n\n您可以在会话期间使用 `C-u o`（带有前缀参数的 `aidermacs-change-model`）来更改弱模型。在大多数情况下，您无需更改此设置，因为 Aider 会根据您的主模型自动选择合适的弱模型。\n\n*注意：这些配置会被 `.aider.conf.yml` 文件的存在所覆盖（详见 [细节](#Overwrite-Configuration-with-Configuration-File)）。*\n\n#### 架构模式确认\n\n默认情况下，Aidermacs 在应用架构模式中提出的更改之前需要明确确认。这使您有机会在任何代码被修改之前审查 AI 的计划。\n\n如果您希望自动接受所有架构模式更改而无需确认（类似于 Aider 的默认行为），可以启用以下设置：\n\n```emacs-lisp\n(setq aidermacs-auto-accept-architect t)\n```\n\n*注意：这些配置会被 `.aider.conf.yml` 文件的存在所覆盖（详见 [细节](#Overwrite-Configuration-with-Configuration-File)）。*\n\n### 终端后端选择\n\n通过设置 `aidermacs-backend` 来选择您偏好的终端后端：\n\n`vterm` 提供更好的终端兼容性，而 `comint` 则提供一个简单、内置的选项，与 Aidermacs 完全兼容。\n\n```emacs-lisp\n;; 使用 vterm 后端（默认为 comint）\n(setq aidermacs-backend 'vterm)\n```\n\n可用的后端：\n- `comint`（默认）：使用 Emacs 内置的终端仿真\n- `vterm`：利用 vterm 提供更好的终端兼容性\n\n### Emacs 主题支持\nvterm 后端会使用您当前激活的 Emacs 主题所定义的 face 来设置 Aider 的颜色。它会尝试根据您的主题猜测一些合理的颜色值。但在某些情况下，这可能无法完美工作；如果文本对您来说难以阅读，您可以按如下方式关闭此功能：\n\n``` emacs-lisp\n;; 不匹配 Emacs 主题颜色\n(setopt aidermacs-vterm-use-theme-colors nil)\n```\n\n### 多行输入配置\n\n您可以自定义多行输入的快捷键，该键允许您输入多行内容而不将命令发送给 Aider。正常按下 `RET` 键即可发送命令。\n\n```emacs-lisp\n;; Comint 后端：\n(setq aidermacs-comint-multiline-newline-key \"S-\u003Creturn>\")\n;; Vterm 后端：\n(setq aidermacs-vterm-multiline-newline-key \"S-\u003Creturn>\")\n```\n\n### 通过 Tramp 支持远程文件\n\nAidermacs 完全支持通过 Emacs 的 Tramp 模式处理远程文件。这使您能够通过 SSH、Docker 以及其他 Tramp 支持的协议，在远程服务器上托管的文件上使用 Aidermacs。\n\n在处理远程文件时：\n- 文件路径会自动本地化到远程系统\n- 所有 Aidermacs 功能在本地和远程文件之间无缝运行\n- 编辑会直接应用于远程文件\n- 差异比较和更改审查按预期进行\n\n使用示例：\n```emacs-lisp\n;; 通过 SSH 打开远程文件\n(find-file \"\u002Fssh:user@remotehost:\u002Fpath\u002Fto\u002Ffile.py\")\n\n;; 启动 Aidermacs 会话 - 它会自动检测远程环境\nM-x aidermacs-transient-menu\n```\n\n### 提示选择与历史记录\n\nAidermacs 使您能够轻松地重复使用提示，方法如下：\n\n1. **提示历史**：您之前使用的提示会被保存，并可快速选择。\n2. **常用提示**：在 `aidermacs-common-prompts` 中定义的一组常用任务提示列表：\n\n在输入提示时，您可以：\n- 使用补全功能从历史记录或常用提示中选择\n- 在需要时仍可输入自定义提示\n\n提示历史和常用提示在所有会话中均可使用。\n\n### 文件监控\n\n通过设置 `aidermacs-watch-files`，您可以启用对仓库中 AI 编码指令的监控：\n\n```emacs-lisp\n;; 启用文件监控\n(setq aidermacs-watch-files t)\n```\n\n启用后，Aidermacs 将监控您仓库中的所有文件，并查找您使用喜爱的 IDE 或文本编辑器添加的任何 AI 编码指令。\n\n具体而言，Aider 会寻找以 `AI`、`AI!` 或 `AI?` 开头或结尾的一行注释（无论语言支持何种注释风格），例如：\n```\n# 制作一个贪吃蛇游戏。AI!\n# 这个方法的目的是什么 AI？\n\n\u002F\u002F 编写一个蛋白质折叠预测引擎。AI!\n```\nAidermacs 会记录所有以 `AI` 开头或结尾的注释。包含感叹号的 `AI!` 或问号的 `AI?` 注释则较为特殊，它们会触发 Aider 收集所有 AI 注释，并将其用作您的指令。\n\n- `AI!` 会触发 Aider 对您的代码进行更改。\n- `AI?` 会触发 Aider 回答您的问题。\n\n*注意：此功能目前仅在 vterm 模式下可用。*\n\n*注意：这些配置会被 `.aider.conf.yml` 文件的存在所覆盖（详见 [细节](#Overwrite-Configuration-with-Configuration-File)）。*\n\n### 只读文件\n\n您可以通过设置 `aidermacs-global-read-only-files` 和 `aidermacs-project-read-only-files`，将某些文件在每次启动 Aidermacs 会话时始终设为只读。\n\n```emacs-lisp\n;; 始终将这些文件作为只读文件添加到所有 Aidermacs 会话中\n;; 对于项目目录之外的文件\n(setq aidermacs-global-read-only-files '(\"~\u002F.aider\u002FAI_RULES.md\"))\n;; 对于项目目录内的文件\n(setq aidermacs-project-read-only-files '(\"CONVENTIONS.md\" \"README.md\"))\n```\n\n当 Aidermacs 会话开始时，如果这些文件存在于项目中，它们将自动被添加为只读文件。这对于您希望 AI 了解但不希望其修改的文档或其他参考资料非常有用。\n\n### 差异与更改审查\n\n通过 `aidermacs-show-diff-after-change` 控制是否显示 AI 生成更改的差异：\n\n```emacs-lisp\n;; 启用\u002F禁用更改后显示差异（默认：t）\n(setq aidermacs-show-diff-after-change t)\n```\n\n启用后，Aidermacs 将：\n- 捕获 AI 编辑之前的文件状态\n- 使用 Emacs 内置的 ediff 界面显示差异\n- 允许您审查并接受\u002F拒绝更改。\n\n### 重新启用自动提交\n\nAider 默认会自动提交 AI 生成的更改。我们认为这种行为 *非常* 干扰，因此已将其禁用。您可以通过将 `aidermacs-auto-commits` 设置为 `t` 来重新启用自动提交：\n\n```emacs-lisp\n;; 启用自动提交\n(setq aidermacs-auto-commits t)\n```\n\n在禁用自动提交的情况下，您必须使用您偏好的 Git 工作流程手动提交更改。\n\n*注意：此配置会被 `.aider.conf.yml` 文件的存在所覆盖（详见 [细节](#Overwrite-Configuration-with-Configuration-File)）。*\n\n### 控制退出时缓冲区的关闭\n\n默认情况下，当你使用 `aidermacs-exit`（或临时菜单中的 `x`）退出 Aidermacs 会话时，Aidermacs 缓冲区会保持打开状态。如果你希望在退出会话时自动关闭该缓冲区，可以通过以下方式自定义行为：\n\n```emacs-lisp\n;; 退出会话时关闭 Aider 缓冲区\n(setq aidermacs-exit-kills-buffer t)\n```\n\n### 使用 `aidermacs-extra-args` 自定义 Aider 选项\n\n如果上述配置仍无法满足需求，`aidermacs-extra-args` 变量允许你传递任何 Aider 支持的命令行选项。\n\n完整的可用选项列表，请参阅 [Aider 配置文档](https:\u002F\u002Faider.chat\u002Fdocs\u002Fconfig\u002Foptions.html)。\n\n```emacs-lisp\n;; 设置日志详细程度：\n(add-to-list 'aidermacs-extra-args \"--verbose\")\n```\n\n这些参数将在运行 Aider 命令时附加到命令行中。请注意，`--model` 参数由 `aidermacs-default-model` 自动处理，不应再添加到 `aidermacs-extra-args` 中。\n\n### 使用配置文件覆盖设置\n\nAidermacs 支持通过 `.aider.conf.yml` 文件进行项目特定的配置。要启用此功能：\n\n1. 在你的主目录、项目根目录或当前目录下创建一个 `.aider.conf.yml` 文件，并定义所需的设置。有关可用选项，请参阅 [Aider 文档](https:\u002F\u002Faider.chat\u002Fdocs\u002Fconfig\u002Faider_conf.html)。\n\n2. 通过以下两种方式之一告知 Aidermacs 使用该配置文件：\n\n    ```emacs-lisp\n    ;; 在 Emacs 配置中设置 `aidermacs-config-file` 变量：\n    (setq aidermacs-config-file \"\u002Fpath\u002Fto\u002Fyour\u002Fproject\u002F.aider.conf.yml\")\n    ;; 或者，在 `aidermacs-extra-args` 中包含 `--config` 或 `-c` 标志：\n    (setq aidermacs-extra-args '(\"--config\" \"\u002Fpath\u002Fto\u002Fyour\u002Fproject\u002F.aider.conf.yml\"))\n    ```\n\n*注意：你也可以依赖 Aider 的默认行为，即按主目录、项目根目录和当前目录的顺序自动搜索 `.aider.conf.yml` 文件。在这种情况下，无需设置 `aidermacs-config-file` 或在 `aidermacs-extra-args` 中包含 `--config`。*\n\n* **重要：配置优先级**\n\n当 Aidermacs 会话启动时，它会根据以下优先级层次确定使用哪些设置：\n\n1.  **Aider 配置文件（`.aider.conf.yml`）：** 如果找到配置文件（无论是在默认位置还是通过 `aidermacs-config-file` 或 `aidermacs-extra-args` 指定），则具有 **最高优先级**。Aidermacs 将 **忽略** 其自身的 Emacs 变量（如 `aidermacs-default-model`），并让 Aider 工具直接从该文件管理设置。随后，优先级由 Aider 自身决定（命令行参数优先于环境变量，而环境变量又优先于配置文件）。\n\n2.  **Emacs 配置（未使用配置文件时）：** 如果没有 `.aider.conf.yml` 文件，Aidermacs 将构建用于 Aider 的命令行参数。其使用的值按照以下优先级顺序确定：\n    a. **Emacs 变量（最高）：** 你在 `init.el` 中设置的值（例如 `(setq aidermacs-default-model \"...\")`）。\n    b. **环境变量：** 如果未设置 Emacs 变量，则采用相应的环境变量值（例如 `AIDER_MODEL`）。\n    c. **内置默认值（最低）：** 如果以上两者均未设置，则使用硬编码的默认值。\n\n**为避免冲突：** 当使用 `.aider.conf.yml` 文件时，应将所有设置都定义在该文件中。不要在 Emacs 中设置类似 `aidermacs-default-model` 的变量，也不要通过 `aidermacs-extra-args` 传递 `--model` 等参数，因为这些都会被忽略，反而可能导致混淆。\n\n### Claude Sonnet 3.7、4、4.5 思考标记\n\nAider 可以与 Sonnet 3.7 的 [新思考标记](https:\u002F\u002Fwww.anthropic.com\u002Fnews\u002Fclaude-3-7-sonnet) 及该系列的更新模型一起使用。现在你可以通过以下方法更轻松地启用和配置思考标记：\n\n1.  **聊天内命令：** 使用 `\u002Fthink-tokens` 命令，后接所需的标记预算。例如：`\u002Fthink-tokens 8k` 或 `\u002Fthink-tokens 10000`。支持的格式包括 `8096`、`8k`、`10.5k` 和 `0.5M`。\n\n2.  **命令行参数：** 在启动 Aidermacs 时设置 `--thinking-tokens` 参数。例如，可以将其添加到你的 `aidermacs-extra-args` 中：\n\n    ```emacs-lisp\n    (setq aidermacs-extra-args '(\"--thinking-tokens\" \"16k\"))\n    ```\n\n这些方法提供了一种更为简便的方式，无需手动配置 `.aider.model.settings.yml` 文件即可控制思考标记。\n\n*注意：如果你正在使用 `.aider.conf.yml` 文件，也可以在那里设置 `thinking_tokens` 选项。*\n\n#### 使用提示文件\n\n`.aider.prompt.org` 文件特别适用于：\n- 存储常用提示\n- 记录常见工作流程\n- 快速访问复杂指令\n\n你可以通过配置 `aidermacs-auto-mode-files` 来自定义哪些文件会自动启用该次要模式：\n\n```emacs-lisp\n(setq aidermacs-auto-mode-files\n      '(\".aider.prompt.org\"\n        \".aider.chat.md\"\n        \".aider.chat.history.md\"\n        \".aider.input.history\"\n        \"my-custom-aider-file.org\"))  \u002F\u002F 添加你自己的文件\n```\n\n\n## 常见问题解答\n\n### Aider 是什么？\n有关 Aider 的相关问题，请查看 [Aider 的常见问题解答](https:\u002F\u002Faider.chat\u002Fdocs\u002Ffaq.html)。\n\n### 我可以使用自己的 AI 模型吗？\n可以！Aidermacs 支持任何兼容 OpenAI API 的端点。请参阅 Aider 关于 [Ollama](https:\u002F\u002Faider.chat\u002Fdocs\u002Fllms\u002Follama.html) 和 [LiteLLM](https:\u002F\u002Faider.chat\u002Fdocs\u002Fllms\u002Fother.html) 的文档。\n\n### 我的代码会被发送给 AI 提供商吗？\n是的，你添加到会话中的代码会被发送给 AI 提供商。请务必注意敏感代码。\n\n### 为什么 Aider 不支持 Python 3.13？\n目前 Aider 仅支持 Python 3.12。你可以使用 [uv](https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fuv) 安装 Aider：\n\n```bash\nuv tool install --force --python python3.12 aider-chat@latest\n```\n\n如果你遇到与代理相关的 [问题](https:\u002F\u002Fgithub.com\u002FAider-AI\u002Faider\u002Fissues\u002F2984)，例如提示未安装 `socksio` 包的错误，请使用以下命令：\n\n```bash\nuv tool install --force --python python3.12 aider-chat@latest --with 'httpx[socks]'\n```\n\n并相应地调整 Aidermacs 程序路径：\n\n```elisp\n(setq aidermacs-program (expand-file-name \"~\u002F.local\u002Fbin\u002Faider\"))\n```\n\n### 本地模型偏好英语，即使提示语言不同\n\n某些本地模型在 Aider 中可能会默认使用英语，即便你在提示中使用了其他语言。为确保聊天语言符合你的偏好（例如俄语），请在 Emacs 配置中添加以下内容：\n\n```emacs-lisp\n(add-to-list 'aidermacs-extra-args \"--chat-language ru\")\n```\n\n这将指示 Aider 使用俄语进行对话交互。\n\n### Aidermacs 或 Aider 在使用 Ollama 时会忽略命令行参数并提示选择提供商\n\n如果 `~\u002F.aider` 目录存在（即使为空），Aidermacs 或 Aider 可能会静默地忽略命令行参数，并意外提示选择提供商（例如强制使用 OpenRouter），即便你的配置已正确设置为 Ollama 或其他提供商。\n\n**解决方法：**\n删除现有的 `aider` 目录并重启 Emacs：\n\n```bash\nrm -rf ~\u002F.aider*\n```\n\n执行此操作后，Aidermacs 应该会按照预期使用你配置的提供商（例如 Ollama）启动。\n\n### Aidermacs、Aider CLI 和 aider.el 有何不同？\n\nAidermacs 的设计旨在提供更原生的 Emacs 使用体验，同时与 [Aider CLI](https:\u002F\u002Fgithub.com\u002Fpaul-gauthier\u002Faider) 集成。它最初是 `aider.el` 的一个分支，但后来为了优先考虑与 Emacs 工作流的集成而发生了显著分化，由 Emacs 用户为 Emacs 用户打造。\n\n虽然 `aider.el` 试图模仿 Aider CLI 的行为，但 Aidermacs 则围绕 Emacs 特有的功能和范式构建。这种设计理念使你能够通过自然、原生的 Emacs 编程体验来充分利用 Aider 的强大功能。\n\n使用 Aidermacs，你可以获得以下优势：\n\n1. 内置 Ediff 集成，用于查看 AI 生成的更改\n   - 无缝代码审查：自动使用 Emacs 强大的 `ediff` 界面显示所有由 AI 修改的文件差异。\n   - 熟悉的界面：采用 Emacs 原生的 `ediff` 工作流程进行变更审查。\n   - 交互式工作流：使用标准的 `ediff` 命令接受或拒绝更改。\n   - 语法高亮：在比较过程中保持正确的语法高亮显示。\n   - 安全的变更管理：保留原始文件状态，便于比较和回滚。\n\n2. 智能模型选择\n   - 自动发现来自多个提供商的可用模型。\n   - 实时检查模型兼容性。\n   - 无缝集成到你配置的 API 密钥中。\n   - 缓存常用模型以实现快速访问。\n   - 支持流行的预配置模型以及动态发现的模型。\n\n3. 灵活的终端后端支持\n   - Aidermacs 支持多种终端后端（comint 和 vterm），以提高兼容性和性能。\n   - 轻松配置以选择你喜欢的终端模拟器。\n   - 具有可扩展架构，可添加新的后端。\n\n4. 更智能的语法高亮\n   - AI 生成的代码在主流语言中会显示正确的语法高亮。\n   - 无需额外配置即可确保清晰度和可读性。\n\n5. 更好地支持多行输入\n   - Aider 是一款基于命令行的程序，其多行输入受限于终端的能力。\n   - 基于终端的工具需要特殊的语法或手动格式化才能处理多行输入，这往往繁琐且不直观。\n   - Aidermacs 通过在 Emacs 内部原生处理多行提示，消除了这些限制，让你可以像输入普通文本一样轻松撰写复杂的 AI 请求。\n   - 无论是粘贴代码块还是优化 AI 生成的回复，Aidermacs 中的多行交互都显得自然流畅。\n\n6. 从 Emacs 提升文件管理能力\n   - 使用 `M-x aidermacs-list-added-files` 列出当前聊天中的文件。\n   - 使用 `M-x aidermacs-drop-file` 从聊天中移除特定文件。\n   - 使用 `M-x aidermacs-show-output-history` 查看输出历史。\n   - 使用 `M-x aidermacs-add-files-interactively` 交互式选择要添加的文件。\n   - 使用 `M-x aidermacs-add-file-to-session` 将任意文件的内容添加到特定会话中。\n   - 使用 `M-x aidermacs-create-session-scratchpad` 创建临时文件，用于向 Aider 会话添加代码片段或笔记。\n   - 完全支持通过 Tramp 访问远程文件（SSH、Docker 等）。\n   - 以及更多功能。\n\n7. 更高的可配置性\n   - Aidermacs 提供更多自定义选项，以根据你的偏好调整使用体验。\n\n8. 精简的瞬态菜单选择\n   - 瞬态菜单经过全新设计，兼顾功能性和易用性，优先考虑用户体验。\n\n9. 多种灵活的内容添加方式\n   - Aidermacs 提供多种方式将内容添加到 Aider 会话中，包括添加文件、创建临时草稿文件等。\n\n10. 社区驱动的开发\n    - Aidermacs 由社区积极开发和维护，不断吸纳用户反馈和贡献。\n    - 我们优先考虑那些直接惠及 Emacs 用户的功能和改进，确保工具能够随着你的需求不断发展。\n\n……未来还将带来更多新特性 🚀\n\n## 视频演示\n\n[\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMatthewZMD_aidermacs_readme_198f773f6acd.jpg\" width=600>](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=fB3-ie6zs4Y)\n\n## 社区驱动的开发\nAidermacs 的发展离不开社区的参与。我们相信，通过与用户和贡献者协作开发，才能打造出最优秀的软件。我们鼓励你：\n\n- 贡献代码：提交包含错误修复、新功能或现有功能改进的拉取请求。\n- 报告问题：通过 GitHub Issues 向我们反馈任何 bug、异常行为或功能请求。\n- 分享想法：参与讨论，提出让 Aidermacs 更加完善的建议。\n- 改进文档：帮助我们使文档更加清晰、全面且易于使用。\n\n你的贡献对于将 Aidermacs 打造成 Emacs 中最佳的 AI 配对编程工具至关重要！\n\n\u003Ca href = \"https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fgraphs\u002Fcontributors\">\n  \u003Cimg src = \"https:\u002F\u002Fcontrib.rocks\u002Fimage?repo=MatthewZMD\u002Faidermacs\"\u002F>\n\u003C\u002Fa>","# Aidermacs 快速上手指南\n\nAidermacs 将强大的 AI 结对编程工具 [Aider](https:\u002F\u002Fgithub.com\u002Fpaul-gauthier\u002Faider) 集成到 Emacs 中。如果你习惯使用 Emacs 但渴望拥有类似 Cursor 的 AI 编程体验，Aidermacs 是最佳选择。\n\n## 环境准备\n\n在开始之前，请确保你的系统满足以下要求：\n\n*   **Emacs**: 版本 ≥ 26.1\n*   **Aider**: 必须预先安装主程序。\n    *   推荐安装官方版本：`pip install aider-chat`\n    *   或社区实验版：`pip install aider-ce`\n*   **Emacs 依赖包**:\n    *   `transient` (通常随 Magit 自动安装，若未安装需手动获取)\n*   **API Key**: 准备好你所用大模型服务商的 API Key (如 Anthropic, OpenAI, OpenRouter 等)。\n\n## 安装步骤\n\n你可以通过 MELPA 或 NonGNU ELPA 仓库直接安装，这是最推荐的方式。\n\n### 1. 配置包管理器 (init.el)\n\n确保你的 `init.el` 中已配置好 `package-archives` 包含 MELPA 和 NonGNU ELPA：\n\n```emacs-lisp\n(require 'package)\n(add-to-list 'package-archives '(\"melpa\" . \"https:\u002F\u002Fmelpa.org\u002Fpackages\u002F\") t)\n(add-to-list 'package-archives '(\"nongnu\" . \"https:\u002F\u002Felpa.nongnu.org\u002Fnongnu\u002F\") t)\n(package-initialize)\n```\n\n### 2. 安装 Aidermacs\n\n在 Emacs 中执行 `M-x package-refresh-contents` 刷新列表，然后执行 `M-x package-install` 输入 `aidermacs` 进行安装。\n\n或者直接在 `init.el` 中使用 `use-package` 进行声明式安装（推荐）：\n\n```emacs-lisp\n(use-package aidermacs\n  :ensure t\n  :bind ((\"C-c a\" . aidermacs-transient-menu)) ;; 绑定快捷键\n  :config\n  ;; 方式一：在 .bashrc 或 .zshrc 中设置环境变量（推荐，更安全）\n  ;; export ANTHROPIC_API_KEY=\"sk-...\"\n  \n  ;; 方式二：直接在 elisp 中设置（注意不要将密钥提交到代码仓库）\n  ;; (setenv \"ANTHROPIC_API_KEY\" \"sk-...\")\n  \n  :custom\n  (aidermacs-default-chat-mode 'architect) ;; 默认启用架构师模式（推理+编辑分离）\n  (aidermacs-default-model \"sonnet\"))      ;; 默认模型\n```\n\n> **Spacemacs 用户**：\n> 在 `.spacemacs` 的 `dotspacemacs-additional-packages` 列表中添加 `(aidermacs :variables ...)`，并在 `dotspacemacs\u002Fuser-config` 中绑定按键 `(spacemacs\u002Fset-leader-keys \"aa\" 'aidermacs-transient-menu)`。\n\n## 基本使用\n\n安装配置完成后，即可在项目中使用 AI 辅助编程。\n\n### 1. 启动会话\n\n打开你的项目目录，按下快捷键 `C-c a` (或你自定义的按键)，或者执行命令 `M-x aidermacs-transient-menu`。\n\n这将打开一个类似 Magit 的 transient 菜单界面。\n\n### 2. 添加文件\n\nAI 需要知道哪些文件可以读取或修改。在菜单中：\n*   按 `F`：添加当前缓冲区文件到会话（可编辑）。\n*   按 `f`：选择添加其他文件。\n*   **提示**：在添加文件前按 `C-u` 前缀，可将文件设为**只读**（AI 仅参考不修改）。\n\n### 3. 与 AI 交互\n\n在菜单中选择操作模式或直接输入指令：\n*   **代码模式 (`1`)**：直接让 AI 修改代码。\n*   **问答模式 (`2`)**：询问代码逻辑或架构问题。\n*   **架构师模式 (`3`)**：(推荐) 先由“架构师”模型规划，再由“编辑”模型执行，适合复杂任务。\n\n**最简单的工作流示例**：\n1.  打开项目，按 `C-c a` 唤出菜单。\n2.  按 `F` 将当前文件加入上下文。\n3.  按 `c` (Code Change) 或直接输入自然语言指令，例如：“给这个函数添加错误处理”。\n4.  Aidermacs 会调用后端 Aider 生成代码变更。\n5.  变更生成后，会自动触发 `ediff` 界面供你审查差异，确认无误后接受即可。\n\n### 4. 常用快捷键速查\n\n在 `aidermacs-transient-menu` 界面中：\n*   `a`: 开始\u002F打开会话\n*   `l`: 清除聊天历史\n*   `o`: 切换主模型\n*   `g`: 接受提议的更改\n*   `?`: 查看帮助信息\n\n现在，你可以在 Emacs 中享受高效的 AI 结对编程体验了！","一位资深 Emacs 用户正在重构一个遗留的 Python 数据处理模块，需要在不离开编辑器的情况下完成复杂的代码逻辑修改和测试生成。\n\n### 没有 aidermacs 时\n- **工作流频繁中断**：为了使用 AI 辅助，必须切换窗口到浏览器或独立 IDE（如 Cursor），复制粘贴代码上下文，破坏了 Emacs“一站式”开发的心流体验。\n- **代码审查繁琐**：AI 返回的代码块需要手动复制回缓冲区，若需对比差异，还得额外调用 `diff` 命令或手动逐行核对，极易引入人为错误。\n- **上下文管理低效**：在多文件重构中，难以快速让 AI 理解整个项目结构，每次对话都要重新描述文件依赖关系，沟通成本极高。\n- **配置割裂**：本地环境变量和 API 密钥需要在不同工具间重复配置，缺乏统一的安全管理机制。\n\n### 使用 aidermacs 后\n- **原生无缝集成**：直接在 Emacs 内通过 `C-c a` 唤起 Aidermacs，无需切换窗口，AI 如同原生结对编程伙伴般融入现有工作流。\n- **智能差异对比**：利用内置的 Ediff 集成，AI 生成的修改会自动弹出差异对比视图，用户可逐块确认或拒绝变更，确保代码安全可控。\n- **感知项目全貌**：Aidermacs 能自动读取当前打开的项目文件作为上下文，精准理解多文件间的依赖，轻松处理跨文件的重构任务。\n- **统一配置管理**：支持在 `init.el` 中集中管理 API 密钥和模型参数，既保证了安全性，又实现了与 Emacs 配置体系的完美融合。\n\naidermacs 让 Emacs 用户在享受顶级 AI 编程能力的同时，无需妥协于熟悉的高效编辑器环境，真正实现了“鱼与熊掌兼得”。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FMatthewZMD_aidermacs_03b87a25.png","MatthewZMD","Matthew “MT” Zeng","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FMatthewZMD_7b591f00.png","Free and Open Source Developer \u002F Emacs Hobbyist \u002F @uWaterloo Alumni",null,"matthewzmd@posteo.net","https:\u002F\u002Fmt-zeng.com\u002F","https:\u002F\u002Fgithub.com\u002FMatthewZMD",[82],{"name":83,"color":84,"percentage":85},"Emacs Lisp","#c065db",100,893,72,"2026-04-02T00:29:57","Apache-2.0","Linux, macOS, Windows","未说明",{"notes":93,"python":94,"dependencies":95},"该工具是 Emacs 插件，核心功能依赖外部安装的 Aider 命令行工具。需配置 AI 服务商的 API Key（如 Anthropic, OpenAI 等）。支持 Spacemacs。无需本地 GPU 运行，推理由云端 API 完成。","未说明 (依赖外部 Aider 工具，通常需 Python 3.8+)",[96,97,98],"Emacs >= 26.1","Aider (或 Aider Community Experimentation)","Transient",[13,35,14,52,15],[101,102,103,104,105,106,107,108],"ai","aider","emacs","llm","chatgpt","claude","ai-programming","deepseek","2026-03-27T02:49:30.150509","2026-04-09T12:56:46.031115",[112,117,122,127,132,137],{"id":113,"question_zh":114,"answer_zh":115,"source_url":116},26265,"在代码流式输出时屏幕不断跳动，导致无法向上滚动查看历史内容，如何解决？","这通常与 `comint` 或 `vterm` 的自动滚动行为有关。首先尝试清理并重新安装插件：删除 `~\u002F.emacs.d\u002F.local\u002Fstraight\u002Fbuild\u002Faidermacs` 和 `~\u002F.emacs.d\u002F.local\u002Fstraight\u002Frepos\u002Faidermacs` 目录，然后重启 Emacs（如使用 Doom Emacs 则重启 doom）。如果问题依旧，请检查变量 `comint-scroll-to-bottom-on-input` 是否为 `nil`。若需在纯 Emacs 环境下调试，可创建一个 `debug.el` 文件，手动将 `aidermacs`、`transient`、`markdown-mode` 和 `compat` 添加到 `load-path` 并加载，以排除配置干扰。","https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fissues\u002F109",{"id":118,"question_zh":119,"answer_zh":120,"source_url":121},26266,"使用 `Architect this code` 功能时，如果 Aider 返回包含 diff 样式的代码会导致 Emacs 卡死，有什么解决办法？","这是一个已知的兼容性问题，特别是在 Windows 环境下。社区用户提供了一个有效的补丁方案来解决此卡死问题。您可以尝试应用该补丁（参考 PR #84），或者等待维护者合并修复。临时解决方案是避免在可能产生复杂 diff 输出的场景下使用该特定指令，或者切换到不包含 diff 样式输出的模式进行测试。","https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fissues\u002F50",{"id":123,"question_zh":124,"answer_zh":125,"source_url":126},26267,"在使用 `python-ts-mode` (Treesitter) 时运行 aidermacs 出现错误循环，如何处理？","该问题与 Treesitter 模式的语法高亮处理有关。虽然移除 `(add-hook 'comint-output-filter-functions #'aidermacs-fontify-blocks 100 t)` 这一行可能无法完全解决问题，但这表明冲突点在于字体锁定（fontification）。目前的临时建议是：如果必须使用 `python-ts-mode`，可能需要暂时禁用 aidermacs 的自动代码块高亮功能，或者回退到标准的 `python-mode` 直到官方修复针对 Treesitter 模式的兼容性。维护者已注意到临时编辑缓冲区的语法高亮完全丢失的问题正在修复中。","https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fissues\u002F77",{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},26268,"从 vterm 后端复制粘贴代码时换行符丢失，所有内容变成了一行，如何修复？","这是因为 vterm 过滤缓冲区子字符串时的正则表达式未正确转义。如果您遇到此问题，可以检查或修改相关代码中的正则表达式。原代码中 `(replace-regexp-in-string \"[ \\t]{3,}\" \"\\n\" text)` 是错误的，因为在 Emacs Lisp 字符串中需要双重转义。正确的写法应该是：`(replace-regexp-in-string \"[ \\t]\\\\{3,\\\\}\" \"\\n\" text)`。请确保您的版本包含了此修复，或者手动在配置中应用正确的正则表达式逻辑。","https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fissues\u002F68",{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},26269,"为什么 Markdown 代码块的高亮显示不完整或存在延迟？","这是由 Markdown 模式的机制决定的：它通常需要检测到代码块的结束标记（end code fence）才会开始高亮整个块，而 aidermacs 希望在代码流式输出时即时高亮。此外，LLM 生成的 SEARCH\u002FREPLACE 标记可能被误解析为代码的一部分，或者 LLM 有时不输出语言标识符。目前的解决方案是：如果没有指定语言，插件会尝试从文件路径推断语言；对于高亮延迟问题，需等待后续版本优化对流式 Markdown 块的处理逻辑。","https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fissues\u002F62",{"id":138,"question_zh":139,"answer_zh":140,"source_url":141},26270,"Aidermacs 是 Aider 的分支（Fork）还是扩展（Extension）？两者有什么区别？","Aidermacs 旨在作为一个扩展包（Extension Package），而不是让代码库分叉的 Fork。这意味着它可以与原始的 `aider.el` 共存，用户无需在两者之间做互斥选择。只要保持功能兼容，用户可以同时拥有基础功能和扩展功能。这种设计降低了用户的采用门槛，无需学习不同分支的权衡，只需安装扩展即可获得额外功能。","https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fissues\u002F1",[143,148,153,158,163,168,173],{"id":144,"version":145,"summary_zh":146,"released_at":147},171225,"v1.6","## 变更内容\n* 修复 vterm-filter-buffer-substring 的正则表达式，由 @meliache 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F156 中完成\n* 功能：新增 `aidermacs-run-in-directory`，并绑定为 `:` 键，由 @veracioux 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F158 中完成\n* 修复：使用 `process-file` 获取 Aider 版本，解决 #155 问题，由 @bdf369 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F161 中完成\n* 用户体验优化：在临时菜单中显示当前运行状态，由 @blahgeek 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F163 中完成\n* 尊重 `aidermacs-subtree-only` 设置，即使已设置 `aidermacs-config-file`，由 @blahgeek 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F165 中完成\n* 复制进程环境变量，防止在钩子中设置的敏感信息泄露，由 @blahgeek 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F166 中完成\n* 增加等待后端就绪的时间，由 @blahgeek 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F167 中完成\n* 更新 README 中关于进程环境变量的说明，由 @blahgeek 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F169 中完成\n* 使代码操作自动选择相关上下文，由 @remo5000 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F176 中完成\n* 修复 Aider 版本检查，由 @claritystorm 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F177 中完成\n* 修复 Aider 版本检查，由 @Zhen-Ni 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F178 中完成\n* 更新针对较新 Sonnet 模型的思考指令，由 @plpxsk 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F180 中完成\n* 在模型选择界面显示模型定价，由 @OverbearingPearl 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F181 中完成\n* 修复：在 `aidermacs-set-model` 中使用真实的模型值，由 @OverbearingPearl 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F182 中完成\n\n## 新贡献者\n* @meliache 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F156 中完成了首次贡献\n* @veracioux 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F158 中完成了首次贡献\n* @bdf369 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F161 中完成了首次贡献\n* @blahgeek 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F163 中完成了首次贡献\n* @Zhen-Ni 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F178 中完成了首次贡献\n* @plpxsk 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F180 中完成了首次贡献\n* @OverbearingPearl 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F181 中完成了首次贡献\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fcompare\u002Fv1.5...v1.6","2025-11-08T08:11:24",{"id":149,"version":150,"summary_zh":151,"released_at":152},171226,"v1.5","## 变更内容\n* backends: 由 @brianmcgillion 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F137 中调整了用于延迟加载 vterm 的后端。\n* 不在光标位置未移动时运行块字体化，由 @CeleritasCelery 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F140 中实现。\n* 功能：aidermacs 发送语音 - 修复 #128，由 @rajp152k 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F143 中完成。\n* 修复编译期间 aidermacs--send-command-backend 警告，由 @AdamNiederer 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F142 中解决。\n* 功能：显示已编辑文件列表，由 @Azkae 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F148 中实现。\n* 核心功能！：引入 `aidermacs-default-chat-mode`；弃用 `aidermacs-use-architect-mode`，由 @timvisher-dd 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F147 中完成。\n* 修复前一个缓冲区未关闭时的文件选择问题，由 @Azkae 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F150 中解决。\n* 功能：支持用于默认 AI 模型配置的环境变量，由 @timvisher-dd 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F151 中实现。\n* 修复默认聊天模式：默认设置为 'code'，由 @Azkae 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F153 中完成。\n\n## 新贡献者\n* @brianmcgillion 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F137 中做出了首次贡献。\n* @rajp152k 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F143 中做出了首次贡献。\n* @Azkae 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F148 中做出了首次贡献。\n* @timvisher-dd 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F147 中做出了首次贡献。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fcompare\u002Fv1.4...v1.5\n\n## 变更内容\n* backends: 由 @brianmcgillion 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F137 中调整了用于延迟加载 vterm 的后端。\n* 不在光标位置未移动时运行块字体化，由 @CeleritasCelery 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F140 中实现。\n* 功能：aidermacs 发送语音 - 修复 #128，由 @rajp152k 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F143 中完成。\n* 修复编译期间 aidermacs--send-command-backend 警告，由 @AdamNiederer 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F142 中解决。\n* 功能：显示已编辑文件列表，由 @Azkae 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F148 中实现。\n* 核心功能！：引入 `aidermacs-default-chat-mode`；弃用 `aidermacs-use-architect-mode`，由 @timvisher-dd 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F147 中完成。\n* 修复前一个缓冲区未关闭时的文件选择问题，由 @Azkae 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F150 中解决。\n* 功能：支持用于默认 AI 模型配置的环境变量，由 @timvisher-dd 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F151 中实现。\n* 修复默认聊天模式：默认设置为 'code'，由 @Azkae 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F153 中完成。\n\n## 新贡献者\n* @brianmcgillion 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F137 中做出了首次贡献。\n* @rajp152k 在 https:\u002F\u002Fgithub.com\u002FM","2025-07-07T18:32:53",{"id":154,"version":155,"summary_zh":156,"released_at":157},171227,"v1.4","## 变更内容\n* [建议] 由 @remo5000 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F120 中添加了项目文件选择功能\n* 由 @AdamNiederer 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F121 中实现模型选择时不强制要求完全匹配\n* 由 @AdamNiederer 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F124 中改进为：只有在 Aider 准备好接收命令时才发送命令\n* 由 @AdamNiederer 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F123 中将提示输入方式由 `completing-read` 改为 `read-from-minibuffer`\n* 由 @AdamNiederer 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F125 中优化为：仅在 Aider 未运行时才启动它，避免不必要的启动与停止\n* 由 @AdamNiederer 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F126 中将输入方式由 `read-from-minibuffer` 改为 `read-string`\n* 功能：支持配置只读文件，由 @rezaamashi 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F130 中实现\n* 添加 Verilog 支持，并防止下划线影响格式化，由 @CeleritasCelery 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F131 中完成\n* 修复语法高亮过程中光标移动的问题，由 @CeleritasCelery 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F132 中解决\n* 修复临时缓冲区的执行路径问题，由 @toniz4 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F133 中完成\n\n## 新贡献者\n* @remo5000 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F120 中完成了首次贡献\n* @AdamNiederer 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F121 中完成了首次贡献\n* @rezaamashi 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F130 中完成了首次贡献\n* @toniz4 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F133 中完成了首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fcompare\u002Fv1.3...v1.4","2025-05-23T04:13:01",{"id":159,"version":160,"summary_zh":161,"released_at":162},171228,"v1.3","## 变更内容\n* 由 @Martinsos 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F106 中修复了 README.md 中关于“AI”注释的部分。\n* aidermacs--form-prompt：始终使用 prompt-prefix 和上下文。由 @thanhvg 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F108 中实现。\n* 当警告用户 font-lock 位置时，使用 `display-warning`。由 @benthamite 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F113 中实现。\n* 由 @Dima-369 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F114 中修复了 aidermacs 的拼写错误。\n* 功能：向 aidermacs 添加网页内容获取功能。由 @ArthurHeymans 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F115 中实现。\n* 功能：在 Magit 的 transient 菜单中添加自动提交命令。由 @ArthurHeymans 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F116 中实现。\n* 将语法高亮改为基于状态的方法。由 @CeleritasCelery 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F118 中实现。\n* 为 aide 会话添加 Markdown 格式化。由 @CeleritasCelery 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F119 中实现。\n\n## 新贡献者\n* @Martinsos 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F106 中完成了首次贡献。\n* @thanhvg 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F108 中完成了首次贡献。\n* @benthamite 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F113 中完成了首次贡献。\n* @Dima-369 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F114 中完成了首次贡献。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fcompare\u002Fv1.2...v1.3","2025-04-27T17:50:04",{"id":164,"version":165,"summary_zh":166,"released_at":167},171229,"v1.2","我的开发重心已转移至 [Emigo](https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Femigo)，这是一款面向 Emacs 的代理式 AI 编程助手；Aidermacs 现已进入维护模式。更多背景信息请参见：https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fdiscussions\u002F98\n\n## 变更内容\n* 使用 uv 安装 aider。由 @manateelazycat 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F89 中完成。\n* 文档：修复 uv aider 代理错误。由 @ymfsing 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F90 中完成。\n* 修复模型继承，使其动态使用默认模型值。由 @u-yuta 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F91 中完成。\n* 处理插入钩子中的错误。由 @CeleritasCelery 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F95 中完成。\n* 自述文件：添加 Spacemacs 示例。由 @paralin 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F100 中完成。\n* 自述文件：将入门步骤中的第 4 步和第 5 步重新加入。由 @paralin 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F101 中完成。\n\n## 新贡献者\n* @manateelazycat 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F89 中完成了首次贡献。\n* @ymfsing 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F90 中完成了首次贡献。\n* @paralin 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F100 中完成了首次贡献。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fcompare\u002Fv1.1...v1.2","2025-04-02T16:07:01",{"id":169,"version":170,"summary_zh":171,"released_at":172},171230,"v1.1","## Aidermacs 1.1：更优的输出，更强的性能\n\n**Aidermacs 1.1 有哪些新功能？**\n\n此版本支持最新的 Aider 0.78。\n\n* **新增特性：**\n  * 添加了带有历史记录的常用提示系统\n  * 更好地支持架构师与编辑器模型分离\n  * 改进了 vterm 后端的主题支持\n  * 为 API 提供商添加了模型名称转换功能\n\n* **增强的模型管理：**\n  * 新增了用于提交信息和聊天摘要的弱模型支持\n  * 通过前缀参数改进了弱模型切换时的模型选择\n  * 更好地处理模型继承与初始化\n  * 增加了模型版本检查与缓存机制\n\n* **输出处理改进：**\n  * 新的输出模块，具备更好的文件跟踪与解析能力\n  * 改进了 ediff 集成，并添加了适当的清理钩子\n  * 更好地处理只读文件和远程路径\n  * 增强了输出历史管理\n\n* **性能提升：**\n  * 添加了防止无限 font-lock 循环的保护机制\n  * 更好地处理大型输出块\n  * 改进了缓冲区管理和清理\n\n* **错误修复：**\n  * 修复了 drop 命令中的文件路径处理问题\n  * 改进了模型获取过程中的错误处理\n  * 更好地处理进程输出过滤\n  * 修复了缓冲区命名与选择相关的问题\n\n**破坏性变更：**\n* 最低 Emacs 版本要求已更改为 26.1\n* 部分内部 API 已重新组织\n* 架构师模式下的模型选择行为发生了变化\n\n**升级说明：**\n1. 将您的 Emacs 更新至至少 26.1 版本\n2. 检查并调整您的模型配置设置\n3. 查看是否有需要更新的自定义配置\n4. 如果遇到问题，请清除缓存的模型列表\n\n## 新贡献者\n* @SpringHan 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F81 中做出了首次贡献\n* @u-yuta 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F86 中做出了首次贡献\n* @smallzhan 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F84 中做出了首次贡献\n* @claritystorm 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F88 中做出了首次贡献\n\n## 变更内容\n* 不在退出时关闭 vterm 缓冲区；允许故障排除，由 @rjekker 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F73 中实现\n* 由 @rjekker 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F72 中为组添加选项\n* 由 @rjekker 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F71 中实现主题支持\n* 功能：为 aidermacs 的 read-string 输入添加历史记录，由 @LemonBreezes 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F79 中实现\n* 由 @rjekker 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F78 中实现 aide rmacs-vterm-mode 中选中文本的过滤功能\n* 由 @MatthewZMD 将输出和 ediff 代码重构到独立文件中，见 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F80\n* 在将文件添加到会话时不再插入文件名，由 @SpringHan 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F81 中实现\n* 由 @u-yuta 改进了模型配置文档，见 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faiderma","2025-03-23T06:04:41",{"id":174,"version":175,"summary_zh":176,"released_at":177},171231,"v1.0","## Aidermacs 1.0 正式发布：AI 结对编程，原生集成于 Emacs！\n\n我们非常高兴地宣布 Aidermacs 1.0 的正式发布！这款工具将强大的 AI 结对编程能力直接融入您的 Emacs 工作流中！Aidermacs 集成了领先的开源 AI 工具 [Aider](https:\u002F\u002Fgithub.com\u002Fpaul-gauthier\u002Faider)，为您提供无缝且原生的 Emacs 编程体验。\n\n\n**Aidermacs 1.0 有哪些新特性？**\n\nAidermacs 1.0 带来了多项功能，旨在提升您的开发效率和编码体验：\n\n* **包仓库支持：**\n  *   **MELPA：** 您可以直接从 MELPA 安装，使用 `M-x package-install RET aidermacs RET`。\n  *   **Non-GNU ELPA：** 同样可在 Non-GNU ELPA 上获取。\n*   **内置 Ediff 集成：** 使用 Emacs 熟悉的 `ediff` 界面查看 AI 生成的更改，轻松接受或拒绝修改。\n*   **智能模型选择：** 自动发现并集成多个 AI 提供商（OpenAI、Anthropic、DeepSeek、Google Gemini、OpenRouter），确保兼容性和最佳性能。\n*   **灵活的终端后端支持：** 可在 `comint` 和 `vterm` 后端之间选择，以获得最佳的终端兼容性和性能。\n*   **增强的文件管理功能：** 在 Aider 会话中轻松管理文件，提供添加、移除、列出等命令。全面支持通过 Tramp 处理远程文件（SSH、Docker 等）。\n*   **精简的瞬态菜单选择：** 通过重新设计且符合人体工学的瞬态菜单系统，快速访问所有 Aidermacs 功能。\n*   **Prompt Files 小模式：** 通过便捷的快捷键和自动模式激活，无缝处理 prompt 文件及其他 Aider 相关文件。\n*   **Claude 3.7 Sonnet 思考标记：** 使用 `\u002Fthink-tokens` 聊天内命令或 `--thinking-tokens` 命令行参数，启用并配置思考标记。\n*   **架构模式确认：** 使用 `aidermacs-auto-accept-architect` 变量控制是否自动接受架构模式的更改。\n*   **重新启用自动提交：** Aider 默认会自动提交 AI 生成的更改。我们认为这种行为 *非常* 干扰，因此已将其禁用。您可以通过将 `aidermacs-auto-commits` 设置为 `t` 来重新启用自动提交。\n*   **通过 `aidermacs-extra-args` 自定义 Aider 选项：** 您可以传递任何 Aider 支持的命令行选项。\n\n\n## 新贡献者\n* @notImposterSyndromeIfImposter 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F5 中做出了首次贡献。\n* @CeleritasCelery 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F6 中做出了首次贡献。\n* @zsxh 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F10 中做出了首次贡献。\n* @milanglacier 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F13 中做出了首次贡献。\n* @ArthurHeymans 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F11 中做出了首次贡献。\n* @bard 在 https:\u002F\u002Fgithub.com\u002FMatthewZMD\u002Faidermacs\u002Fpull\u002F27 中做出了首次贡献。\n* @mwolson ma","2025-03-16T05:59:03"]