安装和配置Gemini CLI需要以下几个步骤:
environmental preparation
- 确保已安装Node.js(版本18或以上)。
- 可从Node.js官网下载安装最新版本。
Installation
- 通过npx运行: Execute the
npx https://github.com/google-gemini/gemini-cli
- global installation: Implementation
npm install -g @google/gemini-cli
Authentication Configuration
- 个人Google账户:运行gemini后,系统会引导登录Google账户进行认证。
- API key:从Google AI Studio生成密钥,在终端设置环境变量
export GEMINI_API_KEY="YOUR_API_KEY"
After the installation is complete, rungemini
即可进入交互模式,首次运行时会提示选择颜色主题。
This answer comes from the articleGemini CLI: Google's open source command-line AI programming toolThe