feat: Add Google Gemini CLI adapter with full export, run, and import support#41
Open
AJAmit17 wants to merge 5 commits intoopen-gitagent:mainfrom
Open
feat: Add Google Gemini CLI adapter with full export, run, and import support#41AJAmit17 wants to merge 5 commits intoopen-gitagent:mainfrom
AJAmit17 wants to merge 5 commits intoopen-gitagent:mainfrom
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 buildpassesgitagent validatepasses on example agents-
gitagent export --format gemini -d examples/fullgenerates 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