Google's Gemini CLI (Full Tutorial): This FULLY FREE AI Coder BEATS Claude Code in ONE BLOW!

AICodeKingAbout 4 min readJun 26, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

  • Gemini CLI: Google's new command-line AI agent based on Gemini models.
  • Open-source: The tool is available under the Apache 2.0 license.
  • Free Tier: Access to Gemini 1.5 Pro with generous usage limits (60 requests/minute, 1000 requests/day).
  • Context Window: Supports up to 1 million tokens.
  • MCP (Model Context Protocol): Allows integration with tools and services.
  • Node.js: Required runtime environment for Gemini CLI.
  • Slash Commands: Commands used to interact with Gemini CLI (e.g., /about, /bug, /chat, /clear, /compress, /docs, /editor, /mcp, /memory, /stats).

What is Gemini CLI?

Gemini CLI is a command-line AI agent developed by Google, designed to bring the power of Gemini models directly into the terminal. It functions similarly to Claude Code, enabling users to edit files, write code, and perform various tasks from their terminal. The tool is open-source (Apache 2.0 license) and built using Typescript.

Key Features and Benefits

  • Direct Access to Gemini: Provides lightweight access to Gemini's capabilities from the command line.
  • Free Tier: Offers access to Gemini 1.5 Pro under Google's code assist program, with a 1 million token context window and generous usage limits (60 requests per minute, up to 1,000 requests per day).
  • Large Codebase Handling: Can query and edit large codebases, even those exceeding the 1 million token context window.
  • Multimodal Capabilities: Can generate new apps from PDFs or sketches.
  • Operational Task Automation: Supports automating tasks like querying pull requests and handling complex git rebases.
  • Integration with Tools and MCP Servers: Allows adding new capabilities, including media generation with tools like Imagen, VO or LIA.
  • Google Search Grounding: Can fetch web pages and provide real-time external context to the model for research and fact-checking.
  • Extensibility: Supports MCP, bundled extensions, and customizable prompts and instructions.
  • Automation: Suitable for both interactive and non-interactive use, allowing integration into existing scripts.
  • Open-Source: Hosted on GitHub, encouraging contributions and improvements.

Usage and Setup

  1. Prerequisites: Node.js must be installed on the system.
  2. Installation:
    • Using npx: npx @google/generative-ai-cli
    • Globally: npm install -g @google/generative-ai-cli
  3. Authentication: Sign in with a Google account or use an API key. This activates the free tier.
  4. Color Theme Selection: Choose a color theme for the interface (e.g., Dracula).

Slash Commands Explained

  • /about: Displays the current version of Gemini CLI and related information. Includes an -o option for switching to API key-based authentication or changing accounts.
  • /bug: Used for reporting bugs.
  • /chat: Manages chat sessions with subcommands:
    • list: Lists available sessions.
    • save: Saves the current session with a name.
    • resume: Resumes a saved session.
  • /clear: Clears the conversation or context.
  • /compress: Summarizes the context, freeing up space for further conversations.
  • /docs: Opens the Gemini CLI documentation.
  • /editor: Selects the editor to open files in.
  • /mcp: Displays configured MCPs. Configuration is done in a config file.
  • /memory: Creates a Gemini markdown file for custom rules or coding patterns. Includes subcommands:
    • refresh: Refreshes the memory file.
    • add: Adds information to the memory file.
    • show: Shows the content of the memory file.
  • /stats: Checks token usage.

Example Use Case

The video demonstrates using Gemini CLI to add a light theme option to a benchmarking app. The tool successfully makes the necessary changes, showcasing its ability to run shell commands, use MCPs, and edit files.

Ninja Chat Advertisement

The video includes a brief advertisement for Ninja Chat, an AI platform offering access to multiple AI models (GPT-4o, Claude 3 Opus, Sonnet, and Gemini 1.5 Flash) for a monthly fee. The platform includes an AI playground for comparing model responses and a mind map generator. A discount code ("king25" for 25% off any plan or "king40yearly" for 40% off annual subscriptions) is provided.

Conclusion

Gemini CLI is a promising tool that brings the power of Gemini models to the command line. Its open-source nature, generous free tier, and extensive features make it a valuable asset for developers. While it may lack some polish compared to established tools like Claude Code, its potential for improvement and customization through community contributions is significant.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.