How to Get Started and Build with Gemini CLI (Powered by Gemini 3 Flash)

Published: (February 9, 2026 at 11:17 AM EST)
4 min read
Source: Dev.to

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:

  1. Thought – You ask a question (e.g., “Why is my build failing?”). The AI analyzes the request.
  2. Tool Use – The AI decides which tool to use (read a file, run a shell command, etc.).
  3. Observation – The CLI runs the chosen command, captures the output, and feeds it back to the AI.
  4. 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.

  1. Open your terminal.

  2. Run the install command:

    npm install -g @google/gemini-cli@latest
  3. Authenticate:

    gemini

    On first run you’ll be prompted to log in with your Google account, which provides a generous free tier.

  4. Enable Gemini 3 Flash (if not default):

    /settings

    Ensure “Preview Features” is toggled on, or use /model to 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.

0 views
Back to Blog

Related posts

Read more »