How to Install Gemini CLI and Code With Gemini in Your Terminal
A free, open-source AI assistant from Google that runs in your terminal, where you can chat with Gemini, read and edit code, and automate routine work. This guide shows how to start it with one command.
What is Gemini CLI?
Gemini CLI is a free, open-source AI assistant from Google that runs in your terminal. It brings Gemini into the command line, where you can chat with it, ask it to read and edit code in your project, and automate routine work with commands. Instead of switching to a browser every time you need AI help with code, you stay in the terminal where the code already lives.
It works in your current project folder, so it can see your files and make changes in place. You can ask it to explain a codebase, find a bug, write a function, or run a multi-step task, and it works through the steps in the terminal while you watch.
What can you do with it?
- Chat with Gemini right in your terminal
- Read, edit and explain code in your project
- Automate tasks with one-off prompts and scripted commands
- Include several folders, pick a model, or get structured JSON output
How to install Gemini CLI
Gemini CLI runs through npx, so there is no global install. Open a terminal and run:
npx @google/gemini-cliOn Windows, run it in CMD rather than PowerShell, because PowerShell blocks npx scripts through its execution policy. On macOS or Linux, use a normal terminal. The first time you run it, sign in with your Google account when asked.
First steps after installing
Move into a project folder and start Gemini CLI with a single command:
geminiAsk it to explain the project structure first, so you can see how well it understands your code. Then try a small edit, such as adding a comment or fixing a typo, and review the change before accepting it. When you are comfortable, try a one-off prompt that prints an answer and exits, or ask it to run your tests and report the result.
Frequently asked questions
Is Gemini CLI free? The tool itself is free and open source. You sign in with a Google account, and usage follows Google's terms for the service.
Is it hard to install? No. One npx command is enough, and there is nothing to install globally.
How do I uninstall it? The project README does not list uninstall steps, so check the README on the project's GitHub page for the exact removal instructions.
Comments (0)