forge-dispatch
v0.4.2
Published
Run agentforge's Claude Code subagents headlessly, push branches, and post review findings as GitHub PR comments — or launch them in the Claude Code VS Code extension's chat panel.
Maintainers
Readme
forge-dispatch
Run agentforge's Claude Code subagents directly from the CLI — no VS Code, no copy-pasting prompts.
Install
Recommended — global install:
npm install -g forge-dispatchThis installs the fd command, usable from any project on your machine — JS or not. Nothing gets written to the project you run it in beyond what agentforge scaffolds (.claude/agents/*.md, .claude/settings.json, CLAUDE.md); no package.json or node_modules required in that project.
Alternative — local install, JS projects only: if your team wants everyone using the same pinned forge-dispatch version instead of relying on whatever's globally installed per-machine, add it as a dev dependency:
npm install --save-dev forge-dispatchThen run it via npx fd review or an npm script ("scripts": { "review": "fd review" }). This only works in projects that already have package.json/npm — non-JS projects should use the global install above.
Usage
fd review # run the code-reviewer subagent headlessly, save findings to a markdown file
fd secure # run the security-reviewer subagent headlessly, save findings to a markdown file
fd pr # push the current branch, create/update a PR, and post findings as GitHub commentsreview and secure run entirely via the claude CLI (no VS Code involved) and write their findings to .forge-dispatch/reviews/<agent>-[branch-]<timestamp>.md in the current project, printing the file path when done. .forge-dispatch/ is automatically added to .gitignore on first use.
pr operates on whatever branch is currently checked out (no --branch flag) and runs entirely via the claude and gh CLIs:
- Confirms with you before doing anything ("This will push '<branch>' to origin and create/update a PR against '<base>'. Continue?").
- Pushes the current branch and creates a PR against
--base(defaultmain), or reuses the existing open PR for that branch if one already exists — safe to re-run after pushing more commits. - Runs
branch-code-reviewerandbranch-security-reviewerheadlessly, asking each to save its findings as JSON to a file under.forge-dispatch/findings/. If that file exists and parses, its findings are posted as inline, line-anchored PR comments; otherwise the agent's full markdown review is posted as one general comment. Re-runningfd prupdates those comments in place rather than duplicating them.
Add --interactive to review, secure, or pr to fall back to the old behavior instead: opening Claude Code chat tab(s) pre-filled with the prompt, which you submit yourself — no headless execution, no gh/GitHub calls.
Reviewing a branch instead of the whole project
Pass --branch <name> to fd review/fd secure to scope the review to a branch's changes instead of the whole project. This dispatches to agentforge's branch-scoped agents (branch-code-reviewer / branch-security-reviewer) instead of the whole-project ones:
fd review --branch feature/my-branch # diff against main (default)
fd review --branch feature/my-branch --base develop
fd secure --branch feature/my-branchfd pr doesn't take --branch — it always operates on the currently checked-out branch, since that's the one being pushed.
Requirements
- The Claude Code CLI (
claude) installed and on yourPATH(npm install -g @anthropic-ai/claude-code), for headlessfd review/fd secure/fd pr. - The GitHub CLI (
gh), installed and authenticated (gh auth login), forfd pr. Ifghisn't installed or isn't authenticated,fd prchecks this up front (before pushing anything) and tells you which one it is and how to fix it — no partial pushes or half-finished PRs from a failed auth check. - The Claude Code VS Code extension installed and VS Code running, for
--interactivemode. .claude/agents/code-reviewer.mdand.claude/agents/security-reviewer.mdin your project, scaffolded by@alexeino/agentforge'sforge init. If they're missing,fdwill offer to runnpx @alexeino/agentforge@latest initfor you — always the newest published agentforge, never a stale cached version. This only scaffolds missing files; it won't touch or overwrite agent files a project already has, even if they're from an older agentforge version — re-runnpx @alexeino/agentforge@latest inityourself to refresh those.- For
--branchandfd pr, agentforge >= 1.0.2 (scaffoldsbranch-code-reviewer.mdandbranch-security-reviewer.md— older versions hardcoded HEAD as the reviewed branch). - For inline PR comments specifically, agentforge >= 1.0.4 (branch-scoped agents write structured findings to a file when asked; older versions only produce freeform markdown, so
fd prfalls back to general comments).
License
ISC
