Skip to content

Add Gemini CLI support: the event mapping is machine-generated, but the migration output would not run here #456

Closed

Description

@fdaviddpt

Scoped from #406's Gemini arm after installing the binary rather than reasoning from docs, the same way the Codex arm was settled. Everything below is observed against gemini 0.57.0 on macOS 15.3.2 arm64 unless labelled otherwise.

What the install itself teaches

Install from npm, not Homebrew. The gemini-cli formula is 0.46.0, marked "Deprecated because it is not supported upstream", disabled 2026-12-18, and points at antigravity-cli — a different product. Upstream is alive and eleven minor versions ahead: @google/gemini-cli is 0.57.0 latest with a nightly cut the same day. Anyone documenting an install route should write the npm one.

The event mapping does not need designing — Gemini generates it

gemini hooks migrate --from-claude exists and is a first-class subcommand (gemini hooks migrate, "Migrate hooks from Claude Code to Gemini CLI"). Fed this repository's actual hooks/hooks.json as a Claude settings file, it produced a complete .gemini/settings.json:

Ours Gemini's
SessionStart SessionStart
SessionEnd SessionEnd
UserPromptSubmit BeforeAgent
PostToolUse AfterTool

It also emits empty arrays for the events we bind nothing to: BeforeTool, AfterAgent, Notification, PreCompress, BeforeModel, AfterModel, BeforeToolSelection.

So the translation layer this arm looked like it needed is upstream's, not ours. What we owe is a checked-in manifest, not a mapping.

The migration output would not work, and the reason is already fixed elsewhere

The generated file carries our command strings verbatim:

"command": "bash \"${CLAUDE_PLUGIN_ROOT}/scripts/session-start-hook.sh\""

CLAUDE_PLUGIN_ROOT is a variable Gemini does not set. The migration is a rename of event keys, not a port of the command bodies — reasonable of it, and fatal if the output is used unedited.

#407 already landed the answer: scripts/resolve-paths.sh reads ${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}, vendor-neutral name first, and tests/test_host_shell_parity_407.py pins the shell list against pipeline/host.PLUGIN_ROOT_VARS. A Gemini manifest should spell it ${PLUGIN_ROOT} — assuming Gemini expands that in a hook command at all, which is not yet observed.

Extension packaging

gemini extensions new <path> scaffolds, and the manifest is minimal:

{ "name": "gemtest", "version": "1.0.0" }

gemini extensions link <path> installs from a local path with edits reflected live, and gemini extensions validate <path> checks one — between them a development loop exists that does not need a marketplace, which is a better position than the Codex arm started from.

Open, and not guessable: whether a gemini-extension.json can carry hooks the way .codex-plugin/plugin.json bundles hooks/hooks.json, or whether hooks only ever live in .gemini/settings.json at project or user scope. That decides whether this ships as an installable extension or as documentation telling a user to run the migration themselves. Answer it before writing the manifest.

What is already Gemini-shaped and needs nothing

Three landed fixes name Gemini in their own reasoning and should carry over untouched — #407 (PLUGIN_ROOT over CLAUDE_PLUGIN_ROOT), #411 and #444 (the stdin cwd fallback on all four hooks, because Gemini documents no hook environment variables at all). pipeline/host.py already declares GEMINI = Host(name="gemini-cli").

What is unknown, and what the Codex arm predicts about it

The Codex arm's premise held and still produced four defects nobody predicted (#443, #444, #451, plus the harness one in #454). Expect the same ratio here. Named unknowns, all reachable with the binary now installed:

What would settle it

Install (done), then the same loop that worked for Codex: link a local extension, run one real session, read .remember/logs/memory-*.log, and believe the log over the docs. Each thing it breaks on becomes its own issue rather than being folded in here.

Part of #406.

Activity

  1. added
    enhancement
    priority:medium
    cohort-3
    cohort-4
    and removed
    cohort-4
    on Aug 29, 2026
  2. self-assigned this
    on Sep 4, 2026
  3. added a commit that references this issue on Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cohort-3enhancementpriority:medium

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions