What You'll Learn
- •How to install Gemini CLI on your system
- •Different authentication methods available
- •Running your first interactive session
- •Basic commands and interface navigation
Prerequisites
Node.js Installation
Ensure you have Node.js version 18 or higher installed on your system. You can download it from the official Node.js website.
Terminal Access
Basic familiarity with command-line interface and terminal operations.
Google Account
A personal Google account for authentication (or API key for advanced usage).
Installation
Method 1: Direct Execution (Recommended)
The quickest way to get started is to run Gemini CLI directly without installation:
npx https://github.com/google-gemini/gemini-cliNote: This method downloads and runs the latest version each time, ensuring you always have the most up-to-date features.
Method 2: Global Installation
For frequent use, install Gemini CLI globally on your system:
Install the package:
npm install -g @google/gemini-cliRun the CLI:
geminiAuthentication
Personal Google Account (Recommended for Beginners)
When you first run Gemini CLI, you'll be prompted to authenticate. This method provides:
- •Up to 60 requests per minute
- •1,000 requests per day
- •No API key setup required
Simply follow the authentication prompts when you first run the CLI. A browser window will open for you to sign in with your Google account.
API Key Authentication (Advanced)
For higher usage limits or specific model access, you can use an API key:
1. Generate an API key from Google AI Studio
2. Set it as an environment variable:
export GEMINI_API_KEY="your-api-key-here"Your First Session
Starting the CLI
Once installed and authenticated, start your first session:
1. Navigate to any directory and run:
gemini2. You'll see the Gemini CLI interface with a prompt:
> 3. Try your first command:
> Hello! Can you help me understand what Gemini CLI can do?Basic Interface Commands
Navigation Commands
ESCCancel current operationCtrl+CExit the CLI↑/↓Navigate command historyGetting Help
> helpShow available commands> What can you do?Ask about capabilitiesNext Steps
🎉 Congratulations!
You've successfully set up Gemini CLI and completed your first session. Here's what you can explore next: