Installing Gemini CLI
Setup
Set up Google’s Gemini CLI for AI assistance in your terminal.
Installing Gemini CLI
Creating with AI in the Loop — Terminal AI assistant
Gemini CLI brings Gemini AI directly to your terminal. You can ask questions, generate code, and work with your codebase from the command line.
macOS
brew install gemini-cliVerify: gemini --version
Windows
1) Install Node.js (version 20 or higher)
Download the LTS installer from https://nodejs.org and run it. Reboot if prompted.
Verify:
node -v
npm -v2) Install Gemini CLI
npm install -g @google/gemini-cliVerify: gemini --version
First run: Sign in
- Open a terminal in your project directory.
- Run
gemini. - Select Login with Google.
- Sign in with your personal Google account (not your .edu account).
After signing in, you can start chatting with Gemini about your code.
Free tier
- Gemini CLI can be used for free with a free tier Google Account
- Gemini CLI and Gemini Code Assist agent mode share quotas
- If you hit usage limits, you may need to wait until the next day for limits to reset
- There is also a paid tier with higher limits if needed
Troubleshooting
macOS: brew: command not found
Install Homebrew first. See Initial Setup (macOS).
Windows: node or npm not recognized
Restart your terminal after installing Node.js. If still not working, reinstall Node.js and make sure “Add to PATH” is checked.
Authentication issues
- Use a personal Google account, not your .edu account
- Try signing out and back in:
gemini --logoutthengemini
Resources
- Official docs: https://geminicli.com/docs/
- GitHub: https://github.com/google-gemini/gemini-cli