Conversation
added 4 commits
April 14, 2026 22:10
Add Google Gemini CLI as a new backend option for inline-cli. The gemini backend follows the same lazy-resolution pattern as the existing CLIBackend, invoking `gemini -p <prompt>` and streaming stdout chunks for real-time output. Changes: - internal/backend/gemini.go: new GeminiBackend implementation - internal/config/config.go: add GeminiPath config field and INLINE_CLI_GEMINI_PATH env var override - internal/daemon/server.go: wire "gemini" case in createBackend()
The gemini CLI needs -o text to ensure plain text on stdout. Also skip passing --model since the inline-cli default (claude-sonnet) is invalid for gemini. Add 8 tests covering construction, resolution, query, history, and error handling.
Instead of showing a generic "exit status 1", capture stderr and surface the first line in the error message (e.g. the actual API error from gemini). Falls back to the generic message if stderr is empty.
Keep both gemini and opencode backend entries in config and server.
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.
Summary
Add Gemini CLI (
gemini) as a new backend for inline-cli, enabling users to route queries through the Google Gemini CLI.internal/backend/gemini.go— implements theBackendinterface by invokinggemini -p <prompt> -o textand streaming plain text stdout--model— lets gemini use its own configured defaultgemini_pathin TOML /INLINE_CLI_GEMINI_PATHenv var for custom binary path"gemini"case intocreateBackend()ininternal/daemon/server.goFiles changed
internal/backend/gemini.gointernal/backend/gemini_test.gointernal/config/config.goGeminiPathfield and env var overrideinternal/daemon/server.go"gemini"case tocreateBackend()Usage
Or via environment variable:
export INLINE_CLI_BACKEND=geminiTest plan
go build ./...passesgo test ./... -racepasses (9 backend tests)gemini -p <prompt> -o text