-
Notifications
You must be signed in to change notification settings - Fork 967
feat: Add Gemini CLI support with TOML-based slash commands #256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add Gemini CLI support with TOML-based slash commands #256
Conversation
- Add GeminiSlashCommandConfigurator for .gemini/commands/openspec/ - Register Gemini CLI in AI_TOOLS config and slash command registry - Generate TOML files with description and prompt fields - Add comprehensive test coverage for Gemini CLI integration - Update README to list Gemini CLI under Native Slash Commands - Remove Gemini CLI from AGENTS.md compatible list (now native) Implements GitHub issue Fission-AI#248
WalkthroughAdds Gemini CLI support: new AI_TOOLS entry, a GeminiSlashCommandConfigurator that generates/updates OpenSpec TOML slash-command files ( Changes
Sequence Diagram(s)sequenceDiagram
participant User as User
participant Init as Init Process
participant Registry as Slash Registry
participant Gemini as GeminiSlashCommandConfigurator
participant FS as File System
User->>Init: run init, select "Gemini CLI"
Init->>Registry: request configurator for "gemini"
Registry-->>Init: return GeminiSlashCommandConfigurator
Init->>Gemini: generateAll(projectPath, openspecDir)
loop for each command (proposal/apply/archive)
Gemini->>FS: stat target TOML
alt exists
FS-->>Gemini: file exists
Gemini->>Gemini: generate TOML content with markers
Gemini->>FS: replace body between markers
FS-->>Gemini: write/update complete
else not exists
FS-->>Gemini: not found
Gemini->>Gemini: generate TOML content with markers
Gemini->>FS: write new TOML file
FS-->>Gemini: write complete
end
end
Gemini-->>Init: return created/updated paths
Init-->>User: init complete
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/core/configurators/slash/gemini.ts (1)
52-65: Consider TOML string escaping for robustness.The TOML generation works correctly for current content, but consider adding escaping for special characters to prevent potential issues if descriptions or body content ever contain double quotes or triple quotes.
For reference, proper TOML escaping would replace:
"with\"in the description field"""with escaped alternatives in multi-line strings (or use different delimiters)However, this is not critical given current usage patterns and would be caught by tests if it becomes an issue.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.changeset/add-gemini-cli-support.md(1 hunks)README.md(2 hunks)src/core/config.ts(1 hunks)src/core/configurators/slash/gemini.ts(1 hunks)src/core/configurators/slash/registry.ts(3 hunks)test/core/init.test.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (8)
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
PR: Fission-AI/OpenSpec#0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/changes/*/{proposal.md,tasks.md,design.md,specs/**/spec.md} : Scaffold each change with proposal.md, tasks.md, optional design.md, and delta spec files under openspec/changes/<change-id>/specs/<capability>/spec.md
Applied to files:
.changeset/add-gemini-cli-support.mdREADME.md
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
PR: Fission-AI/OpenSpec#0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Always open @/openspec/AGENTS.md when the request introduces new capabilities, breaking changes, architecture shifts, or major performance/security work
Applied to files:
README.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
PR: Fission-AI/OpenSpec#0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/project.md : Document project conventions in openspec/project.md and review it before starting work
Applied to files:
README.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
PR: Fission-AI/OpenSpec#0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/specs/**/spec.md : Keep current, deployed specs in openspec/specs/<capability>/spec.md (one focused capability per directory)
Applied to files:
README.md
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
PR: Fission-AI/OpenSpec#0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Use @/openspec/AGENTS.md to learn spec format and conventions
Applied to files:
README.md
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
PR: Fission-AI/OpenSpec#0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Use @/openspec/AGENTS.md to learn the project structure and guidelines
Applied to files:
README.md
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
PR: Fission-AI/OpenSpec#0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Use @/openspec/AGENTS.md to learn how to create and apply change proposals
Applied to files:
README.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
PR: Fission-AI/OpenSpec#0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/specs/*/ : Name capabilities with clear, single-purpose verb-noun directories (e.g., user-auth, payment-capture) and split if the description needs 'AND'
Applied to files:
README.md
🧬 Code graph analysis (4)
test/core/init.test.ts (1)
src/utils/file-system.ts (1)
fileExists(76-86)
src/core/config.ts (2)
src/core/init.ts (4)
promptForAITools(559-630)formatToolNames(919-934)configureAITools(763-786)InitCommand(376-970)test/core/update.test.ts (2)
configurators(939-956)consoleSpy(868-880)
src/core/configurators/slash/gemini.ts (2)
src/utils/file-system.ts (1)
FileSystemUtils(44-187)src/core/config.ts (1)
OPENSPEC_MARKERS(3-6)
src/core/configurators/slash/registry.ts (1)
src/core/configurators/slash/gemini.ts (1)
GeminiSlashCommandConfigurator(18-83)
🔇 Additional comments (10)
README.md (2)
99-99: LGTM! Documentation addition is accurate.The Gemini CLI entry follows the correct format and is consistent with similar tools (Claude Code, CodeBuddy) that use colon-separated command names.
116-116: LGTM! Correctly reflects Gemini CLI's move to native support.With Gemini CLI now having native slash command support, it's appropriately removed from the AGENTS.md compatible list.
.changeset/add-gemini-cli-support.md (1)
1-15: LGTM! Well-documented changeset.The changeset clearly describes the feature addition, includes all relevant details, and correctly uses a minor version bump for backward-compatible functionality.
src/core/config.ts (1)
27-27: LGTM! Configuration entry is correct.The Gemini CLI entry follows the established pattern with all required fields, and the
value: 'gemini'correctly matches the toolId used in the configurator.test/core/init.test.ts (1)
308-344: LGTM! Comprehensive test coverage for Gemini CLI.The test follows the established pattern for tool integration tests and validates:
- TOML file creation at correct paths
- TOML-specific format (description field, triple-quoted prompt)
- Presence of OpenSpec markers
- Expected content from templates
This aligns well with the 38 new test assertions mentioned in the PR summary.
src/core/configurators/slash/registry.ts (1)
12-12: LGTM! Registry integration follows the established pattern.The GeminiSlashCommandConfigurator is correctly imported, instantiated, and registered in the configurators map, consistent with all other tool configurators.
Also applies to: 31-31, 46-46
src/core/configurators/slash/gemini.ts (4)
6-16: LGTM! Constants are well-defined.The FILE_PATHS and DESCRIPTIONS constants are consistent with Gemini CLI's TOML-based command structure and match the test expectations.
18-29: LGTM! Class structure correctly implements the configurator pattern.The toolId correctly matches the config entry, and returning
undefinedfor frontmatter is appropriate since TOML embeds metadata in its structure rather than using separate frontmatter sections.
32-50: LGTM! The generateAll override appropriately handles TOML format.Overriding this method is necessary for TOML-specific generation logic, and the implementation correctly handles both new file creation and updates to existing files.
68-82: LGTM! The updateBody method correctly handles marker-based updates.The logic properly:
- Validates marker presence and ordering
- Preserves content outside markers (including the markers themselves)
- Updates only the content between markers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
test/core/init.test.ts (1)
308-344: LGTM! Comprehensive test coverage for Gemini TOML generation.The test correctly validates:
- Creation of all three TOML files under
.gemini/commands/openspec/- TOML format with
descriptionandpromptfields- Triple-quoted multiline strings (
""") for prompt content- OpenSpec markers and expected command content
Consider adding an extend mode test for consistency.
Most other tools include a test verifying "already configured" behavior during extend mode (see lines 877-887 for Auggie, 932-942 for CodeBuddy, etc.). Consider adding:
it('should mark Gemini as already configured during extend mode', async () => { queueSelections('gemini', DONE, 'gemini', DONE); await initCommand.execute(testDir); await initCommand.execute(testDir); const secondRunArgs = mockPrompt.mock.calls[1][0]; const geminiChoice = secondRunArgs.choices.find( (choice: any) => choice.value === 'gemini' ); expect(geminiChoice.configured).toBe(true); });This ensures Gemini follows the same extend mode behavior as other configurators.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
README.md(2 hunks)src/core/config.ts(1 hunks)src/core/configurators/slash/registry.ts(3 hunks)test/core/init.test.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/core/config.ts
- README.md
🧰 Additional context used
🧬 Code graph analysis (2)
test/core/init.test.ts (1)
src/utils/file-system.ts (1)
fileExists(76-86)
src/core/configurators/slash/registry.ts (1)
src/core/configurators/slash/gemini.ts (1)
GeminiSlashCommandConfigurator(18-83)
🔇 Additional comments (1)
src/core/configurators/slash/registry.ts (1)
13-13: LGTM! Gemini configurator properly registered.The import, instantiation, and registration of
GeminiSlashCommandConfiguratorfollow the established pattern used by other configurators in the registry.Also applies to: 34-34, 51-51
TabishB
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @larryhopecode I'm keen to merge this in but it needs 2 tweaks.
1 - Let's remove the changeset for now, I'm planning to bundle in a few changes. This will currently trigger a PR to do a release.
2 - We need a small test to test the update/refresh path for this integration.
I was hoping to add these small tweaks in myself, but it seems like this has been forked using an org account, which prevents me from actually making edits to the PR even as a maintainer (I didn't realise this about github).
Feel free to make the above edits yourself or push the PR from a personal account and I can handle the rest.
- Remove .changeset/add-gemini-cli-support.md as requested by maintainer - Add test for Gemini CLI TOML update/refresh path - Test verifies that existing TOML files are properly updated when running init again Addresses feedback from TabishB in PR Fission-AI#256
|
@TabishB I've addressed both requests:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
test/core/init.test.ts (1)
346-373: LGTM! Proper validation of the marker-based refresh mechanism.This test correctly verifies that re-running init will replace content between OpenSpec markers, removing user customizations. This refresh behavior is consistent with how other tool configurators handle updates.
Optional: Consider adding an "already configured in extend mode" test for consistency.
For consistency with other tools (Windsurf line 768, Codex line 780, Factory line 792, etc.), consider adding a test to verify that Gemini is marked as "already configured" during extend mode:
it('should mark Gemini as already configured during extend mode', async () => { queueSelections('gemini', DONE, 'gemini', DONE); await initCommand.execute(testDir); await initCommand.execute(testDir); const secondRunArgs = mockPrompt.mock.calls[1][0]; const geminiChoice = secondRunArgs.choices.find( (choice: any) => choice.value === 'gemini' ); expect(geminiChoice.configured).toBe(true); });This is not critical since the pattern is already validated for other tools, but it would improve consistency across the test suite.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.repo-updates-log(1 hunks)test/core/init.test.ts(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- .repo-updates-log
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/changes/*/{proposal.md,tasks.md,design.md,specs/**/spec.md} : Scaffold each change with proposal.md, tasks.md, optional design.md, and delta spec files under openspec/changes/<change-id>/specs/<capability>/spec.md
Applied to files:
test/core/init.test.ts
🧬 Code graph analysis (1)
test/core/init.test.ts (1)
src/utils/file-system.ts (1)
fileExists(76-86)
🔇 Additional comments (1)
test/core/init.test.ts (1)
308-344: LGTM! Comprehensive test coverage for Gemini CLI TOML generation.The test properly verifies:
- Creation of all three command files (proposal, apply, archive) with correct paths
- TOML-specific syntax (
description = "..."andprompt = """)- Presence of OpenSpec markers for future updates
- Expected prompt content for each command type
The test follows the established pattern used for other AI tools and includes appropriate assertions for the TOML file format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
README.md (1)
150-150: Update documentation references to include Gemini CLI in native tool mentions.Two locations reference supported tools by name and omit Gemini CLI:
- Line 150: Example list ends with "etc." (non‑exhaustive), but Gemini CLI deserves explicit mention alongside other major CLI tools.
- Line 236: Explicit list "(Claude Code, CodeBuddy, Cursor, Codex, Qoder)" is stated as tools "with native slash commands" and should include Gemini CLI.
Apply this diff to improve clarity:
- You'll be prompted to pick any natively supported AI tools (Claude Code, CodeBuddy, Cursor, OpenCode, Qoder,etc.); other assistants always rely on the shared `AGENTS.md` stub + You'll be prompted to pick any natively supported AI tools (Claude Code, CodeBuddy, Cursor, OpenCode, Qoder, Gemini CLI, etc.); other assistants always rely on the shared `AGENTS.md` stub- Tools with native slash commands (Claude Code, CodeBuddy, Cursor, Codex, Qoder) can use the shortcuts shown. All other tools work with natural language requests to "create an OpenSpec proposal", "apply the OpenSpec change", or "archive the change". + Tools with native slash commands (Claude Code, CodeBuddy, Cursor, Codex, Qoder, Gemini CLI) can use the shortcuts shown. All other tools work with natural language requests to "create an OpenSpec proposal", "apply the OpenSpec change", or "archive the change".This keeps the documentation in sync with the expanded native tool support.
Also applies to: 236-236
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
README.md(2 hunks)src/core/config.ts(1 hunks)src/core/configurators/slash/registry.ts(3 hunks)test/core/init.test.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- src/core/config.ts
- src/core/configurators/slash/registry.ts
- test/core/init.test.ts
🧰 Additional context used
🧠 Learnings (9)
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Always open @/openspec/AGENTS.md when the request introduces new capabilities, breaking changes, architecture shifts, or major performance/security work
Applied to files:
README.md
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Use @/openspec/AGENTS.md to learn how to create and apply change proposals
Applied to files:
README.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/changes/*/specs/**/spec.md : Use ADDED, MODIFIED, REMOVED, or RENAMED sections when authoring deltas; place changed requirements under the correct operation header
Applied to files:
README.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/changes/*/{proposal.md,tasks.md,design.md,specs/**/spec.md} : Scaffold each change with proposal.md, tasks.md, optional design.md, and delta spec files under openspec/changes/<change-id>/specs/<capability>/spec.md
Applied to files:
README.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/project.md : Document project conventions in openspec/project.md and review it before starting work
Applied to files:
README.md
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Use @/openspec/AGENTS.md to learn spec format and conventions
Applied to files:
README.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/specs/**/spec.md : Keep current, deployed specs in openspec/specs/<capability>/spec.md (one focused capability per directory)
Applied to files:
README.md
📚 Learning: 2025-10-21T03:05:07.856Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-21T03:05:07.856Z
Learning: Use @/openspec/AGENTS.md to learn the project structure and guidelines
Applied to files:
README.md
📚 Learning: 2025-10-22T06:05:06.615Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-10-22T06:05:06.615Z
Learning: Applies to openspec/specs/*/ : Name capabilities with clear, single-purpose verb-noun directories (e.g., user-auth, payment-capture) and split if the description needs 'AND'
Applied to files:
README.md
🔇 Additional comments (2)
README.md (2)
100-100: Native Slash Commands table entry is well‑formatted.Line 100 correctly adds Gemini CLI to the Native Slash Commands table with proper formatting, command syntax (
/openspec:proposal,/openspec:apply,/openspec:archive), and path structure (.gemini/commands/openspec/). The entry is consistent with similar CLI-based tools (CodeBuddy, Qoder).
119-119: Removal from AGENTS.md Compatible section is appropriate.Moving Gemini CLI from the AGENTS.md Compatible fallback table to the Native Slash Commands table correctly reflects its new first-class support. The edit removes "Gemini CLI" and preserves "Amp • Jules • Others", maintaining section integrity.
|
Wait for your approval for merge. Would love to use this with Gemini |
TabishB
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @larryhopecode thanks for getting the changes fixed. I'll get this merged now, and will be released soon (hopefully tomorrow).
| @@ -0,0 +1,13 @@ | |||
| ## Repository Updates Log | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to track this, this can be dropped
|
Nice |
|
@larryhopecode Just in time for gemini 3 :) |
|
Wow. It works very well with Gemini 3!!!! |
…AI#256) * feat: add Gemini CLI support with TOML-based slash commands - Add GeminiSlashCommandConfigurator for .gemini/commands/openspec/ - Register Gemini CLI in AI_TOOLS config and slash command registry - Generate TOML files with description and prompt fields - Add comprehensive test coverage for Gemini CLI integration - Update README to list Gemini CLI under Native Slash Commands - Remove Gemini CLI from AGENTS.md compatible list (now native) Implements GitHub issue Fission-AI#248 * [add] * feat: address PR feedback - remove changeset and add update test - Remove .changeset/add-gemini-cli-support.md as requested by maintainer - Add test for Gemini CLI TOML update/refresh path - Test verifies that existing TOML files are properly updated when running init again Addresses feedback from TabishB in PR Fission-AI#256 --------- Co-authored-by: Tabish Bidiwale <30385142+TabishB@users.noreply.github.com>
Summary
Adds native support for Google's Gemini CLI to OpenSpec, implementing GitHub issue #248.
Changes
GeminiSlashCommandConfiguratorfor.gemini/commands/openspec/directorydescriptionandpromptfields/openspec:proposal,/openspec:apply,/openspec:archiveTesting
pnpm buildChangeset
Added minor version changeset for this feature addition.
Closes #248
Summary by CodeRabbit
New Features
Tests
Documentation