![]() |
VOOZH | about |
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.
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.
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:
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?
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.
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.
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.
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.
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).
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).
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.
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.