以 GitHub Issue 和 Prompt 文件为驱动源的 AI 代码生成与维护 CLI 工具包
PDD 是一款处于 Alpha 阶段(v0.0.216)的 AI 开发工具,由 Prompt Driven, Inc. 维护,核心理念源自其提出的 PDD Doctrine——将 Prompt 和测试视为"模具",代码视为"生成品",强调测试资本、Prompt 资本、Grounding 资本的复利效应。
驱动模式#
Issue 驱动模式:通过多步骤 Agentic 工作流直接从 GitHub Issue 自动产出代码、测试或架构文件:
pdd change <issue-url>— 12 步工作流实现功能请求pdd bug <issue-url>— 为 Bug 创建失败测试pdd fix <issue-url>— 修复失败测试pdd split <target-file>— 14 步工作流诊断并拆分大型开发单元pdd generate <issue-url>— 从 PRD Issue 生成 architecture.json(11 步)pdd test <issue-url>— 生成含探索性测试与可访问性审计的 UI 测试(18 步)
Prompt 文件驱动模式:以 .prompt 文件为权威源:
pdd sync <module>— 全自动开发周期(智能决策 + 实时可视化反馈)pdd generate <prompt-file>— 从 prompt 文件生成代码
运行时能力#
- Web 界面:
pdd connect启动 localhost:9876,支持命令执行、文件浏览、PDD Cloud 远程访问 - 多 LLM Provider:通过 LiteLLM 统一接口支持 OpenAI / Anthropic / Google / Vertex AI 等
- Agentic CLI 集成:底层委托 Claude Code、Gemini CLI、Codex CLI 作为执行引擎
- 模型自动选择:内置 CSV 模型目录(ELO ≥ 1400),按编码能力排序自动选优,支持用户级和项目级 CSV 覆盖
- 云端/本地双模式:默认云端(GitHub SSO 认证,无需本地 API Key),
--local切换纯本地模式 - 自动更新:内置 auto-update 机制
架构要点#
项目基于 Python(≥3.12)构建,CLI 入口使用 Click 框架,内嵌 FastAPI + Uvicorn + WebSockets Web 服务器,前端资源打包在 pdd/frontend/dist。核心逻辑位于 pdd/core/,各命令实现在 pdd/commands/。每个工作流(change/bug/fix/split/test/sync/architecture 等)均有独立的 agentic_*.py agent 和 agentic_*_orchestrator.py 编排器,形成多步骤串行编排模式。Prompt 模板以 *_LLM.prompt 文件存储在 pdd/prompts/ 中。
关键依赖包括:litellm[caching](多 Provider 路由与缓存)、z3-solver(约束求解与结构化输出校验)、GitPython(仓库操作)、firebase_admin + keyring(云端认证)、firecrawl-py(网页内容提取)、watchdog(文件变更监听)等。
安装与使用#
curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install pdd-cli
pdd setup
Issue 驱动模式需前置安装 GitHub CLI(gh)及至少一个 Agentic CLI(Claude Code / Gemini CLI / Codex CLI)。
待确认信息#
- 独立官网 URL 及 PDD Cloud 服务详情(托管方、定价、SLA)未明确
- README 提及的 Whitepaper(含基准测试和案例研究)链接未完整获取
.prompt文件的完整 schema/DSL 规范待进一步确认- Windows 兼容性及 Agentic CLI 最低版本要求未明确说明