VOOZH about

URL: https://thenewstack.io/coding-with-the-gemini-cli-tool/

⇱ Coding With the Gemini CLI Tool - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2025-12-12 06:00:25
Coding With the Gemini CLI Tool
tutorial,
AI / Developer tools / Software Development

Coding With the Gemini CLI Tool

If you're at home in a terminal window, Gemini CLI can easily become yet another tool for your programming journey.
Dec 12th, 2025 6:00am by Jack Wallen
👁 Featued image for: Coding With the Gemini CLI Tool
Photo by Ilnur on Unsplash.

Some time ago, Google released the Gemini CLI (Command Line Interface) tool that is pretty impressive.

Unlike many AI tools, the Gemini CLI app is installed locally, so you don’t have to worry about your queries (or the results thereof) being used for any nefarious purposes.

Currently, Gemini CLI features:

  • Fully open source, allowing users to inspect and contribute to the code.
  • Powered by Gemini 2.5 Pro.
  • Free tier allows 60 requests per minute and 1,000 requests per day with a personal Google account.
  • Includes tools for Google Search, file operations, and shell commands for enhanced functionality.
  • Supports custom integrations and enhances the AI’s ability to understand context.

As you’ve probably assumed, based on the name, Gemini CLI is a command-line-only tool, so there’s no GUI. If you’re not comfortable using the command line, then Gemini CLI is not for you.

If, on the other hand, you’re at home in a terminal window, Gemini CLI can easily become yet another tool for your programming journey. You can use Gemini CLI to help you learn how to use a new programming language, how to up your skills with a certain language, and much more.

Let’s find out how to install this handy tool and then how to use it to learn a little something about JavaScript.

Shall we?

What You’ll Need

To make this work, you’ll need any operating system that supports Node.js and NPM. I’ll be demonstrating the installation on Zorin OS, which is based on Ubuntu Linux. On Linux, you’ll also need a user with sudo privileges.

Let’s get busy.

Installing the Prerequisites

Before you can install Gemini CLI, you have to first install Node.js and NPM. To do that, we’ll run the following commands:

Once that’s taken care of, you’re ready to install Gemini CLI.

Installing Gemini CLI

You can install Gemini CLI with a single command:

It’ll take a minute or two to finish, but it should go off without a hitch.

You’re not done yet.

You have to authenticate Gemini CLI with your personal Google account. To do that, open your default web browser and make sure you’re logged into your Google account. Once you’ve done that, go back to the terminal window and issue the command:

If you receive an error, it means your distribution installed an older version of Node.js. To resolve that issue, do the following:

Once you’ve taken care of that, re-run the gemini command. You will then be prompted to select an authentication method (Figure 1). Make sure Login with Google is selected and hit Enter on your keyboard.

👁 Image

Figure 1: If you’d prefer, you can authenticate with a Gemini API key or Vertex AI.

When your default web browser opens, if you’ve not already logged into your Google account, do so now.

When prompted, click Sign In, and you’ll be informed that the authentication was successful, at which point you can close the browser to find that Gemini CLI is ready for your first query.

Don’t query yet.

Close Gemini by hitting the Ctrl+c key combination twice.

Let’s Learn Something About JavaScript

Using the terminal window, create a new project directory with the command:

Change into that directory with:

Now, run the gemini command again. The difference this time is that you’re working in a specific directory (as opposed to your home directory).

From the main Gemini window (Figure 2), let’s issue the following query:

👁 Image

Figure 2: Gemini CLI is ready for your first query.

Hit Enter, and Gemini will go to work.

As it works, it’ll most likely prompt you to okay certain tasks, or it’ll prompt you to allow it to create files (Figure 3).

👁 Image

Figure 3: Resistance is futile, so give it permission to create the files.

Continue allowing Gemini to do what it needs as it does what we’ve asked of it.

After a few minutes, Gemini informed me to open the file index.html with my web browser to see the drop-downs in action (Figure 4).

👁 Image

Figure 4: Our example drop-downs were successfully created.

Okay, but how do we learn from this? Well, if you go back to your JS_PROJECT directory, you’ll see three files:

Or, you could run a follow-up like this:

Gemini CLI will then walk you through what it did (Figure 5); either that, or it’ll inform you that you’ve either exhausted the resources of your free tier or the service is too busy. If that’s the case, run the query again and see if it works.

👁 Image

Figure 5: Let Gemini CLI explain to you how it created the drop-downs.

Fun times.

And that, my friends, is how you can install and use the Gemini CLI tool to learn something new or hone your current skills.

TRENDING STORIES
Jack Wallen is what happens when a Gen Xer mind-melds with present-day snark. Jack is a seeker of truth and a writer of words with a quantum mechanical pencil and a disjointed beat of sound and soul. Although he resides...
Read more from Jack Wallen
SHARE THIS STORY
TRENDING STORIES
Google is a sponsor of The New Stack.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.