Podcast Title

Author Name

0:00
0:00
Album Art

Free AI Coding in Your Terminal with Google Gemini CLI

By 10xdev team July 04, 2025

So, you want AI coding help in your terminal, but you don't want to pay for it. Well, Google Gemini CLI gives you an impressive 1,000 requests per day, completely free. Let's explore if it's actually worth using.

Why Google Gemini CLI is a Game-Changer for Developers

While many AI coding assistants are amazing, they often aren't free. The Gemini CLI, however, is completely free with a Google account. We're talking about 60 requests per minute and 1,000 requests per day at zero cost. This article will provide a complete and honest first impression, starting from scratch, testing it on a real coding task, and seeing how it stacks up against tools you might already be using and paying for. The big question is: can free actually compete with premium?

Getting Started with Gemini CLI

To begin, you can refer to the official article from Google, "Gemini CLI, your open-source AI agent," which is a great starting point. The most significant feature is its cost: available free of charge, with 60 requests per minute and 1,000 requests per day. It's also open-source, which is a fantastic bonus.

Here are some of its powerful features:

  • Powerful Models: Access to powerful models directly in your command line.
  • Built-in Tools: It comes with built-in tools, including the ability to ground prompts with Google Search. This allows it to fetch web pages and provide real-time external context without needing you to configure a separate tool or server.
  • Extensibility: You can extend its capabilities through the Model Context Protocol (MCP), allowing you to use your own MCP servers in the terminal.
  • Customization: Customize prompts and instructions to fit your needs.
  • Automation: Automate tasks and integrate them with your existing workflows.

Because it's open and extensible, even though it uses Gemini models like Gemini Pro 2.5 and Gemini Flash out of the box, there are other CLI versions that leverage different models.

Installation and Setup

The Gemini CLI GitHub repo provides a quick start guide. You have a couple of options to install Gemini with Node: run the CLI directly or install it globally using npm.

npm install -g @google/gemini-cli

Alternatively, you can use Homebrew. After running the installation command, which added numerous packages in just a few seconds, the next step is to have a project to work on.

For bootstrapping a new project, it's often more efficient to use existing tools designed for that purpose, like start.spring.io for Spring Boot applications. The recommendation is to use these familiar tools to set up the project and then use AI agents to assist with specific development tasks.

For this demonstration, we'll create a new Spring Boot project with Web, Spring Security, and JTE (Java Template Engine) dependencies. We'll call it showcase. After generating and unzipping the project, we can navigate into the folder and run the gemini command.

Upon first run, a welcome screen appears with some helpful tips:

  • Ask questions, edit files, or run commands.
  • Be specific for best results.
  • Create a gemini.md file to customize your interactions with Gemini.
  • Type help to find out more.

You'll be prompted to select a theme and then authenticate the project. You can log in with Google, use a Gemini API key, or use the Vertex API. Logging in with Google is a straightforward option.

Exploring the CLI and Its Features

Once logged in, you can start exploring the commands. Typing / reveals a list of available commands:

  • about
  • bug
  • chat
  • clear
  • compress
  • corgi
  • docs
  • editor
  • help
  • mcp
  • memory
  • privacy
  • quit
  • stats
  • theme
  • tools

The help command provides a high-level overview of these commands and keyboard shortcuts. A notable feature is the massive context window—around a million tokens—which means you can add a vast amount of context without running out of space.

To get familiar with a new project, you can ask the agent about it:

"Tell me about this project that I am in."

The tool will analyze the project structure and provide a summary. For instance, it correctly identifies a Java Spring Boot project using JTE and Spring Security, built with Maven and JDK 24.

One point of curiosity is the "no sandbox" message. It's important to understand if the tool is sandboxed to the current directory, especially when running commands that could modify files. This is something to investigate further for security reasons.

Putting Gemini to the Test: A Real-World Coding Task

Let's see if we can use Gemini 2.5 Pro to build something. Here's the prompt:

"I want to build out a homepage where we can showcase some different templates that users can download. In this project, we're going to use JTE (Java Template Engine). So, I want the index page to just display a bunch of fake templates for now. Then, we're going to include Spring Security. You should not be able to get to this page unless you're authenticated. And the way that I want to authenticate is through OAuth 2. So, you can sign in with something like an email and a password or you can sign in with something like GitHub. So, I want to put all this together and have a nice homepage to show all these off."

Impressively, Gemini creates a plan on its own:

  1. Add the necessary OAuth2 dependency.
  2. Create a simple data class for templates and a service to provide some fake template data.
  3. Create an MVC controller to handle the homepage request.
  4. Create a JTE template for the homepage to display the templates.
  5. Configure Spring Security to protect the homepage and enable OAuth2 login with GitHub as an example provider.

It then proceeds to execute the plan, asking for permission to edit files. It adds the dependency, creates the necessary classes, and configures Spring Security.

// Example SecurityFilterChain Bean
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
    http
        .authorizeHttpRequests(authorize -> authorize
            .requestMatchers("/error").permitAll()
            .anyRequest().authenticated()
        )
        .oauth2Login(withDefaults());
    return http.build();
}

Finally, it adds placeholders for the GitHub client ID and secret to the application.properties file and provides instructions on how to complete the setup.

Setting Up GitHub OAuth

To get the application running, you need to create an OAuth application on GitHub:

  1. Navigate to Settings > Developer settings > OAuth Apps.
  2. Create a New OAuth App.
  3. Fill in the application details, including the homepage URL and the authorization callback URL.
  4. Register the application to receive your Client ID and Client Secret.

These credentials must be added to your application.properties file.

spring.security.oauth2.client.registration.github.client-id=YOUR_CLIENT_ID
spring.security.oauth2.client.registration.github.client-secret=YOUR_CLIENT_SECRET

After a quick review of the generated code—including the security configuration, a home controller, a template service with fake data, and a JTE template to render the data—we can run the application. Upon navigating to the application, it correctly redirects to the GitHub login page for authentication. After authorizing, it redirects back, and the homepage displays the list of templates.

Customizing Your Workflow with gemini.md

The CLI allows for project-specific customizations through a gemini.md file. You can ask Gemini to create one for you:

"Can you create a Gemini MD file for this project?"

This file is the perfect place to define coding standards, preferred libraries (e.g., favoring RestClient over Rest-template), and architectural guidelines. The tool will generate a README-style file that outlines the project's architecture, technologies used, and setup instructions.

Enhancing the Application with Tailwind CSS

Let's ask for another improvement:

"Can we add some more fake data with some images and style up the homepage using Tailwind CSS."

When building frontends, it's useful to specify preferred tools in the gemini.md file, but being explicit in the prompt works too. During this process, Gemini might use Google Search to get up-to-date context on a library.

It intelligently decides to use the frontend-maven-plugin to manage Node and npm, which is a proper way to integrate a frontend build process in a Java project. It configures the pom.xml, sets up the tailwind.config.js file, and creates the necessary package.json to manage the Tailwind CSS dependency.

After running mvn clean install to build the project and generate the CSS file, Gemini updates the index.jte template to include the new styling. The result is a nicely styled homepage, created with just a few back-and-forth interactions.

Final Thoughts: Is Gemini CLI Worth It?

Based on this first look, Gemini CLI is very similar to other terminal-based AI assistants. The experience of working in the terminal is surprisingly pleasant.

A couple of questions remain, particularly regarding the sandboxing of the project, which is crucial for security. The planning mode, while present, isn't as interactive as in some other tools, though iteration is certainly possible.

Pros: * Completely Free: With 60 requests per minute and 1,000 requests per day, the value is undeniable. * Powerful Models: Gemini 2.5 Pro is an excellent model for coding tasks. * Productivity: The tool proved to be highly effective for the small task demonstrated in this article.

Gemini CLI is another excellent tool to add to the developer's arsenal. For those looking to get started with a free, powerful AI coding assistant, this is an obvious and compelling choice.

Ultimately, the goal is to use the tools that make us most productive. With the proliferation of AI tools, the challenge is finding the ones that fit our workflow and boost our efficiency. For many, Gemini CLI could be that winner.

Join the 10xdev Community

Subscribe and get 8+ free PDFs that contain detailed roadmaps with recommended learning periods for each programming language or field, along with links to free resources such as books, YouTube tutorials, and courses with certificates.

Recommended For You

Up Next