pr-cockpit

taovcMIT活跃维护

本地 AI 代码评审工作台,让 Claude/Codex 在隔离的 git worktree 中审 PR,评论需人工确认后才发到 GitHub。

Local AI PR workbench — Claude/Codex review in isolated git worktrees, human-gated GitHub comments

nightly发布于 2026-07-01 11:15 UTC486star +1 / 7 天2fork同步于 2026-11-10 23:57 UTC

怎么上手

由 README 提炼,执行前请确认
cp .env.example .env
pnpm install
pnpm dev
硬件要求按 README 说明

README 未说明显存或 GPU 要求;桌面版支持 macOS(Apple Silicon)、Windows x64、Linux x86_64,Intel Mac 需从源码构建。

支持 Apple Silicon
下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

本地 AI PR 工作台,用 Claude/Codex 在隔离 worktree 里审 PR,人工确认后才发到 GitHub

本地 AI 代码评审工作台,让 Claude/Codex 在隔离的 git worktree 中审 PR,评论需人工确认后才发到 GitHub。

核心能力

  • 通过 gh/GraphQL 拉取仓库 PR 队列并按作者、状态等过滤
  • AI 在只读隔离 worktree 中评审,输出带严重级别和 path:line 的结构化发现
  • 逐条勾选发现并预览后,经 gh api 发布为行内 review 评论
  • 修复标签页为持久对话,确认后才执行 git add/commit/push
  • 每个项目独立选择 Claude 或 Codex 及模型、effort 和评审方法

容易踩的坑

需先完成 gh auth login 并登录 Claude 或 Codex,否则应用无法工作;桌面包均未签名,macOS 需清除 quarantine 标志、Windows 需绕过 SmartScreen、Linux 需 chmod +x;默认端口 3001,被占用时改 .env 里的 PORT。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

1 个版本nightly
  1. nightlyNightly (main)pre-release最新正式版2026-07-01 · 2026-07-01 11:15 UTC

    Rolling build from the latest main (7d2f5fc). Overwritten on every merge — not a versioned release. macOS/Windows builds are unsigned; you may need to bypass Gatekeeper/SmartScreen on first launch.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    English · 中文 · Français

    Download

    A desktop build is the fastest way to try it — no clone, no toolchain.

    ⬇ Download a build — builds are currently published as a rolling nightly pre-release, rebuilt on every push to main.

    PlatformFile
    macOS (Apple Silicon)pr-cockpit-<version>-arm64.dmg
    Windows (x64)pr-cockpit-<version>-x64.exe
    Linux (x86_64)pr-cockpit-<version>-x86_64.AppImage

    Intel Macs are not covered by a prebuilt package yet — build from source instead.

    None of the packages are code-signed, so every platform shows a warning on first launch:

    • macOS reports the app as damaged or from an unidentified developer. Clear the quarantine flag once:
      xattr -dr com.apple.quarantine "/Applications/PR Cockpit.app"
      
      Or right-click the app in Finder → Open → Open in the dialog.
    • Windows shows a SmartScreen "Windows protected your PC" dialog. Click More info → Run anyway.
    • Linux needs the AppImage marked executable before it will start:
      chmod +x pr-cockpit-*-x86_64.AppImage
      

    You still need gh auth login and a Claude or Codex login before the app can do anything — see Prerequisites.

    How it works

    No more reviewing PRs one at a time in the terminal, and no more scattering fixes and feature work across separate shells. Pull a repo's PRs into the cockpit → the AI reviews, rechecks, fixes, or develops inside isolated worktrees → you gate findings, conversations, diffs, pushes and PR creation in the web UI → GitHub remains the external system of record. Each project can choose Claude or Codex with its own model, effort and review methodology.

    Features

    PR workbench and review

    • Pull a repo's PR list through gh / GraphQL, then filter by author, PR state, review state, fix state and worktree state; the list auto-refreshes on a poll while the page is visible.
    • The right-side drawer shows AI review, fix chat, timeline and diff, with descriptions and comments rendered as markdown.
    • The AI reviews in an isolated read-only git worktree and produces structured findings — severity, path:line, problem, detail and fix guidance — plus a plain-language summary of what the PR is trying to do and the shortest manual test path for it.
    • Feedback-guided re-review keeps your checkboxes/notes; author-change recheck reads the latest commits and judges each finding.

    Human gate + publishing

    • Per-finding checkbox to "post as a PR comment" + a note (the note is woven into the comment as an edit instruction, not leaked verbatim).
    • Pre-publish preview (dry-run, cacheable / regenerable); findings in any working language are rewritten as professional English GitHub comments.
    • Findings whose path:line lands on a line the PR actually changed are posted as inline review comments; the rest are collected into a summary section instead of being dropped.
    • Publishing goes through gh api .../reviews, with a posting claim and self-healing cleanup of leftover pending reviews, which prevents duplicate concurrent posts.

    Fix PRs

    • The fix tab is a persistent chat: the agent edits the PR worktree, but does not commit or push by default.
    • "Commit and upload" first shows the diff plus an editable conventional commit message; only confirmation runs git add/commit/push.
    • Supports stop/resume, expandable run logs, decision cards, an ultracode toggle that escalates the turn to higher reasoning effort, and an explicit dangerous-command toggle.

    Project assistant: directory chat and feature development

    • The project assistant (bottom-right button on a project page) starts a session either in the project directory or in an isolated feature worktree on a new branch ("New branch"), and lets the agent develop in a single native chat loop.
    • Real decision points are rendered as ask-user cards. Opening a PR is an explicit action that allows the agent to commit, push and run gh pr create for that turn; commit messages and PR title/body are always written in English.
    • The bottom-right global assistant inherits project provider/cwd when available and supports commands such as /cd, /resume and /clear, for ad-hoc troubleshooting and one-off operations.

    Per-project config

    • Each project chooses Claude or Codex. Review, fix chat, recheck, skill generation and publish-time rewriting follow that provider without mixing sessions or models.
    • Claude models come from the local claude; Codex uses preset/default models. Effort, Codex Fast/service tier and methodology are configurable per project.
    • Multiple review skills, one active at a time; AI generation reads the local repo docs and architecture, saves a candidate and lets you diff before activation — activation never overwrites the current skill.

    Safety & consistency

    • Review agents are read-only: tool-level blocking for git writes, file edits, network access and dangerous commands, plus an operating contract and skill linting.
    • Write-capable paths run inside isolated worktrees; push, PR creation and dangerous commands require explicit UI action or toggles.
    • Git operations on the same repo are serialized; findings are transactional; deleted tasks clean worktrees; restarts recover or stop interrupted work.
    • PR automation is high-risk and disabled by default; when enabled it reuses the existing review/post/fix/push endpoints from a server-side poller.

    Tech stack

    Nuxt 4 + @nuxt/ui (Tailwind v4) · better-sqlite3 + drizzle · @anthropic-ai/claude-agent-sdk · @openai/codex-sdk · local gh CLI · Electron packaging that runs Nitro under Electron's Node mode.

    Prerequisites

    Needed whichever way you run it:

    • gh auth login completed — every GitHub read and write goes through the GitHub CLI
    • Claude provider: local claude login or ANTHROPIC_API_KEY
    • Codex provider: local Codex login or OPENAI_API_KEY

    Needed only when building from source:

    • Node ≥ 22, pnpm 9

    Build from source

    Step-by-step guide for a first run from source. If you only want to use the app, download a desktop build instead — it needs no toolchain. See "Getting started" below for the condensed version.

    1. Check the prerequisites

    node -v      # ≥ 22
    pnpm -v      # 9.x  (otherwise: corepack enable && corepack prepare pnpm@9 --activate)
    gh --version
    gh auth status   # must show "Logged in"; otherwise: gh auth login
    

    Also confirm the provider you plan to use is available: Claude needs a local claude login or ANTHROPIC_API_KEY; Codex needs a local Codex login or OPENAI_API_KEY.

    2. Get the project

    git clone https://github.com/taovc/pr-cockpit.git
    cd pr-cockpit
    

    3. Configure the environment

    cp .env.example .env
    

    Every variable has a sensible default; in practice you only adjust:

    VariableWhen to change it
    PORTIf 3001 is already taken
    INFERENCE_PROVIDERclaude (default) or codex
    ANTHROPIC_API_KEYOptional for the Claude path; use when local claude login is unavailable
    OPENAI_API_KEYWhen local Codex login is unavailable and you want to use an OpenAI API key

    The full list of variables is in the Configuration (.env) section.

    4. Install dependencies

    pnpm install
    

    The postinstall step automatically runs nuxt prepare (Nuxt type generation).

    5. First run

    pnpm dev      # http://localhost:3001
    

    On first start, the SQLite database (./data/cockpit.db) is created automatically. The default worktree location is .pr-cockpit-worktrees/ inside each project's local clone, so IDEs can discover it like normal repo-local worktrees (VS Code needs git.repositoryScanMaxDepth set to 2 or -1; the default of 1 only scans one level down). The directory is added to the project's .git/info/exclude, keeping the main repo's git status clean. Startup recovery moves existing persistent worktrees from the old ./data/worktrees location when they still exist. No manual migration is required. The Drizzle schema is set up on the fly (ensureSchema() / ensureColumns() in core/db/client.ts).

    6. Production build (optional)

    pnpm build
    pnpm preview
    

    Electron preview / packaging:

    pnpm electron:preview
    pnpm electron:dist
    

    Troubleshooting

    • Port already in use → change PORT in .env.
    • gh not authenticated → gh auth login (GitHub reads/writes depend on it).
    • Inspect the database → pnpm db:studio (opens Drizzle Studio).

    Getting started

    cp .env.example .env      # adjust PORT / model / paths as needed
    pnpm install
    pnpm dev                  # defaults to http://localhost:3001
    

    Once inside, click the "+" on the left to create a project (fill in owner/repo + the local clone path), configure provider/model/effort and generate a review skill. Then use "All PRs" for review/fix work, or the project assistant (bottom right) for a directory chat or a new feature branch.

    Configuration (.env)

    See .env.example; key entries:

    VariableExampleDescription
    PORT3001Port
    INFERENCE_PROVIDERclaudeclaude / codex
    ANTHROPIC_MODELsonnetDefault review model (overridable per project)
    CODEX_MODELDefault model for Codex projects; empty uses the Codex default
    CODEX_SERVICE_TIEROptional global default Codex/OpenAI speed tier; the project-level Fast toggle overrides it. To disable global fast, leave/delete it and also remove service_tier from ~/.codex/config.toml if set globally
    CODEX_PROJECT_DOC_FALLBACK_FILENAMESCLAUDE.md,.claude/CLAUDE.mdProject docs Codex reads when AGENTS.md is absent
    OPENAI_API_KEYsk-...Optional when local Codex login is unavailable
    TRANSLATE_MODEL(empty)Model for rewriting GitHub comments into English and for commit messages / titles; empty = the project's own model at low effort (Claude projects only)
    ANTHROPIC_API_KEYsk-ant-...Optional for the Claude path when local login is unavailable
    DEFAULT_REPOowner/repoOptional, default repo when pasting a bare PR number
    DB_PATH./data/cockpit.dbSQLite path
    WORKTREE_LOCATIONreporepo = IDE-visible .pr-cockpit-worktrees/ inside each local clone; central = use REPOS_DIR
    REPOS_DIR./data/worktreesWorktree root for central mode; legacy migration source in repo mode
    MAX_CONCURRENCY3Maximum number of parallel reviews

    Codex log hints

    • Not inside a trusted directory and --skip-git-repo-check was not specified: Codex started from a non-git directory. The project-page global assistant prefers the project's local path as its working directory; if you /cd to a non-git directory by hand, the runner skips the git repo check automatically.
    • CodexWarning failed to parse plugin hooks config .../claude-plugins-official/.../hooks.json: Codex picked up a Claude plugin's hook config and does not recognize that format. This warning normally just means the hook was ignored — it does not mean the current task failed.

    Directory layout

    core/      Engine: db / github / git(worktree) / agent(review·fix·feature·global·codex·skillgen) / automation / pipeline / events
    server/    Nuxt API: projects / reviews / fixes / features / global sessions / skills / SSE / startup recovery plugin
    app/       UI: project nav; project page (All PRs / Config + the project assistant drawer); PR drawer (AI review / Fix / Timeline / Changes)
    electron/  Desktop shell: starts Nitro and loads the local HTTP UI
    docs/      ARCHITECTURE.md — design goals + invariants + safety mechanisms
    data/      SQLite + migration source for legacy centralized worktrees (git-ignored)
    

    Design goals, invariants and safety defenses are detailed in docs/ARCHITECTURE.en.md.