How to Set Up Gemini CLI on Mac

Overview

This article explains how to set up Gemini CLI.

How to Set Up Gemini CLI

1. Install Gemini CLI

Use Homebrew to install Gemini CLI.

1
brew install gemini-cli

2. Configure Gemini CLI

Run the gemini command.

1
gemini

Gemini Startup Screen

You can choose to log in or enter an API key to use it.
This time, we will select “Login with Google” to log in.

Gemini Selection Screen

The screen transitions to the login page.

Login Screen

Once logged in, Gemini CLI becomes available.

Gemini Terminal

3. How to Use Gemini CLI

You can ask questions or request tasks using Gemini CLI.

This time, we will ask it to solve the FizzBuzz problem.

1
gemini

Type “Please write the code for FizzBuzz” into the Gemini CLI prompt.

Gemini CLI Prompt

After inputting, Gemini will generate the code for you.

Gemini CLI Execution Result

Summary

By setting up Gemini CLI, you can use Gemini AI directly from the terminal. This enables efficient development and task management using AI. Gemini CLI is very user-friendly and makes terminal work smoother. Give it a try!