在Ubuntu中安装 Google Gemini AI 的命令行工具

這是開發者常用的AI編程助手工具。

安裝步驟

1. 安裝依賴

bash

sudo apt update

sudo apt install curl git


2. 安裝 Node.js(Gemini CLI需要)

bash

curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -

sudo apt install -y nodejs


3. 安裝 Gemini CLI

bash

npm install -g @google/gemini-cli


4. 配置API密鑰或使用Google登入

bash

gemini config

# 然後輸入你的 Google AI Studio API 密鑰

獲取API密鑰:訪問 Google AI Studio 免費申請 (自行申請)


本篇使用Google登入



授權成功








留言

這個網誌中的熱門文章

使用VS code開發Python程式 - Matplotlib繪圖

使用Pycharm開發Python程式與用Matplotlib繪圖

LabVIEW教學: 如何在VI中使用.dll檔