AI Tools and Technologies - Setup Google Gemini CLI

Vengat X · Beginner ·🧠 Large Language Models ·11mo ago

Key Takeaways

The video demonstrates the setup and usage of Google Gemini CLI, an open-source tool released by Google, with steps to install NodeJS, download and install the CLI, authenticate with an API key, and utilize the tool for LLM tasks.

Full Transcript

Hey guys, welcome back. This is Wenut. So in this video, we're going to see uh one of the tool which is released by uh Google Google Gemini CLA. You might you might have already hear this or you might have already see some of the news and all right. So um we're going to see like how we can able to set it in our local and how we can able to access it. Okay, so that's what we're going to see in this video. So let's get started. [Music] Okay. So the first thing is like uh any any language or any platform any software obviously sale is more powerful because uh every time uh all the persons won't rely on any of the codes right for example if I know the programming I can able to go and write some programming maybe Java or Python whichever the language I'm comfortable you might be in comfortable some of the language but many of the people's okay it's not like uh all the peoples will know the languages maybe they are more comfortable with just prompt and they more comfortable with CL CLA all those things right so for that only Google released one of the uh tool which is like Google Gemini CLA okay I'll show you so let me go here uh this is the that particular documentation from the Google blog so this is a open source project actually basically because if you go and go to the GitHub right if you click on this try now uh this will open this GitHub page okay so here you can go under each line and you will get to know what are what are the components are there how it is implemented how it is calling the Google Gemini API all those think you can able to see it. So that's the more interesting thing and it is free of cost only. You can download it in local and um you you not to pay for anything extra. Okay. But if you want any custom models you can go and pay for it. But most of the models will be free. That's what this documentation I read it you can if you see the documentation right you will see uh like 60 model requests per minute and one 1k model request per day which means these are all free. That much request you can able to give it through CLA only. Okay. It's a command prompt. CLA is a command line interface right and it's open source and available free of charge you can use this all those things through free of charge only there you have to pay pay for anything but if you want explicitly any particular model then you can go for and pay for it actually okay so now um if you click on the rhino you it will open this GitHub page here is the code okay this is the actual source code for to run the CLA okay uh what we going to do we're going to download this particular CLA in your local and we start to run and we'll do some prompting and we'll see how it is working under Okay. Um, so as I told right open source uh this particular thing is written on top of the JavaScript and TypeScript language majorly. Um, you can uh if you go to the code and you will see that because I see what are the components are available. Uh maybe I can tell you like what are the components all those things separate video and I'll navigate through the code how it is connecting all those things. But in this video we'll see how the setup and how we can able to use it. That's the whole intention of this video. And if you scroll down you can see uh this is the screenshot once it start to run that this kind of screenshot only you will see it. Okay. So the first requirement is like you should have the NodeJS in your local. Okay. So what you can do simply go here and you can type node and uh one site will come. So this is the NodeJS official site. You can directly go and download and uh you can take uh latest version. So previously the version it is mentioned as more than 18. I think now it's 20 I guess. Okay. The recommended version is 20 20 and higher than 20. So which means you can take the latest stable version. It is okay. So here 22 is the stable version. You can take it and you can once you can it's a double click only directly install in your machine. Okay. Once you install you can directly go to your command prompt type node - vy version second version. Yeah version if you type then you will see version 22. I that the 22 version I have already installed my machine. Once it is done then you're good to go. Then one more thing also you can type npm - we if you type this is a node package manager. Uh this is also available. Uh once you install you will get this automatically. This is the latest version. I mean it's around 11 version right 11.4.x versionion. Uh so now node is set up. Okay. Second thing is like you have to install the Google gemin. So by using npm npm has also already verified which is already there. this command you can directly take it npm okay npm install - g add google it's a package actually basically uh this package manager helps to install this package into our machine okay so here you will see g- g hyphen g is denoting it's a global once you install the globally you can access anywhere in the system it should it's not like you have to be in this particular folder that's not the case because the idea is like once you install global you can access anywhere if you go to any folder you can able to access okay now I'm just taking this uh let me take this command. I'm going here. I'm just clicking on this. Okay. So, only thing is I already installed it. It took some amount of time. Uh once it installed, you will get some message like it is successfully installed. Okay. I already installed. Uh it will take some couple of uh uh seconds to verify. Once it is there, then it will show like it's already installed. Okay. So, you can see right now I'm getting like um uh it is already installed. Okay. That's why I'm not seeing any extra logs. But if you start to install first, then it will you will see some logs. Okay. Uh so it is installed. Then what is the next step? Let me go to documentation. Once you will see the command is gemini. You can directly run the Gemini command. I just copy this command. Go here. Run it. Gemini. So now we are going to run the Gemini CLA in our local. That's what it's happening currently. Boom. It's running. Okay. Basically it's already started. Okay. But the only thing is you you you can see there is an error is coming. How would you like to authenticate for you for this project particular project? Basically you have to authenticate it. So for this also we can generate one API key. Okay, I'll show you how to generate. So you can go here and if you scroll down uh there is a uh in link called uh Google AI studio. So let just open this uh here you will see there is an option called create API key. Just click on this create API key. You will see uh what are the project you want to I mean if you have some projects so you can take the some default project and you can create. I'm just clicking on this particular project and creating the API key. So it will create one API key. Okay. Uh this is the AP key. Just copy it. Okay. Once you copy the API key, right? So we need to set this API key because this AP key is looking from the environment variable. Okay. That's what if you go to the documentation, you'll see once you get the AP key, you have to set it the AP key. This particular variable name Jin API key. Okay. Once you set it in the environment variable, you're ready to go. Okay. So let me go to the environment variable here. Let me click on this. Just go here variable. I'll create one environment variable. I'll first put it the AP key. I type Jmin AP key. Okay. So now GP is ready. I'm just clicking on okay. Now it won't reload automatically. What we need to we need to close it. Let me close it and I'll open it again. The same I will type it now. And Gemini. Okay. So now it should read that API key and it will start to run. See now it's running. So you are not getting any error. So let me hit it directly. Hey. Oh see it's giving. So giving some results. So let me ask uh maybe ask same question. Tell me some jokes about um dog. I think it's running. Let it run. Okay. Why did the snowman name is dog? Doc froze because he bites. Okay. So, some response is coming. Okay. So now we we are done with the setup of the uh Gemini CLA in local. You might think like okay here also I'm downloading the model and running it in the local. That's what we are doing right? No actually that is not the case. Okay. You are simply downloading the CLA this particular tool into your local machine. That's it. It's like a software. You are downloading one software and putting into local. That's it. You are not running any model in the local. How it is working? I'll tell you. Let me go to uh one sheet. Okay. So here your CLA is the uh Google CLA okay whenever you are typing something okay there are two components are there one is core component uh basically it's a CLA component it's a core component okay CLA whatever you typing it will receive the input that's a CLA component then it will pass the uh uh that message I mean whatever the prompt to the core component okay core is nothing but uh your actual core this particular code code base I go here this particular code base okay this will uh receive the results and this will construct the payload whatever the request you're passing and whether this API key is set it in the environment variable all those things it will receive and the code itself it will create uh the endpoint okay the request endpoint and it will hit the actual Gemini API okay and Gemini API using API key got it so basically it's not running anything in the local okay so this way it will be very easy to use and uh any machine you can download and use it straightforward you can directly download and go and use it the free also right so CLA CLA to core core is nothing but the actual code actual code will actually constructing separate uh endpoint request and it will using the APQ to actually request that's what you can see some delay it's actually requesting the endpoint and getting the results it's a network call basically okay uh this is the maybe I can show you how the code is written in such a way how it's connecting and all those things I can show it in the separate video but now you've got some gist Right. Okay. This is all about the Gemini CLA. Uh now you can able to play around with the CLA write command line. So you don't need any code. You don't want to write any language or you don't need to know any language or something who are all like non-coding background. You can directly use this model I mean not a model use this uh CLA and start to run it on your local and you can start hitting some prompts and you will get to know how it is working and all. And maybe I can show you like the other options how it is uh what are the options are there. Maybe I'll just put type help here. Type help. You can see there are many commands are coming. So here tools is there. I'll show you all some of the tools how we can able to utilize and you got some just right. So these are the commands. Maybe you can play around then you'll get some idea. I'll see you in the next video. Until then stay tuned. Bye-bye.

Original Description

#VengatX #Gemini #GenAI #AIApps #GoogleAI #GeminiCLI #AITools ____________________________________________________________ 🔗 Resources 📰 Official Google Blog on Gemini CLI: https://blog.google/technology/developers/introducing-gemini-cli-open-source-ai-agent/ 📲 Connect with Me 🔗 LinkedIn: https://www.linkedin.com/in/vengatesan-nagarajan/ ____________________________________________________________ 🎯 Subscribe to Vengat X for the latest on Generative AI, Java, Spring Boot, and Large Language Models. 👍 Like | 💬 Comment | 🔔 Subscribe
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

This video teaches how to set up and use Google Gemini CLI, a command-line interface for accessing Google Gemini API, and how to authenticate with an API key. It provides a hands-on guide to utilizing the tool for LLM tasks.

Key Takeaways
  1. Download and install NodeJS on the local machine
  2. Download the Google Gemini CLI from the official GitHub page
  3. Install Google Gemini CLI using npm
  4. Authenticate with API key
  5. Generate API key in Google AI Studio
  6. Set API key in environment variable
  7. Construct endpoint request to Gemini API
  8. Hit Gemini API using API key
💡 The Google Gemini CLI provides a command-line interface for accessing Google Gemini API, allowing users to utilize the tool for LLM tasks without writing code.

Related AI Lessons

How We Translate 300-Page Books Using Claude Without Hitting Token Limits
Learn how to translate long documents using Claude without hitting token limits by breaking them into overlapping chunks
Dev.to · 龚旭东
Building HITL Feedback RAG: Embeddings, Retrieval, and Reranking
Learn to build a Human-in-the-Loop (HITL) Feedback RAG system using embeddings, retrieval, and reranking to improve model performance
Medium · AI
Building HITL Feedback RAG: Embeddings, Retrieval, and Reranking
Learn to build a Human-in-the-Loop (HITL) Feedback RAG system using embeddings, retrieval, and reranking to improve LLM performance
Medium · LLM
A simple way to test model fallbacks with RouterBase
Learn to test model fallbacks with RouterBase using a simple fallback wrapper and OpenAI-compatible API surface
Dev.to · routerbasecom
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →