Learn the fundamentals of Gemini CLI and start leveraging AI in your terminal workflow today.
After installation, try your first Gemini CLI command to verify everything is working correctly.
# Your first AI interaction
gemini "What is the weather like today?"
# Ask for coding help
gemini "Explain what this command does: ls -la"
# Get help with any topic
gemini "How do I create a React component?"
# Ask direct questions
gemini "What is Docker?"
# Get coding explanations
gemini "Explain async/await in JavaScript"
# Request comparisons
gemini "What's the difference between React and Vue?"
# Analyze a specific file
gemini "Review this code for bugs" --file app.js
# Process multiple files
gemini "Summarize these components" --file "src/components/*.tsx"
# Work with different file types
gemini "Extract key insights" --file presentation.pdf
# Analyze entire project structure
gemini "Describe the architecture of this application"
# Get improvement suggestions
gemini "How can I optimize this codebase for performance?"
# Security audit
gemini "Review this project for security vulnerabilities"
gemini --help
Show all available commands and optionsgemini --version
Display current version informationgemini auth status
Check authentication statusgemini config list
View current configuration settingsCustomize Gemini CLI to match your workflow and preferences.
# Set default model
gemini config set model gemini-2.5-pro
# Configure output format
gemini config set output-format markdown
# Set response streaming
gemini config set stream true
# Configure context window size
gemini config set max-tokens 100000
# Create project configuration
echo "model: gemini-2.5-pro
context-files: ['src/**/*.ts', 'docs/**/*.md']
exclude-patterns: ['node_modules', '*.log']
custom-instructions: |
This is a TypeScript React project.
Follow modern React patterns and hooks.
Include comprehensive error handling." > .gemini.yml
# Use project configuration
gemini "Analyze this project following our coding standards"
# Review a pull request
git diff main..feature-branch | gemini "Review this diff for potential issues"
# Analyze code complexity
gemini "Assess the complexity of this function and suggest simplifications" --file complex-function.js
# Security audit
gemini "Check for security vulnerabilities in this authentication code" --file auth.ts
# Generate documentation
gemini "Create comprehensive JSDoc comments for this module" --file utils.js
# Explain complex code
gemini "Explain how this algorithm works step by step" --file sorting-algorithm.py
# Learn new concepts
gemini "Teach me about microservices architecture with practical examples"
# Debug issues
gemini "Help me debug this error: TypeError cannot read property of undefined"
# Optimize performance
gemini "How can I improve the performance of this database query?" --file slow-query.sql
# Refactor code
gemini "Refactor this component to use modern React hooks" --file legacy-component.jsx
Ready to explore more? Check out the complete Commands Reference or dive into Practical Examples to see Gemini CLI in action.