Gemini CLI
一個連接您的工具、理解您的程式碼並加速您工作流程的命令列 AI 工具。
此儲存庫包含 Gemini CLI,這是一個命令列 AI 工作流程工具,可以連接到您的工具、理解您的程式碼並加速您的工作流程。
透過 Gemini CLI,您可以:
快速開始
1 先決條件
確保您已安裝 Node.js 版本 18 或更高版本。
2 執行 CLI
在您的終端機中執行以下命令:
npx https://github.com/google-gemini/gemini-cli
或者使用 npm 安裝:
npm install -g @google/gemini-cli
gemini
3 選擇顏色主題
4 驗證
出現提示時,使用您的個人 Google 帳戶登入。這將允許您使用 Gemini,每分鐘最多 60 次模型請求,每天最多 1,000 次模型請求。
您現在已經準備好使用 Gemini CLI 了!
對於進階使用或增加限制:
如果您需要使用特定的模型或需要更高的請求容量,您可以使用 API 金鑰:
- 從 Google AI Studio 生成金鑰。
- 在您的終端機中將其設置為環境變數。將 `YOUR_API_KEY` 替換為您生成的金鑰。
export GEMINI_API_KEY="YOUR_API_KEY"
有關其他驗證方法,包括 Google Workspace 帳戶,請參閱驗證指南。
範例
從新目錄開始專案:
cd new-project/
gemini
> Write me a Gemini Discord bot that answers questions using a FAQ.md file I will provide
處理現有專案:
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` 進入一個現有或新克隆的儲存庫並執行 `gemini`。
"Describe the main pieces of this system's architecture."
"What security mechanisms are in place?"
使用您現有的程式碼
"Implement a first draft for GitHub issue #123."
"Help me migrate this codebase to the latest version of Java. Start with a plan."
自動化您的工作流程
使用 MCP 伺服器將您的本地系統工具與您的企業協作套件整合。
"Make me a slide deck showing the git history from the last 7 days, grouped by feature and team member."
"Make a full-screen web app for a wall display to show our most interacted-with GitHub issues."
與您的系統互動
"Convert all the images in this directory to png, and rename them to use dates from the exif data."
"Organise my PDF invoices by month of expenditure."