Gemini CLI: The Developer’s Deep Dive
Most people use Gemini through a browser. For developers, the real power is in the terminal. Here is how to get Gemini CLI running on your Mac and why you should care.
By The Daily Query · · 2 min read
I've spent the last week living in the terminal with Gemini CLI, and it's hard to go back to the browser tab. It isn't just about avoiding another Chrome tab. It's about having an AI that actually knows where your files are and can talk to your git history without you copying and pasting blocks of code like it's 2023.
What is this thing?
Gemini CLI is exactly what it sounds like. It is a command-line interface that puts Google’s models directly into your shell. You can pipe files into it, ask it to explain a complex regex, or have it audit a directory for security holes. It feels less like a chatbot and more like a core utility, similar to grep or curl.
Why not just use the web UI?
The web interface is fine for writing emails or planning a trip. For coding, the friction of switching contexts is a killer. With the CLI, the AI is part of your workflow.
If you're stuck on a compiler error, you don't have to copy the stack trace. You just pipe the output of your build command straight into Gemini. If you need to document a new function, you can point the CLI at the file and tell it to update the README. It saves those small, annoying chunks of time that usually add up to a ruined afternoon.
Installing on Mac
Setting this up on macOS is straightforward. You will need Node.js installed first. If you use Homebrew, you probably already have it.
Open your terminal and run npm install -g @google/gemini-cli.
Next, you will need an API key from Google AI Studio. It is free for most developers. Once you have the key, add it to your shell profile. For most Mac users, that is the .zshrc file. Add this line: export GEMINI_API_KEY='your_key_here'.
Restart your terminal, and you are ready.
Your first commands
To test it out, try something simple like gemini "What time is it in Tokyo?".
The real magic happens when you use it with your code. Try running gemini "Explain this file" --file package.json. It will give you a summary of your project's dependencies without you having to read through the JSON yourself. You can also use it to generate commit messages by piping git diff into a prompt.
Is it worth the switch?
If you spend most of your day in VS Code or Warp, yes. It makes the AI feel like a teammate instead of a search engine. It won't write your whole app for you, but it handles the chores of development better than anything else I've tried lately.
enjoyed this one?_
Get the next one in your inbox.
One email every morning. The AI news that matters, decoded in five minutes.
up_next → Industry
SpaceX Just Priced the Largest IPO in History. Here's What $1.77 Trillion Buys You.
SpaceX priced its IPO at $135 a share, raising about $75 billion at a $1.77 trillion valuation. The numbers behind the listing, what Starlink actually earns, and why the xAI merger changes the math.