{"id":188033,"date":"2025-12-12T14:10:13","date_gmt":"2025-12-12T14:10:13","guid":{"rendered":"https:\/\/www.newsbeep.com\/ie\/188033\/"},"modified":"2025-12-12T14:10:13","modified_gmt":"2025-12-12T14:10:13","slug":"coding-with-the-gemini-cli-tool","status":"publish","type":"post","link":"https:\/\/www.newsbeep.com\/ie\/188033\/","title":{"rendered":"Coding With the Gemini CLI Tool"},"content":{"rendered":"<p>Some time ago, <a href=\"https:\/\/cloud.google.com\/?utm_content=inline+mention\" class=\"ext-link\" target=\"_blank\" rel=\"external  nofollow noopener\" onclick=\"this.target=&#039;_blank&#039;;\">Google<\/a> released the <a href=\"https:\/\/thenewstack.io\/gemini-cli-googles-challenge-to-ai-terminal-apps-like-warp\/\" class=\"local-link\" rel=\"nofollow noopener\" target=\"_blank\">Gemini CLI<\/a> (Command Line Interface) tool that is pretty impressive.<\/p>\n<p>Unlike many <a href=\"https:\/\/thenewstack.io\/the-top-ai-tool-for-devs-isnt-github-copilot-new-report-finds\/\" class=\"local-link\" rel=\"nofollow noopener\" target=\"_blank\">AI tools<\/a>, the Gemini CLI app is installed locally, so you don\u2019t have to worry about your queries (or the results thereof) being used for any nefarious purposes.<\/p>\n<p>Currently, Gemini CLI features:<\/p>\n<p>Fully open source, allowing users to inspect and contribute to the code.<br \/>\nPowered by Gemini 2.5 Pro.<br \/>\nFree tier allows 60 requests per minute and 1,000 requests per day with a personal Google account.<br \/>\nIncludes tools for Google Search, file operations, and shell commands for enhanced functionality.<br \/>\nSupports custom integrations and enhances the AI\u2019s ability to understand context.<\/p>\n<p>As you\u2019ve probably assumed, based on the name, Gemini CLI is a command-line-only tool, so there\u2019s no GUI. If you\u2019re not comfortable using the command line, then Gemini CLI is not for you.<\/p>\n<p>If, on the other hand, you\u2019re 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.<\/p>\n<p>Let\u2019s find out how to install this handy tool and then how to use it to learn a little something about <a href=\"https:\/\/thenewstack.io\/introduction-to-javascript\/\" class=\"local-link\" rel=\"nofollow noopener\" target=\"_blank\">JavaScript<\/a>.<\/p>\n<p>Shall we?<\/p>\n<p>What You\u2019ll Need<\/p>\n<p>To make this work, you\u2019ll need any operating system that supports <a href=\"https:\/\/thenewstack.io\/whats-in-the-new-node-js-and-how-do-you-install-it\/\" class=\"local-link\" rel=\"nofollow noopener\" target=\"_blank\">Node.js<\/a> and NPM. I\u2019ll be demonstrating the installation on Zorin OS, which is based on <a href=\"https:\/\/thenewstack.io\/10-reasons-to-choose-ubuntu-server-over-the-competition\/\" class=\"local-link\" rel=\"nofollow noopener\" target=\"_blank\">Ubuntu Linux<\/a>. On <a href=\"https:\/\/thenewstack.io\/introduction-to-linux-operating-system\/\" class=\"local-link\" rel=\"nofollow noopener\" target=\"_blank\">Linux<\/a>, you\u2019ll also need a user with sudo privileges.<\/p>\n<p>Let\u2019s get busy.<\/p>\n<p>Installing the Prerequisites<\/p>\n<p>Before you can install Gemini CLI, you have to first install <a href=\"http:\/\/node.js\" class=\"ext-link\" rel=\"external  nofollow noopener\" onclick=\"this.target=&#039;_blank&#039;;\" target=\"_blank\">Node.js<\/a> and NPM. To do that, we\u2019ll run the following commands:<\/p>\n<p>Once that\u2019s taken care of, you\u2019re ready to install Gemini CLI.<\/p>\n<p>Installing Gemini CLI<\/p>\n<p>You can install Gemini CLI with a single command:<\/p>\n<p>It\u2019ll take a minute or two to finish, but it should go off without a hitch.<\/p>\n<p>You\u2019re not done yet.<\/p>\n<p>You have to authenticate Gemini CLI with your personal Google account. To do that, open your default web browser and make sure you\u2019re logged into your Google account. Once you\u2019ve done that, go back to the terminal window and issue the command:<\/p>\n<p>If you receive an error, it means your distribution installed an older version of Node.js. To resolve that issue, do the following:<\/p>\n<p>Once you\u2019ve 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.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-22809425\" src=\"https:\/\/www.newsbeep.com\/ie\/wp-content\/uploads\/2025\/12\/c0f5d803-geminicli1.jpg\" alt=\"\" width=\"683\" height=\"501\"\/><\/p>\n<p>Figure 1: If you\u2019d prefer, you can authenticate with a Gemini API key or Vertex AI.<\/p>\n<p>When your default web browser opens, if you\u2019ve not already logged into your Google account, do so now.<\/p>\n<p>When prompted, click Sign In, and you\u2019ll 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.<\/p>\n<p>Don\u2019t query yet.<\/p>\n<p>Close Gemini by hitting the Ctrl+c key combination twice.<\/p>\n<p>Let\u2019s Learn Something About JavaScript<\/p>\n<p>Using the terminal window, create a new project directory with the command:<\/p>\n<p>Change into that directory with:<\/p>\n<p>Now, run the gemini command again. The difference this time is that you\u2019re working in a specific directory (as opposed to your home directory).<\/p>\n<p>From the main Gemini window (Figure 2), let\u2019s issue the following query:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-22809426\" src=\"https:\/\/www.newsbeep.com\/ie\/wp-content\/uploads\/2025\/12\/91827f73-gemini2.jpg\" alt=\"\" width=\"776\" height=\"590\"\/><\/p>\n<p>Figure 2:\u00a0Gemini CLI is ready for your first query.<\/p>\n<p>Hit Enter, and Gemini will go to work.<\/p>\n<p>As it works, it\u2019ll most likely prompt you to okay certain tasks, or it\u2019ll prompt you to allow it to create files (Figure 3).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-22809427\" src=\"https:\/\/www.newsbeep.com\/ie\/wp-content\/uploads\/2025\/12\/a59fb739-gemini3.jpg\" alt=\"\" width=\"777\" height=\"588\"\/><\/p>\n<p>Figure 3: Resistance is futile, so give it permission to create the files.<\/p>\n<p>Continue allowing Gemini to do what it needs as it does what we\u2019ve asked of it.<\/p>\n<p>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).<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-22809428\" src=\"https:\/\/www.newsbeep.com\/ie\/wp-content\/uploads\/2025\/12\/e2cc7f31-gemini4.jpg\" alt=\"\" width=\"824\" height=\"724\"\/><\/p>\n<p>Figure 4: Our example drop-downs were successfully created.<\/p>\n<p>Okay, but how do we learn from this? Well, if you go back to your JS_PROJECT directory, you\u2019ll see three files:<\/p>\n<p>Or, you could run a follow-up like this:<\/p>\n<p>Gemini CLI will then walk you through what it did (Figure 5); either that, or it\u2019ll inform you that you\u2019ve either exhausted the resources of your free tier or the service is too busy. If that\u2019s the case, run the query again and see if it works.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-22809429\" src=\"https:\/\/www.newsbeep.com\/ie\/wp-content\/uploads\/2025\/12\/03c84e71-gemini5.jpg\" alt=\"\" width=\"775\" height=\"590\"\/><\/p>\n<p>Figure 5:\u00a0Let Gemini CLI explain to you how it created the drop-downs.<\/p>\n<p>Fun times.<\/p>\n<p>And that, my friends, is how you can install and use the Gemini CLI tool to learn something new or hone your current skills.<\/p>\n<p>\t<a class=\"row youtube-subscribe-block\" href=\"https:\/\/youtube.com\/thenewstack?sub_confirmation=1\" target=\"_blank\" rel=\"nofollow noopener\"><\/p>\n<p>\n\t\t\t\tYOUTUBE.COM\/THENEWSTACK\n\t\t\t<\/p>\n<p>\n\t\t\t\tTech moves fast, don&#8217;t miss an episode. Subscribe to our YouTube<br \/>\n\t\t\t\tchannel to stream all our podcasts, interviews, demos, and more.\n\t\t\t<\/p>\n<p>\t\t\t\tSUBSCRIBE<\/p>\n<p>\t<\/a><\/p>\n<p>    Group<br \/>\n    Created with Sketch.<\/p>\n<p>\t\t<a href=\"https:\/\/thenewstack.io\/author\/jack-wallen\/\" class=\"author-more-link\" rel=\"nofollow noopener\" target=\"_blank\"><\/p>\n<p>\t\t\t\t\t<img decoding=\"async\" class=\"post-author-avatar\" src=\"https:\/\/www.newsbeep.com\/ie\/wp-content\/uploads\/2025\/09\/1759072689_118_d7cbfb14-cropped-6e7d5ccd-jack_wallen.jpg\"\/><\/p>\n<p>\n\t\t\t\t\t\t\tJack 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&#8230;\t\t\t\t\t\t<\/p>\n<p>\t\t\t\t\t\tRead more from Jack Wallen\t\t\t\t\t\t<\/p>\n<p>\t\t<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"Some time ago, Google released the Gemini CLI (Command Line Interface) tool that is pretty impressive. Unlike many&hellip;\n","protected":false},"author":2,"featured_media":188034,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[61,60,80,34789],"class_list":["post-188033","post","type-post","status-publish","format-standard","has-post-thumbnail","category-technology","tag-ie","tag-ireland","tag-technology","tag-tutorial"],"_links":{"self":[{"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/posts\/188033","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/comments?post=188033"}],"version-history":[{"count":0,"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/posts\/188033\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/media\/188034"}],"wp:attachment":[{"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/media?parent=188033"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/categories?post=188033"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/tags?post=188033"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}