导航

gemini-cli 安装

Posted on 2025-06-28 15:10  蝈蝈俊  阅读(1616)  评论(0)    收藏  举报

Gemini CLI 是一款开源、由人工智能驱动的代理,旨在将 Gemini 2.5 Pro 模型的功能直接引入开发者的终端。

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

Node.js 安装

需要 Node.js 18 或更高版本

下载地址:https://nodejs.org/en/download

默认安装

This package has installed:
	•	Node.js v24.3.0 to /usr/local/bin/node
	•	npm v11.4.2 to /usr/local/bin/npm
Make sure that /usr/local/bin is in your $PATH.

升级node.js

# 安装 n 模块
sudo npm install -g n

# 升级到最新的稳定版本:
sudo n stable

# 验证升级:
node -v
npm -v

安装 Gemini CLI

mac 下设置代理

export HTTP_PROXY="http://127.0.0.1:7897/"
export HTTPS_PROXY="http://127.0.0.1:7897/"

# 安装,升级也是这个命令
sudo npm install -g @google/gemini-cli

# 查看版本号
gemini -v 

# 执行
gemini

使用例子

git clone https://github.com/google-gemini/gemini-cli
cd gemini-cli
gemini
> Give me a summary of all of the changes that went in yesterday
> 



cd new-project/
gemini
> Write me a Gemini Discord bot that answers questions using a FAQ.md file I will provide