Installing Gemini CLI¶
Gemini CLI is an open-source AI agent from Google that brings Gemini directly into your terminal. Think of it as having a coding partner that can read your files, write code, run commands, and explain things — all from the command line.
Prerequisites¶
You need Node.js version 20 or higher. Check if you have it:
If you see v20.x.x or higher, skip ahead to Install Gemini CLI. Otherwise, install Node.js first:
Download the installer from nodejs.org (LTS version). Run it and accept all defaults.
Verify after installation:
Install Gemini CLI¶
Option 1: Global install (Recommended)¶
Verify it installed:
Option 2: Run without installing¶
If you don't want to install it globally, you can run it directly with npx:
Which option?
Use Option 1 if you plan to use Gemini CLI regularly (recommended for this workshop). Use Option 2 for a quick try without committing to the install.
Authenticate with Google¶
The first time you run Gemini CLI, it will ask you to log in.
1. Start Gemini CLI¶
2. Choose authentication method¶
When prompted "How would you like to authenticate for this project?", select:
3. Sign in with your student account¶
A browser window will open. Sign in with the same university Google account you used for Gemini Pro in Module 1.
4. Grant permissions¶
Click Allow to let Gemini CLI access your account.
5. Return to the terminal¶
After authentication succeeds, you'll see a welcome message in your terminal and the Gemini CLI prompt will appear.
Rate limits
With your Google account, you get up to 60 requests per minute and 1,000 requests per day — more than enough for this workshop.
Verify It's Working¶
In the Gemini CLI prompt, type:
Gemini should detect your Python installation and tell you the version. If it asks for permission to run a command, type y to allow it.
To exit Gemini CLI:
Or press Ctrl + C.
Troubleshooting¶
gemini: command not found
Your npm global bin directory might not be in your PATH. Try:
Authentication fails or no browser opens
Try setting your default browser, or look for a URL printed in the terminal — you can manually copy and paste it into your browser.
Getting errors about Node.js version
Make sure you have Node.js 20+:
If it's older, update Node.js using the instructions above.Next: Using Gemini CLI →