Go-first CLI agent inspired by google-gemini/gemini-cli.
⚠️ Public preview. Unofficial Go reimplementation with a smaller feature set than the upstream Node.js CLI. Expect rough edges and feature gaps while parity work continues.
This repo is not an official Google project. It intentionally ships a smaller,
still-evolving subset of google-gemini/gemini-cli while the core loop,
interactive UX, and auth flows are stabilized.
- Native release binaries with no Node.js, npm, or npx requirement.
- Straightforward install and distribution for terminal-first environments.
- Cross-platform builds from a single Go codebase.
- Familiar tooling for Go-centric teams and infrastructure.
- Interactive prompt with streaming responses (raw output mode).
- Input editing with history, multiline (Ctrl+J), and paste-friendly line continuation.
- Markdown rendering with syntax highlighting when output is a TTY.
- Headless mode via
--promptor piped stdin. - Basic tool execution loop (function calls → execute → return results).
- Built-in tools:
read_file,read_many_files,write_file,replace,run_shell_command,google_web_search,web_fetch.- Read tools are enabled and run immediately.
- Write/edit/shell tools prompt for confirmation before execution.
google_web_searchandweb_fetchare only available withGEMINI_API_KEYauth.web_fetchlocal/private URL fallback is disabled by default and can be enabled withtools.webFetch.allowPrivate=true.
- Tool approval modes:
default,auto_edit,yolo,plan.yoloauto-approves all tools (including shell); use with caution.
/modelcommand to show or switch the active model (persisted globally).@path/to/filereferences to include file context (respects.gitignore)./chatcheckpoints (save/list/resume/delete/share)./memorycommand to show/list/refresh/add GEMINI.md context./authcommand in the interactive UI for sign-in/sign-out.
Detailed matrix: docs/upstream-parity.md
| Capability | Status here | Notes relative to upstream |
|---|---|---|
| Interactive chat | Supported | Core REPL loop, streaming responses, tool execution, and prompt editing are implemented. |
| Headless prompt mode | Partial | --prompt and piped stdin work; structured output flags are not implemented yet. |
| Google OAuth | Supported | Usable today, but the current default client is a temporary public-preview compatibility setup. |
| API key auth | Supported | Stable fallback; google_web_search and web_fetch currently require API key auth. |
| Built-in tools | Partial | read_file, read_many_files, write_file, replace, run_shell_command, google_web_search, and web_fetch are implemented; line-oriented edit is not. |
| Slash commands | Partial | /help, /clear, /quit, /model, /chat, /resume, /memory, and /auth are implemented; /about, /settings, /compress, and /vim are not. |
| MCP and extensions | Missing | Not implemented yet. |
| Output format flags | Missing | No --json or --streaming-json support yet. |
| Themes and Vim mode | Missing | Not implemented yet. |
| Checkpoint restore / rewind | Missing | /restore and /rewind are not implemented yet. |
This table is the short version. For feature-by-feature parity against a pinned
upstream baseline, see docs/upstream-parity.md.
- MCP integration and extension support.
- Line-oriented edit tool.
- Output format flags (JSON/streaming JSON).
- UI themes and Vim mode.
- Checkpointing (/restore, /rewind).
Release archives and SHA256SUMS are published on
Releases.
Available assets:
gemini-cli-go_<version>_darwin_amd64.tar.gzgemini-cli-go_<version>_darwin_arm64.tar.gzgemini-cli-go_<version>_linux_amd64.tar.gzgemini-cli-go_<version>_linux_arm64.tar.gzgemini-cli-go_<version>_windows_amd64.zip
macOS/Linux example:
VERSION=v0.1.0
ASSET=gemini-cli-go_${VERSION}_darwin_arm64.tar.gz
curl -LO "https://github.com/puremachinery/gemini-cli-go/releases/download/${VERSION}/${ASSET}"
tar -xzf "${ASSET}"
chmod +x gemini-cli
sudo mv gemini-cli /usr/local/bin/Verify the download against the matching release SHA256SUMS before moving it
into PATH.
Windows:
- Download
gemini-cli-go_<version>_windows_amd64.zipfrom the release page. - Unzip it and place
gemini-cli.exesomewhere on yourPATH.
Prerequisite: Go 1.25.0+
Install directly:
go install github.com/puremachinery/gemini-cli-go/cmd/gemini-cli@latestBuild from source:
go build -o bin/gemini-cli ./cmd/gemini-cliRun:
./bin/gemini-cliOr install locally:
go install ./cmd/gemini-cliInteractive:
gemini-cliHeadless (non-interactive):
gemini-cli --prompt "Summarize this repo"
echo "input" | gemini-cli --prompt "Summarize"Positional prompts open the interactive UI when stdin is a TTY:
gemini-cli "What is this project?"Tool approval modes:
gemini-cli --approval-mode auto_edit
gemini-cli --yoloInclude file context:
gemini-cli "Summarize @README.md"Current OAuth login behavior mirrors the upstream Node.js CLI client for compatibility during this public preview. That setup is temporary, unofficial, and may change or stop working without notice if Google changes or disables the mirrored client.
If you need a setup you control, override the OAuth client with
GEMINI_OAUTH_CLIENT_ID and GEMINI_OAUTH_CLIENT_SECRET, or use API key auth
instead.
Run gemini-cli and follow the browser flow. Credentials are stored at
~/.gemini/oauth_creds.json and reused on subsequent runs. If your org uses
Code Assist, set a project ID:
export GOOGLE_CLOUD_PROJECT="YOUR_PROJECT_ID"Stable fallback auth path. google_web_search and web_fetch currently require
GEMINI_API_KEY auth.
export GEMINI_API_KEY="YOUR_GEMINI_API_KEY"- This CLI does not include telemetry or analytics collection.
- Network requests are limited to model/auth endpoints and user-requested tool operations (for example
google_web_searchandweb_fetch). - Credentials are stored locally in
~/.gemini/. - See
PRIVACY.md,SECURITY.md, andSUPPORT.mdfor details.
Settings are JSON (comment-tolerant) and loaded in this order:
- System:
/etc/gemini-cli/settings.json(Linux),/Library/Application Support/GeminiCli/settings.json(macOS),C:\ProgramData\gemini-cli\settings.json(Windows) - Global:
~/.gemini/settings.json - Workspace:
<repo>/.gemini/settings.json
/model updates model.name in the global settings file.
Tool approval settings:
tools.approvalMode:default,auto_edit, orplan. (Use CLI flags foryolo.)experimental.plan: set totrueto enable plan mode.tools.requireReadApproval: optional boolean to require confirmations forread_file/read_many_files.tools.webFetch.allowPrivate: optional boolean to allow private/local URL fallback inweb_fetch(default false).
Model settings:
model.maxSessionTurns: optional integer limit on the number of turns per session.model.maxHistoryMessages: optional integer limit on stored history messages (0 means unlimited).
Environment variables:
GEMINI_API_KEY: API key for Gemini API auth.GEMINI_API_KEY_AUTH_MECHANISM:x-goog-api-key(default) orbearer.GEMINI_OAUTH_CLIENT_ID: override the OAuth client ID (advanced).GEMINI_OAUTH_CLIENT_SECRET: override the OAuth client secret (advanced).GOOGLE_CLOUD_PROJECT: project ID for Code Assist auth.CODE_ASSIST_ENDPOINT: override Code Assist endpoint.CODE_ASSIST_API_VERSION: override Code Assist API version.GOOGLE_APPLICATION_CREDENTIALS: optional credentials file for OAuth refresh.OAUTH_CALLBACK_HOST: override localhost callback host for OAuth web flow.OAUTH_CALLBACK_PORT: override localhost callback port for OAuth web flow.NO_BROWSER: set to disable browser-based login.GEMINI_CLI_SYSTEM_SETTINGS_PATH: override system settings path.GEMINI_CLI_SYSTEM_DEFAULTS_PATH: override system defaults path.GEMINI_CLI_LOG_LEVEL:debug|info|warn|errorto enable logging.GEMINI_CLI_LOG_FORMAT:jsonfor structured logs.
The upstream google-gemini/gemini-cli is the official Node.js CLI with full
feature coverage (MCP, extensions, advanced UI, output formats, etc.). This Go
port focuses on core agent behavior and minimal UI; expect missing features
while parity work continues.
Apache-2.0