
curl -fsSL https://raw.githubusercontent.com/google-gemini/gemini-api-cli/main/scripts/install.sh | bashbash and it will fail) · macOS/Linux: open Terminal.▶️ Usage summary
- Install:
curl -fsSL https://raw.githubusercontent.com/google-gemini/gemini-api-cli/main/scripts/install.sh | bash - Use:
gemini-api generate "Hello from my agent" --dry-run - 2. Give your agent instructions:
You have access to gemini-api through the shell. - Prompt your host agent as usual:
Build a landing page for this app. Use Gemini to create a mascot image and a welcome voiceover, and launch a managed research agent to investigate competing products. Incorporate the assets and findings into the page.
gemini-api-cli — An (experimental) CLI for the Gemini API
What is gemini-api-cli?
gemini-api-cli is a skill (a capability for AI agents such as Claude, Codex and Cursor) on GitHub (google-gemini/gemini-api-cli). An (experimental) CLI for the Gemini API
What can gemini-api-cli do?
- Delegate long-running work: Start a Gemini managed agent in the background, keep the returned interaction ID, and retrieve the result when needed.
- Stateless execution: Each invocation runs independently. Your agent supplies the context, chooses the model, and controls the next step.
- –schema prints the bundled JSON Schema (draft 2020-12) for any command that accepts a request body.
- –no-interactive disables all interactive prompts and TUI forms.
- Exit codes distinguish success (0), runtime/API failures (1), invalid usage/validation errors (2), and authentication/authorization failures (3).
How to install gemini-api-cli
See the ⚡ Quick install section at the top of the page — it has a ready-to-copy command taken from the author’s README, plus where to run it. For the full instructions, see the README at the end of the page.
Frequently asked questions about gemini-api-cli
Is gemini-api-cli free?
Yes. gemini-api-cli is an open-source project on GitHub, so you can download and use it for free.
Is gemini-api-cli hard to install?
No. You only need to run one command above.
What is gemini-api-cli written in?
gemini-api-cli is written mainly in Go.
Download & source code
The source code, README and latest updates of gemini-api-cli are at github.com/google-gemini/gemini-api-cli. The star count and update date on this page sync automatically from GitHub.
📖 Full guide
Loading the guide…