Show HN:Plandex v2——大型项目和任务的开源AI编码代理
Show HN: Plandex v2 – open source AI coding agent for large projects and tasks

原始链接: https://github.com/plandex-ai/plandex

Plandex 是一款基于终端的 AI 开发工具,旨在简化编码任务,即使是大规模项目也能轻松应对。它拥有 2M token 的上下文窗口,能够通过 tree-sitter 处理超过 20M token 的项目,并提供上下文缓存以降低成本和延迟。 Plandex 可以自动规划、执行和调试代码更改,并与版本控制系统 (Git) 集成。它支持 Anthropic、OpenAI、Google 和开源提供商的模型,允许用户比较不同模型的效果。 用户可以选择完全自主模式或逐步控制模式。Plandex 优先考虑代码正确性,会验证语法和逻辑。它还提供了一种项目感知的聊天模式,方便用户进行想法开发和代码库探索。 安装非常简单,只需一个命令行指令即可完成,支持 Docker 本地部署和云端部署选项。Windows 系统用户可以使用 WSL 进行安装。要开始使用,只需 `cd` 到您的项目目录并运行 `plandex` 即可。

Plandex 的创建者 Dane 在 Hacker News 上发布了 Plandex v2,这是一个针对大型软件项目设计的开源 AI 编码代理的重大更新。他强调了其自主能力,利用 Anthropic、OpenAI 和 Google 的模型来提高性能、降低成本和增强可靠性。Plandex 具有差异审查沙箱、可配置的自主级别和版本控制的模型设置。它支持 2000 万以上 token 的项目索引,并可以在海量代码库中找到相关上下文。 用户可以通过 Docker 自行托管 Plandex,也可以选择不同订阅层级的云托管服务。一个内置的“集成模型”云解决方案可提供一体化的模型和使用情况跟踪体验。最初的反响积极,评论涉及到用于代码编辑和验证的单独模型、Mac 上的 Docker 性能以及与 IDE 集成的潜力。一位用户将其描述为一个典范的“Show HN”帖子。Dane 鼓励用户加入 Plandex Discord 提供反馈。

原文

PRs Welcome Release Release




💻  Plandex is a terminal-based AI development tool that can plan and execute large coding tasks that span many steps and touch dozens of files. It can handle up to 2M tokens of context directly (~100k per file), and can index directories with 20M tokens or more using tree-sitter project maps.

🔬  A cumulative diff review sandbox keeps AI-generated changes separate from your project files until they are ready to go. Command execution is controlled so you can easily roll back and debug. Plandex helps you get the most out of AI without leaving behind a mess in your project.

🧠  Combine the best models from Anthropic, OpenAI, Google, and open source providers to build entire features and apps with a robust terminal-based workflow.

🚀  Plandex is capable of full autonomy—it can load relevant files, plan and implement changes, execute commands, and automatically debug—but it's also highly flexible and configurable, giving developers fine-grained control and a step-by-step review process when needed.

💪  Plandex is designed to be resilient to large projects and files. If you've found that others tools struggle once your project gets past a certain size or the changes are too complex, give Plandex a shot.

Smart context management that works in big projects

  • 🐘 2M token effective context window with default model pack. Plandex loads only what's needed for each step.

  • 🗄️ Reliable in large projects and files. Easily generate, review, revise, and apply changes spanning dozens of files.

  • 🗺️ Fast project map generation and syntax validation with tree-sitter. Supports 30+ languages.

  • 💰 Context caching is used across the board for OpenAI and Anthropic models, reducing costs and latency.

Tight control or full autonomy—it's up to you

  • 🚦 Configurable autonomy: go from full auto mode to fine-grained control depending on the task.

  • 🐞 Automated debugging of terminal commands (like builds, linters, tests, deployments, and scripts). If you have Chrome installed, you can also automatically debug browser applications.

Tools that help you get production-ready results

  • 💬 A project-aware chat mode that helps you flesh out ideas before moving to implementation. Also great for asking questions and learning about a codebase.

  • 🧠 Easily try + combine models from multiple providers. Curated model packs offer different tradeoffs of capability, cost, and speed, as well as open source and provider-specific packs.

  • 🛡️ Reliable file edits that prioritize correctness. While most edits are quick and cheap, Plandex validates both syntax and logic as needed, with multiple fallback layers when there are problems.

  • 🔀 Full-fledged version control for every update to the plan, including branches for exploring multiple paths or comparing different models.

  • 📂 Git integration with commit message generation and optional automatic commits.

Dev-friendly, easy to install

  • 🧑‍💻 REPL mode with fuzzy auto-complete for commands and file loading. Just run plandex in any project to get started.

  • 🛠️ CLI interface for scripting or piping data into context.

  • 📦 One-line, zero dependency CLI install. Dockerized local mode for easily self-hosting the server. Cloud-hosting options for extra reliability and convenience.

Plandex workflow



curl -sL https://plandex.ai/install.sh | bash

Note: Windows is supported via WSL. Plandex only works correctly on Windows in the WSL shell. It doesn't work in the Windows CMD prompt or PowerShell.

More installation options.

Option Description
Plandex Cloud (Integrated Models) • No separate accounts or API keys.
• Easy multi-device usage.
• Centralized billing, budgeting, usage tracking, and cost reporting.
• Quickest way to get started.
Plandex Cloud (BYO API Key) • Use Plandex Cloud with your own OpenRouter.ai and OpenAI keys.
Get started
Self-hosted/Local Mode • Run Plandex locally with Docker or host on your own server.
• Use your own OpenRouter.ai and OpenAI keys.
• Follow the local-mode quickstart to get started.

If you're going with a 'BYO API Key' option above (whether cloud or self-hosted), you'll need to set the OPENROUTER_API_KEY and OPENAI_API_KEY environment variables before continuing:

export OPENROUTER_API_KEY=...
export OPENAI_API_KEY=...

First, cd into a project directory where you want to get something done or chat about the project. Make a new directory first with mkdir your-project-dir if you're starting on a new project.

For a new project, you might also want to initialize a git repo. Plandex doesn't require that your project is in a git repo, but it does integrate well with git if you use it.

Now start the Plandex REPL in your project:

or for short:

☁️ If you're using Plandex Cloud, you'll be prompted at this point to start a trial.

Then just give the REPL help text a quick read, and you're ready go. The REPL starts in chat mode by default, which is good for fleshing out ideas before moving to implementation. Once the task is clear, Plandex will prompt you to switch to tell mode to make a detailed plan and start writing code.



Discussion and discord  💬

Please feel free to give your feedback, ask questions, report a bug, or just hang out:

⭐️  Please star, fork, explore, and contribute to Plandex. There's a lot of work to do and so much that can be improved.

Here's an overview on setting up a development environment.

联系我们 contact @ memedata.com