Skip to content

feat(install-gate): Gemini CLI + Cursor adapters (5 agents now enforced) - #153

Merged
sandstream merged 1 commit into
mainfrom
feat/install-gate-gemini-cursor
Jun 27, 2026
Merged

sandstream merged 1 commit into
mainfrom
feat/install-gate-gemini-cursor

Conversation

@sandstream

Copy link
Copy Markdown
Owner

Track #1 (extend agent coverage) — adds the two more agents with a verified exit-2 blocking hook, taking the install-gate from 3 → 5 enforced agents.

Research outcome (the 5 remaining agents)

Agent Blocking hook? How Wired here?
Gemini CLI ✅ BeforeTool exit 2, tool_input.command ✅
Cursor ✅ beforeShellExecution exit 2 / {permission:"deny"}, top-level command ✅
Cline ✅ PreToolUse JSON {cancel:true} (not exit 2) ⏳ #146 (different output protocol)
OpenCode ✅ tool.execute.before JS plugin throws ⏳ #146 (JS-plugin integration)
Continue ❓ unverified — ⏳ #146

Changes

  • Handler now reads top-level command in addition to tool_input.command (Cursor puts the shell string at top level). Gemini uses tool_input.command like the others. exit 2 = deny across all five.
  • installInstallGateGemini → BeforeTool hook in .gemini/settings.json.
  • installInstallGateCursor → beforeShellExecution hook in .cursor/hooks.json.
  • installAllInstallGates / kit agent-config --install-gate now wire all five present agents.

Verified vs primary docs (geminicli.com/docs/hooks, cursor.com/docs/hooks). Tests: Gemini + Cursor wiring (create/idempotent/skip). Full suite 1837/0, format/lint clean.

Cline/OpenCode/Continue use a different block mechanism (JSON-cancel / JS-throw / unverified) and are tracked in #146; the agent-agnostic git-hook layer covers them regardless.


🤖 Generated with Claude Code

https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg


Generated by Claude Code

Extends the install-gate to the two more agents with a verified exit-2
blocking hook (research, #146):

- Handler: also reads top-level `command` (Cursor's beforeShellExecution puts
  the shell string there, not under tool_input); Gemini uses tool_input.command
  like Claude/Codex/Amazon Q. exit 2 = deny across all five.
- installInstallGateGemini: BeforeTool hook in .gemini/settings.json (same
  nested shape as Claude; tool_input.command + exit 2).
- installInstallGateCursor: beforeShellExecution hook in .cursor/hooks.json
  (top-level command + exit 2 / {permission:"deny"}).
- installAllInstallGates + `kit agent-config --install-gate` now wire all five
  present agents: Claude Code, Codex, Amazon Q, Gemini CLI, Cursor.

Verified vs primary docs: geminicli.com/docs/hooks (BeforeTool, exit 2,
tool_input.command) and cursor.com/docs/hooks (beforeShellExecution, top-level
command, exit 2 = deny). Tests: Gemini + Cursor wiring (create/idempotent/skip).
Full suite green.

Not yet wired (different integration shape — tracked in #146): Cline (JSON
{cancel:true}, not exit 2), OpenCode (JS plugin that throws), Continue
(unverified). The agent-agnostic git-hook layer still covers all of them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit 7ed5423 into main Jun 27, 2026
16 checks passed
@sandstream
sandstream deleted the feat/install-gate-gemini-cursor branch June 30, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants