File tree Expand file tree Collapse file tree 2 files changed +74
-1
lines changed Expand file tree Collapse file tree 2 files changed +74
-1
lines changed Original file line number Diff line number Diff line change @@ -313,7 +313,7 @@ module.exports = {
313
313
{
314
314
title : "Node" ,
315
315
collapsable : false ,
316
- children : [ "" , "vitualbox-increase-space" ] ,
316
+ children : [ "" , "vitualbox-increase-space" , "gemini-cli" ] ,
317
317
} ,
318
318
] ,
319
319
"/about/index/" : [ { title : "INDEX" , collapsable : false , children : [ "" ] } ] ,
Original file line number Diff line number Diff line change
1
+ ---
2
+ title : ' 如何在 Mac 上安装 Gemini CLI'
3
+ sitemap :
4
+ exclude : false
5
+ changefreq : hourly
6
+ date : 2025-07-08
7
+ tags :
8
+ - tools
9
+ - gemini
10
+ ---
11
+
12
+ 本指南将指导您在 macOS 上安装和配置 Google 的 Gemini CLI.
13
+
14
+ ## 环境
15
+
16
+ - macOS 10.15 Catalina 或更高版本
17
+ - Node.js 18+(使用 node -v 检查)
18
+ - npm(与 Node.js 捆绑)或 Homebrew
19
+ - 稳定的网络连接
20
+
21
+ ## 安装方法
22
+
23
+ ### 方法 A — 直接使用 npx 运行
24
+
25
+ ``` sh
26
+ npx https://github.com/google-gemini/gemini-cli
27
+ ```
28
+
29
+ 此命令从 GitHub 获取 Gemini CLI 并立即启动它 - 无需全局安装。
30
+
31
+ ### 方法 B — 通过 npm 全局安装(推荐)
32
+
33
+ ``` sh
34
+ # Standard installation
35
+ npm install -g @google/gemini-cli
36
+
37
+ # Fix permissions if needed
38
+ sudo npm install -g @google/gemini-cli
39
+
40
+ # Apple Silicon
41
+ arch -arm64 npm install -g @google/gemini-cli
42
+
43
+ # Verify
44
+ gemini --version
45
+ ```
46
+
47
+ ## 首次配置
48
+
49
+ 出现提示时选择一个主题。
50
+
51
+ 选择使用 Google 登录可获得每分钟 60 个请求和每天 1000 个免费配额。
52
+
53
+ 完成浏览器授权(如果回调失败,则将 VPN 切换到全局模式)
54
+
55
+
56
+ ## 替代方案 — 使用 API 密钥
57
+
58
+ 需要更高的限制?在 Google AI Studio 中生成一个密钥,并将其设置为环境变量:
59
+
60
+ ``` sh
61
+ export GOOGLE_API_KEY=< YOUR_API_KEY>
62
+ ```
63
+
64
+ ## 技巧与窍门
65
+
66
+ 在交互模式下输入 ` / ` 来查看快捷方式。
67
+
68
+
69
+ 使用 @ 附加本地文件以获得上下文感知的答案。
70
+
71
+ 如果网络速度较慢,Gemini 将自动切换到轻量级的 gemini-2.5-flash 型号。
72
+
73
+
You can’t perform that action at this time.
0 commit comments