Skip to content

feat: Add Google Gemini CLI adapter with full export, run, and import support#41

Open
AJAmit17 wants to merge 5 commits intoopen-gitagent:mainfrom
AJAmit17:feat/gemini-cli
Open

feat: Add Google Gemini CLI adapter with full export, run, and import support#41
AJAmit17 wants to merge 5 commits intoopen-gitagent:mainfrom
AJAmit17:feat/gemini-cli

Conversation

@AJAmit17
Copy link

What

Added Google Gemini CLI adapter for gitagent with full export, run, and import support.

Why

Enables gitagent users to work with Google's Gemini CLI format, allowing them to export agents to Gemini CLI, run agents using the gemini runtime, and import existing Gemini CLI projects.

Closes #33

How Tested

  • npm run build passes
  • gitagent validate passes on example agents
  • Manual testing:
    - gitagent export --format gemini -d examples/full generates valid files
    - gitagent run -d examples/full --adapter gemini -p "test" executes successfully
    - gitagent import --from gemini <path> creates valid agent.yaml
    - Hooks work on Windows (bash scripts execute via PowerShell)

Checklist

  • My code follows the existing style of this project
  • I have updated documentation (if applicable)
  • I have read the CONTRIBUTING.md

Add `gemini` format that generates GEMINI.md and .gemini/settings.json compatible with Google Gemini CLI.

The adapter maps gitagent's SOUL.md, RULES.md, skills, knowledge, and compliance constraints into Gemini's instruction format. Import reads GEMINI.md and settings.json to reconstruct agent.yaml with model preferences and approval mode mappings (plan→always, default→conditional, yolo→none, auto_edit→advisory).
Add `gemini` runner that creates temp workspace with GEMINI.md and .gemini/settings.json, then launches `gemini` CLI in interactive or single-shot mode (`-p` flag).

The runner copies hooks directory if present, maps approval modes to CLI flags (plan/default/yolo/auto_edit), and handles Windows shell quoting for args with spaces.

Also fixes buildHooksConfig to check hooks.yaml existence inside try block and use consistent null
… CLI

On Windows, Gemini CLI uses PowerShell which can't execute .sh files directly. Prepend 'bash' and include the hooks/ directory path when the script ends with .sh on win32 platform.
…pter

Previously only Windows .sh scripts got the hooks/ prefix. Now all hook scripts include the hooks/ directory path, with Windows .sh scripts additionally getting the 'bash' prefix.
@AJAmit17 AJAmit17 changed the title Feat/gemini cli feat: Add Google Gemini CLI adapter with full export, run, and import support Mar 23, 2026
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.

[Adapter] Google Gemini CLI

1 participant