Steps
- 1
Step
Install Gemini CLI
This installs the gemini command globally with npm.
npm install -g @google/gemini-cli - 2
Step
Go to your project folder
Gemini reads context from the folder where you start it.
cd /path/to/your/project - 3
Step
Start Gemini
Sign in if prompted, then ask Gemini to explain, edit, or generate files in this folder.
gemini
Why this matters
Starting Gemini CLI from the right folder matters because AI coding tools use the current directory as their working context. This keeps the conversation focused on the project you actually want to improve.
Troubleshooting
- If npm is not recognized, install Node.js first from nodejs.org.
- If gemini is not recognized after install, restart Terminal or PowerShell.
- If login fails, run gemini again and complete the browser sign-in flow.
FAQ
What is Gemini CLI?
Gemini CLI is a terminal tool for using Google Gemini from your command line.
Does Gemini CLI work on Windows?
Yes. Use PowerShell or Windows Terminal after installing Node.js.
Why do I need to cd into a folder first?
The folder gives Gemini the project context it should inspect or help with.
Do I need Node.js?
Yes. The npm install command requires Node.js and npm.
Can Gemini CLI edit files?
Depending on mode and permissions, Gemini CLI can help generate or edit files. Review changes before keeping them.
Related tutorials
Copilot
How to Install GitHub Copilot CLI on Mac and Windows
Step-by-step guide to installing the GitHub Copilot CLI extension. Learn how to authenticate and run gh copilot suggest and explain in your terminal.
Aider
How to Install Aider AI Coding CLI on Mac and Windows
Step-by-step guide to installing the Aider AI pair programming CLI on macOS and Windows. Learn how to configure API keys for Claude 3.7 and GPT-4o.