Title
Gemini CLI not found
Check installation and Node.js version
node --version && npm list -g @google/gemini-cliAuthentication failed
Check Google account or API key
echo $GEMINI_API_KEY | head -c 10Permission denied
Check npm permissions or use npx
npx https://github.com/google-gemini/gemini-cliRate limit exceeded
Wait before making more requests
# Wait 60 seconds before retryingTitle
🔧
Installation Problems
Gemini CLI installation fails
Symptoms:
- npm install errors
- Permission denied
- Node.js version issues
Solutions:
- 1Ensure Node.js 18+ is installed: node --version
- 2Use npx instead of global install: npx https://github.com/google-gemini/gemini-cli
- 3Clear npm cache: npm cache clean --force
Prevention:
Use the recommended npx method for running Gemini CLI
Command not found after installation
Symptoms:
- gemini: command not found
- PATH issues
- Global install problems
Solutions:
- 1Use npx method: npx https://github.com/google-gemini/gemini-cli
- 2Check global npm directory: npm config get prefix
- 3Restart terminal and try again
Prevention:
Prefer npx over global installation for better compatibility
🔐
Authentication Issues
Google authentication fails
Symptoms:
- Authentication failed
- Browser not opening
- OAuth errors
Solutions:
- 1Ensure you're using a personal Google account
- 2Clear browser cookies and try again
- 3Use API key method: export GEMINI_API_KEY='your_key'
Prevention:
Use API key authentication for automated workflows
API key not working
Symptoms:
- Invalid API key
- 401 Unauthorized
- Authentication errors
Solutions:
- 1Verify API key from https://aistudio.google.com/apikey
- 2Check environment variable: echo $GEMINI_API_KEY
- 3Regenerate API key if needed
Prevention:
Store API keys securely and rotate them regularly
Diagnostic Tools
System Check
node --versionCheck Node.js version (need 18+)npm --versionVerify npm installationnpm list -g @google/gemini-cliCheck Gemini CLI installationecho $GEMINI_API_KEYCheck API key environment variablecurl -I https://generativelanguage.googleapis.comTest API connectivityDebug Mode
DEBUG=* npx https://github.com/google-gemini/gemini-cliEnable debug mode to see detailed logs and connection information
Debug techniques:
DEBUG=*- Enable all debug logs--verbose- Verbose output (if supported)console.log- Check browser console for errors