Gemini CLI: the agent with the free tier that actually works
Install Gemini CLI, log in with a personal Google account, get 1,000 requests a day for free, and learn the @file, !shell and /memory moves that make it a daily driver.
@, drop into the shell with !, and persist project rules in GEMINI.md.What Gemini CLI is
Gemini CLI is Google’s open-source terminal agent โ Apache 2.0, on GitHub, powered by Gemini models. It does what Claude Code and Codex CLI do: reads the repo, edits files, runs commands, iterates.
The difference is the on-ramp. A personal Google account gets you a free tier โ no card, no trial that expires in 14 days. That single fact is why it’s the first cloud agent most people should install.
Step 1 โ Install
Node.js 20+ required:
npm install -g @google/gemini-cli
Check:
gemini --version
# 0.67.0
gemini --help and the official docs beat any pinned tutorial.Step 2 โ Authenticate (pick one)
cd ~/projects/my-app
gemini
Three paths:
| Method | Best for | Cost |
|---|---|---|
| Login with Google | individuals, first run | free tier: 60 requests/min, 1,000 requests/day |
| Gemini API key | scripts, CI, higher limits | pay per token (AI Studio key) |
| Vertex AI | teams already on Google Cloud | GCP billing, enterprise controls |
Choose “Login with Google”, finish the browser flow. The free tier is generous enough to learn on: 1,000 requests a day is a lot of agent turns when you’re not looping over a monorepo.
Step 3 โ First task
Inside a git repo with a clean working tree:
git status
gemini
> read the repo, then explain how authentication works end to end
Then something with consequences:
> the /health endpoint returns 500 when the database is down โ reproduce it and fix it
It will read files, propose edits, and ask before running commands. Same discipline as any agent: read the diff, don’t approve blind. The agent loop, explained โ
Step 4 โ The four moves that change how you use it
@ pulls a file (or a folder) into the prompt. No copy-paste, no “here is my code:” wall:
> @src/auth/session.ts why does this token never expire?
> @docs/ explain the architecture to a new hire
! runs a shell command without leaving the session. Prefix a line with ! for a single command, or type ! alone to toggle shell mode:
! git log --oneline -15
! npm test -- --run
/memory writes durable facts the agent carries into later sessions:
/memory add This repo uses pnpm, never npm. Tests run with `pnpm test`.
/init scans the repo and proposes a GEMINI.md โ the project instruction file, the Gemini equivalent of CLAUDE.md and AGENTS.md.
Step 5 โ Commands worth memorizing
| Command | What it does |
|---|---|
/init | generate GEMINI.md from the repo |
/memory | show or add persistent memory |
/compress | summarize the conversation to reclaim context |
/clear | reset the session |
/tools | list available tools |
/mcp | manage MCP servers |
/extensions | manage CLI extensions |
/stats | token and session stats |
/restore | roll back to a checkpoint |
/auth | switch authentication method |
Step 6 โ Context is a budget
Gemini models have very large context windows, and it’s tempting to dump the whole repo in. Don’t. A 1M-token window still costs money, still gets slower, and long contexts degrade instruction-following โ the “lost in the middle” problem is real. Context windows, demystified โ
Practical rules:
@the three files that matter, not@src/.- Keep
GEMINI.mdunder ~100 lines. /compresswhen a session drifts,/clearwhen it’s lost.
Where it fits
| Gemini CLI | Claude Code | Codex CLI | |
|---|---|---|---|
| Free tier | yes, 1,000 req/day | no | limited (ChatGPT Free) |
| Open source | yes (Apache 2.0) | no | yes (Apache 2.0) |
| File inclusion | @path | @ mentions | @ mentions |
| Local models | no | no | yes (--oss) |
| Best reason to pick it | zero-cost start | polish, long sessions | sandbox + local |
The honest recommendation: install Gemini CLI first because it’s free, then add the others when a specific need shows up โ a Claude subscription you already pay for, or a local model you want an agent on top of.