Getting Started with Gemini CLI
Welcome to the world of AI-powered command line tools! In this tutorial, you'll learn how to install and configure Gemini CLI to start leveraging Google's powerful AI capabilities directly from your terminal.
Prerequisites
Before we begin, make sure you have:
- A computer running Windows, macOS, or Linux
- Basic familiarity with command line interfaces
- A Google account for API access
Installation
Step 1: Install Node.js
Gemini CLI requires Node.js version 16 or higher. Download and install it from nodejs.org.
# Verify installation
node --version
npm --version
Step 2: Install Gemini CLI
Install the CLI globally using npm:
npm install -g @google/gemini-cli
Step 3: Verify Installation
Check if the installation was successful:
gemini --version
Configuration
광고
Setting up API Access
- Visit the Google AI Studio
- Create a new API key
- Set your API key as an environment variable:
export GEMINI_API_KEY="YOUR_API_KEY"
Basic Configuration
You can create a config file at ~/.gemini/config.json:
{
"model": "gemini-2.5-flash"
}
Your First Session
Let's start the Gemini CLI and test it:
gemini
Then in the interactive session, try:
> Explain quantum computing in simple terms
Congratulations! You've successfully installed and configured Gemini CLI. You're now ready to explore more advanced features.
Next Steps
- Learn about Advanced Prompting Techniques
- Explore API Integration
- Set up Automation & Scripting
광고