GeminiCLI.net

Gemini CLI Installation Guide for macOS

blog.postMeta

Installing Gemini CLI on macOS

Getting Google's Gemini CLI up and running on your macOS machine is a straightforward process. You can choose between Homebrew, for a simple and managed installation, or npm (Node Package Manager) if you already have a Node.js environment set up.

Option 1: Using Homebrew (Recommended)

Homebrew is the recommended way to install and manage command-line tools on macOS.

  1. Install Homebrew: If you don't have Homebrew installed, open your Terminal and paste the following command:

    /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install Gemini CLI: Once Homebrew is ready, you can install Gemini CLI with a single command:

    brew install gemini-cli
  3. Verify Installation: To confirm that Gemini CLI was installed correctly, run:

    gemini --version

Option 2: Using npm

If you're a developer with Node.js and npm already installed, you might prefer this method.

  1. Install Node.js: If you don't have Node.js, we recommend installing it via the official package or a version manager like nvm. You need version 18 or higher.

  2. Install Gemini CLI Globally: Install the package globally using npm:

    npm install -g @google-gemini/cli
  3. Verify Installation: Check the installation by running:

    gemini --version

First-Time Setup

After installation, the first time you run a gemini command, you will be prompted to log in with your Google account. This is required to get your free license to use the Gemini API.

gemini prompt "Hello, world!"

Follow the on-screen instructions to authorize the tool. Once completed, you're ready to start using Gemini CLI!

SocialShare.shareArticle