Skip to content

Add Gemini CLI extension support as a third platform#26

Open
myavalka wants to merge 2 commits into
mainfrom
gemini-cli-support
Open

Add Gemini CLI extension support as a third platform#26
myavalka wants to merge 2 commits into
mainfrom
gemini-cli-support

Conversation

@myavalka

Copy link
Copy Markdown
Collaborator

Description

Adds Google Gemini CLI as a third supported platform alongside Codex and Claude Code, keeping the repo's single-source philosophy — Gemini natively supports the Agent Skills standard, so all 13 skills in skills/ are consumed as-is with no duplication or build step.

New files

  • gemini-extension.json — root manifest read by gemini extensions install <repo-url> (no marketplace file needed)
  • GEMINI.md — lean runtime context (settings paths, SDK header rule, setup pointer)
  • commands/configure.toml/configure onboarding entry point; all other skills auto-activate from natural language
  • hooks/claude-hooks.json — Claude/Codex PreToolUse hook config (see below)

Changes

  • Hook configs are split per platform: hooks/hooks.json is now Gemini-only (BeforeTool, Gemini's fixed auto-discovery path) and hooks/claude-hooks.json holds the Claude/Codex PreToolUse config, declared explicitly in both plugin manifests. A merged file was tried first, but Gemini warns Invalid hook event name: "PreToolUse" on launch.
  • check-token.sh detects the platform from hook_event_name, takes the project dir from stdin cwd on Gemini, uses a three-way settings fallback (.gemini/ added), and emits Gemini's tool_input output schema when rewriting commands.
  • All skill/agent setup sections gain the three-way settings fallback, the gemini-extension.json version source, and the gemini-cli-extension SDK product for the X-Spotify-Ads-Sdk header.
  • README, AGENTS.md, CONTRIBUTING, settings template, and test scenarios updated; version bumped to 1.5.0 across all three manifests.

Testing done

  • Gemini CLI (via gemini extensions link): extension loads, skills auto-activate from natural language, GEMINI.md context picked up, settings discovery falls back correctly and prompts for /configure when unconfigured, no startup warnings after the hook split.
  • Hook script smoke-tested by piping simulated BeforeTool and PreToolUse payloads: platform detection, three-way settings preference, and expiry detection all behave correctly on both paths.
  • Still pending: full OAuth flow + live API scenarios on Gemini, and a Claude/Codex regression pass now that their hook config is declared via the manifest hooks field instead of auto-discovery. Suggest tagging v1.5.0 after merge and verifying gemini extensions install from the GitHub URL.

Checklist

  • Tested against the Spotify Ads API with Codex, Claude Code, or Gemini CLI (partial — see Testing done)
  • Existing skills still work as expected
  • SKILL.md frontmatter is valid (name, description, allowed-tools)
  • README or CHANGELOG updated (if user-facing change)
  • Curl commands follow API conventions documented in AGENTS.md

🤖 Generated with Claude Code

myavalka and others added 2 commits June 10, 2026 10:13
Problem

The plugin supports Codex and Claude Code from a single shared markdown
source, but users on Google's Gemini CLI have no way to install or use
it.

Solution

Add Gemini CLI as a third target while keeping the single-source
philosophy. Gemini natively supports the Agent Skills standard, so the
existing skills/ tree is consumed as-is with no duplication. New files:
a root gemini-extension.json manifest, a lean GEMINI.md context file,
and a /configure custom command as the onboarding entry point. The
token-refresh hook is split into per-platform configs (hooks/hooks.json
for Gemini's BeforeTool event, hooks/claude-hooks.json for Claude/Codex
PreToolUse) because each platform warns on the other's event names;
check-token.sh detects the platform from hook_event_name and emits
Gemini's tool_input output schema when rewriting commands. Settings
lookup becomes a three-way fallback across .codex/, .claude/, and
.gemini/, and the SDK tracking header gains a gemini-cli-extension
product. Docs, test scenarios, and the PR template are updated, and the
version is bumped to 1.5.0 across all three manifests.

Result

Gemini CLI users can install the plugin with
gemini extensions install https://github.com/spotify/ads-agentic-tools
(or gemini extensions link for local development), with skills
auto-activating from natural language and OAuth tokens refreshing
automatically. Codex and Claude Code behavior is unchanged.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Scenario 10's setup listed only the Codex and Claude settings files and
named the hook event as PreToolUse, which does not exist on Gemini.
Add the .gemini settings path and platform-aware hook event naming so
the scenario is runnable on all three platforms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

1 participant