A lightweight, non-interactive Gemini CLI written in Go
A love letter to Google's Gemini CLI
Why gmn? • Installation • Quick Start • MCP • Benchmarks
The official Gemini CLI is an amazing tool with excellent MCP support and seamless Google authentication. However, for scripting and automation, its Node.js runtime adds startup overhead.
gmn reimplements the core functionality in Go, achieving 37x faster startup while maintaining full compatibility with the official CLI's authentication.
$ time gmn "hi" > /dev/null 0.02s user 0.01s system $ time gemini -p "hi" > /dev/null 0.94s user 0.20s system gmn does not have its own authentication. You must authenticate once using the official Gemini CLI first:
npm install -g @google/gemini-cli gemini # Choose "Login with Google"gmn reuses these credentials automatically from ~/.gemini/. Your free tier quota or Workspace Code Assist quota applies.
brew install tomohiro-owada/tap/gmngo install github.com/tomohiro-owada/gmn@latestDownload from Releases
# Simple prompt gmn "Explain quantum computing" # With file context gmn "Review this code" -f main.go # Pipe input cat error.log | gmn "What's wrong?" # JSON output gmn "List 3 colors" -o json # Use different model gmn "Write a poem" -m gemini-2.5-progmn [prompt] [flags] gmn mcp <command> Flags: -p, --prompt string Prompt (alternative to positional arg) -m, --model string Model (default "gemini-2.5-flash") -f, --file strings Files to include -o, --output-format string text, json, stream-json (default "text") -t, --timeout duration Timeout (default 5m) --debug Debug output -v, --version Version MCP Commands: gmn mcp list List MCP servers and tools gmn mcp call <server> <tool> Call an MCP tool gmn supports Model Context Protocol servers.
Configure in ~/.gemini/settings.json:
{ "mcpServers": { "my-server": { "command": "/path/to/mcp-server" } } }# List available tools gmn mcp list # Call a tool gmn mcp call my-server tool-name arg=value| Metric | gmn | Official CLI | Improvement |
|---|---|---|---|
| Startup | 23ms | 847ms | 37x |
| Binary | 5.6MB | ~200MB | 35x |
| Runtime | None | Node.js | - |
git clone https://github.com/tomohiro-owada/gmn.git cd gmn make build # Current platform make cross-compile # All platforms- Interactive/TUI mode → use official CLI
- OAuth flow → authenticate with official CLI first
- API Key / Vertex AI auth
Apache License 2.0 — See LICENSE
This project is a derivative work based on Gemini CLI by Google LLC.
- Google Gemini CLI — The incredible original
- Google Gemini API — The underlying API
