How to Get Started and Build with Gemini CLI (Powered by Gemini 3 Flash)
Source: Dev.to
Introduction
As developers we constantly look for tools that speed up our workflow without breaking our flow state. Google’s recent update to the Gemini CLI with the Gemini 3 Flash model brings a true “AI Agent” directly into your terminal.
What is Gemini CLI?
Gemini CLI is a terminal application that lets you chat with Google’s Gemini AI from the command line. It goes beyond a simple chatbot: because it runs inside your environment, it can read your project files, execute shell commands, and act as an open‑source AI agent.
Why the Gemini 3 Flash update matters
Gemini 3 Flash provides a faster, more capable model that can keep up with developer thought processes while handling complex tasks.
The ReAct Loop (Reason + Act)
When you type a command, Gemini CLI follows this loop:
- Thought – You ask a question (e.g., “Why is my build failing?”). The AI analyzes the request.
- Tool Use – The AI decides which tool to use (read a file, run a shell command, etc.).
- Observation – The CLI runs the chosen command, captures the output, and feeds it back to the AI.
- Answer – The AI interprets the result and provides a concrete fix.
This loop enables the CLI to act like a real pair programmer rather than a static text generator.
Benefits of a CLI‑based AI agent
- Direct file‑system access – No copy‑pasting. Ask the agent to “refactor
utils.py” and it can read and modify the file directly. - Context awareness – The agent knows the current working directory and the surrounding project structure.
- Automation & scripting – Pipe output from other commands into Gemini, e.g.,
cat logs.txt | gemini "Find the critical error". - Built‑in tools – Gemini CLI includes ready‑to‑use capabilities:
- File System – Read, write, and list files.
- Web – Fetch URLs and perform Google searches for real‑time information.
- Shell – Execute terminal commands safely.
- Customization & extensions – Open‑source nature lets you add custom tools via the Model Context Protocol (MCP).
Example use cases
Code review
gemini "Review main.py for potential bugs and clean code practices. Output the suggestions as a list."
Why it works: The CLI reads main.py directly and uses Gemini’s reasoning to surface edge cases.
Analyzing a CSV or log file
gemini "Read server_logs.csv and tell me which IP address appears the most frequently. Then, use grep to count exactly how many times it appears."
Why it works: The agent combines code generation (to parse the CSV) with system tools (grep) for verification.
Scaffolding a new feature
gemini "Create a new folder called 'blog-app'. Inside it, create an index.html file with a basic responsive layout and a style.css file with a dark mode theme."
Result: The CLI creates the folder and writes the files, giving you a ready‑to‑code starter.
Installing Gemini CLI
Prerequisite: Node.js must be installed on your machine.
-
Open your terminal.
-
Run the install command:
npm install -g @google/gemini-cli@latest -
Authenticate:
geminiOn first run you’ll be prompted to log in with your Google account, which provides a generous free tier.
-
Enable Gemini 3 Flash (if not default):
/settingsEnsure “Preview Features” is toggled on, or use
/modelto select the Gemini 3 Flash model.
Conclusion
Moving from a browser‑based chat to a terminal‑based AI agent is a huge productivity boost for developers. With Gemini 3 Flash powering Gemini CLI, you get a fast, intelligent assistant that can read files, run commands, and automate routine tasks—all from within your development environment. Give it a try, explore the open‑source code, and share what you build!
Special thanks to the course that inspired these use cases.