First steps

Getting Started with Gemini CLI

3 min read

Gemini CLI is Google’s open-source terminal agent — the same shape as Claude Code. It reads your files, runs commands and edits code from the shell, and the free tier is genuinely usable.

1. Install it

npm install -g @google/gemini-cli

What it does: installs the gemini command globally.

brew install gemini-cli

What it does: the Homebrew route on macOS and Linux. To try it without installing anything, run npx @google/gemini-cli.

2. Sign in

gemini

What it does: on first run, opens a browser to sign in with your Google account. That path gives 60 requests per minute and 1,000 requests per day on a personal account, with no billing setup.

export GEMINI_API_KEY="your-key-here"
gemini

What it does: authenticates with an AI Studio key instead — the free tier there is 1,000 requests per day with Gemini 3. Set it in your shell profile to make it stick.

3. Run your first prompt

cd /path/to/your/project
gemini

What it does: starts the agent scoped to that folder, which is the code it can read. Then ask for something concrete:

Summarize what this project does and list its main entry points.

What it does: has it read the folder and report back. Ask for changes the same way — it proposes edits before applying them. /help lists the slash commands.

Verify it worked

Ask it to make one small edit and check the file on disk afterwards. If it described a change but nothing moved, you either declined the confirmation or started it outside the project.

How it compares

Both Gemini CLI and Claude Code are terminal agents with MCP support, so the practical difference is the account you already have and the free allowance. Claude Code needs a paid Claude plan; Gemini CLI’s Google sign-in does not. For a small repo either is fine — try the one whose limits you won’t hit.

Next: MCP servers and extensions in Gemini CLI, or call the model directly with your first Gemini API request.

Source: google-gemini/gemini-cli.

Open the full interactive version (with copy buttons) ↗

← All guides