Quick Start
Get Started with Gemini CLI
Get up and running with Gemini CLI in just a few minutes. This guide will walk you through installation, authentication, and your first AI-powered commands.
Estimated time: 5-10 minutes
Prerequisites: Node.js 16+ and npm/yarn installed on your system.
1
Installation
Install via npm
# Install globally
npm install -g @google/gemini-cli
# Or using yarn
yarn global add @google/gemini-cli
Verify Installation
gemini --version
This should output the installed version number.
2
Authentication
Set up API Access
You'll need a Google AI Studio API key to use Gemini CLI.
- Go to Google AI Studio
- Click "Create API Key"
- Copy your API key
# Authenticate with your API key
gemini auth login
# Or set environment variable
export GEMINI_API_KEY="your-api-key-here"
3
Your First Commands
Basic Chat
# Start an interactive chat session
gemini chat
# Or ask a single question
gemini ask "Explain how JavaScript closures work"
Code Generation
# Generate a React component
gemini generate --type component --name Button
# Generate from a prompt
gemini generate "Create a Python function to calculate fibonacci"
File Analysis
# Analyze a code file
gemini analyze src/components/Button.jsx
# Get suggestions for improvements
gemini review --file src/utils/helpers.js
You're All Set!
Congratulations! You've successfully installed and configured Gemini CLI. You're ready to start building AI-powered applications.
What's Next?
Learn the Basics
Follow our comprehensive getting started tutorial.
Explore Examples
See real-world examples and use cases.