Gemini CLI Installation Guide


🔧 Installation Methods

Method 1: Quick Installation with npx (Recommended)

Features: No need for global installation, ideal for temporary use

npx https://github.com/google-gemini/gemini-cli

Method 2: Global Installation

Features: Suitable for continuous use

npm install -g @google/gemini-cli

🚀 How to Start

After installation, launch Gemini CLI with the following command:

gemini

🔑 Setting Your API Key

1. Obtain Your API Key

🛠️ Steps to set up API key in GCP:

  • Log in to GCP and enable the Gemini API:
    Access: https://console.cloud.google.com/
  • Enable: search for “Generative Language API” and enable it.
  • Create API key: “APIs & Services” > “Credentials” > Create API key

2. Set the API Key Environment Variable

For Linux / macOS:

export GEMINI_API_KEY="your-api-key"

For Windows:

set GEMINI_API_KEY="your-api-key"

📚 References

Official Repository:
https://github.com/google-gemini/gemini-cli


⚠️ Notes

  • Make sure to manage permissions appropriately in production environments.
  • Always check the official documentation for the latest information.

留下评论

通过 WordPress.com 设计一个这样的站点
从这里开始