feat(gemini): Gemini CLI plan review integration#384
Open
backnotprop wants to merge 3 commits intomainfrom
Open
feat(gemini): Gemini CLI plan review integration#384backnotprop wants to merge 3 commits intomainfrom
backnotprop wants to merge 3 commits intomainfrom
Conversation
Adds a new `apps/gemini-hook/` adapter that enables Plannotator plan review for Gemini CLI users via the BeforeTool hook system. The adapter reads the plan file from disk (Gemini provides a path, not inline content), delegates to the shared @plannotator/server for the browser-based review UI, and translates the decision back into Gemini's hook output format. Requires an upstream fix (google-gemini/gemini-cli#21802) that makes `decision = "allow"` user policies work for exit_plan_mode, allowing hooks to replace the built-in TUI approval dialog. Includes: - apps/gemini-hook/server/index.ts — stdin/stdout adapter - apps/gemini-hook/hooks/ — policy TOML + settings snippet - scripts/install.sh — Gemini binary download, policy install, settings config For provenance purposes, this commit was AI assisted.
…parate app Removes apps/gemini-hook/ — the plannotator binary now auto-detects Gemini CLI from stdin (plan_path = file on disk) vs Claude Code (plan = inline content) and branches input parsing + output formatting. Config fixtures live in apps/gemini/ (policy TOML + settings snippet). Install script gates on ~/.gemini existing so Claude-only users are unaffected. For provenance purposes, this commit was AI assisted.
Three modes: - --simulate: pipes BeforeTool JSON to hook, tests approve/deny output - (default): runs local patched Gemini build - --nightly: installs Gemini nightly and runs it Backs up and restores ~/.gemini config on exit. For provenance purposes, this commit was AI assisted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apps/gemini-hook/— a thin adapter that enables Plannotator plan review for Gemini CLI via theBeforeToolhook systemplan_path, not inline content), delegates to shared@plannotator/server, translates decision to Gemini's hook output format~/.gemini/policies/, and configure~/.gemini/settings.jsonHow it works
plannotator.toml) grantsallowforexit_plan_mode→ skips TUI dialogBeforeToolhook fires →plannotator-geminibinary startsplanDenyFeedback(), revises planDepends on upstream fix: google-gemini/gemini-cli#21802 (merged)
Test plan
echo '<BeforeTool JSON>' | bun run apps/gemini-hook/server/index.tsopens browser with plan{}{"decision":"deny","reason":"YOUR PLAN WAS NOT APPROVED..."}/plan→ task → plan appears in browser → approve/deny works