Model availability changes over time. Check the CometAPI Models page
for available Gemini models.
Prerequisites
Setup
1
Install Gemini CLI
2
Set environment variables
sk-your-cometapi-key with your actual CometAPI key.3
Start Gemini CLI
Persist environment variables
To avoid re-exporting every session, add to your shell config:Troubleshooting
Invalid API Key error
Invalid API Key error
Verify
GEMINI_API_KEY is set correctly. Run echo $GEMINI_API_KEY to check.fetch failed
fetch failed
Network restrictions may block the connection. Try a system-wide proxy.
Wrong Node.js version
Wrong Node.js version
Gemini CLI requires Node.js 22+. Run
node --version to check.Uninstall Gemini CLI
Uninstall Gemini CLI
Run
npm uninstall -g @google/gemini-cli.