🚀

Getting Started with Gemini CLI

Learn the basics of installing and configuring Gemini CLI for your first AI-powered commands.

beginner5 min read
#installation#setup#basics

広告

広告

Getting Started with Gemini CLI

Welcome to the world of AI-powered command line tools! In this tutorial, you'll learn how to install and configure Gemini CLI to start leveraging Google's powerful AI capabilities directly from your terminal.

Prerequisites

Before we begin, make sure you have:

  • A computer running Windows, macOS, or Linux
  • Basic familiarity with command line interfaces
  • A Google account for API access

Installation

Step 1: Install Node.js

Gemini CLI requires Node.js version 16 or higher. Download and install it from nodejs.org.

# Verify installation
node --version
npm --version

Step 2: Install Gemini CLI

Install the CLI globally using npm:

npm install -g @google/gemini-cli

Step 3: Verify Installation

Check if the installation was successful:

gemini --version

Configuration

広告

Setting up API Access

  1. Visit the Google AI Studio
  2. Create a new API key
  3. Set your API key as an environment variable:
export GEMINI_API_KEY="YOUR_API_KEY"

Basic Configuration

You can create a config file at ~/.gemini/config.json:

{
  "model": "gemini-2.5-flash"
}

Your First Session

Let's start the Gemini CLI and test it:

gemini

Then in the interactive session, try:

> Explain quantum computing in simple terms

Congratulations! You've successfully installed and configured Gemini CLI. You're now ready to explore more advanced features.

Next Steps

広告

商標に関する注意

Google™, Gemini™ GoogleとGeminiはGoogle LLCの商標です。

すべての商標はそれぞれの所有者の財産です。