opencode-antigravity-auth-remix 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +428 -45
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Antigravity + Gemini CLI OAuth Plugin for Opencode (Enhanced Fork)
|
|
2
2
|
|
|
3
|
+
[English](#english) | [简体中文](#简体中文)
|
|
4
|
+
|
|
5
|
+
<a name="english"></a>
|
|
6
|
+
|
|
3
7
|
[](LICENSE)
|
|
4
8
|
|
|
5
9
|
> **This is an enhanced fork** that merges the best features from multiple excellent projects:
|
|
@@ -10,7 +14,7 @@
|
|
|
10
14
|
> | `google_search` Tool (Experimental) | [shekohex/opencode-google-antigravity-auth](https://github.com/shekohex/opencode-google-antigravity-auth) |
|
|
11
15
|
> | `generate_image` Tool (Native Implementation) | Ported from Antigravity Manager logic |
|
|
12
16
|
>
|
|
13
|
-
> **Status:** Version 1.1.
|
|
17
|
+
> **Status:** Version 1.1.1 - Fixed `@opencode-ai/plugin` dependency resolution (upgraded to v1.0.182+)
|
|
14
18
|
|
|
15
19
|
---
|
|
16
20
|
|
|
@@ -46,7 +50,7 @@ Install the opencode-antigravity-auth-remix plugin and add the Antigravity model
|
|
|
46
50
|
|
|
47
51
|
```json
|
|
48
52
|
{
|
|
49
|
-
"plugin": ["opencode-antigravity-auth-remix@1.1.
|
|
53
|
+
"plugin": ["opencode-antigravity-auth-remix@1.1.1"]
|
|
50
54
|
}
|
|
51
55
|
```
|
|
52
56
|
|
|
@@ -56,63 +60,179 @@ Install the opencode-antigravity-auth-remix plugin and add the Antigravity model
|
|
|
56
60
|
opencode auth login
|
|
57
61
|
```
|
|
58
62
|
|
|
59
|
-
3. **Add models**
|
|
60
|
-
|
|
61
|
-
```json
|
|
62
|
-
{
|
|
63
|
-
"plugin": ["opencode-antigravity-auth-remix@1.1.0"],
|
|
64
|
-
"provider": {
|
|
65
|
-
"google": {
|
|
66
|
-
"models": {
|
|
67
|
-
"antigravity-claude-sonnet-4-5": {
|
|
68
|
-
"name": "Claude Sonnet 4.5 (Antigravity)",
|
|
69
|
-
"limit": { "context": 200000, "output": 64000 },
|
|
70
|
-
"modalities": {
|
|
71
|
-
"input": ["text", "image", "pdf"],
|
|
72
|
-
"output": ["text"]
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
```
|
|
63
|
+
3. **Add models** - Copy the complete configuration below to your `~/.config/opencode/opencode.json`:
|
|
80
64
|
|
|
81
65
|
4. **Use it:**
|
|
82
66
|
|
|
83
67
|
```bash
|
|
84
|
-
opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5
|
|
68
|
+
opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5-thinking-high
|
|
85
69
|
```
|
|
86
70
|
|
|
87
71
|
## Available Models
|
|
88
72
|
|
|
89
73
|
### Antigravity Quota
|
|
90
74
|
|
|
91
|
-
Models with `antigravity-` prefix use Antigravity quota:
|
|
92
|
-
|
|
93
|
-
| Model
|
|
94
|
-
|
|
|
95
|
-
| `google/antigravity-gemini-3-
|
|
96
|
-
| `google/antigravity-gemini-3-
|
|
97
|
-
| `google/antigravity-
|
|
98
|
-
| `google/antigravity-claude-sonnet-4-5`
|
|
99
|
-
| `google/antigravity-claude-sonnet-4-5
|
|
100
|
-
| `google/antigravity-claude-sonnet-4-5-thinking-medium` | Sonnet with 16K thinking budget |
|
|
101
|
-
| `google/antigravity-claude-sonnet-4-5-thinking-high` | Sonnet with 32K thinking budget |
|
|
102
|
-
| `google/antigravity-claude-opus-4-5-thinking-low` | Opus with 8K thinking budget |
|
|
103
|
-
| `google/antigravity-claude-opus-4-5-thinking-medium` | Opus with 16K thinking budget |
|
|
104
|
-
| `google/antigravity-claude-opus-4-5-thinking-high` | Opus with 32K thinking budget |
|
|
75
|
+
Models with `antigravity-` prefix use **Antigravity quota** (Claude + Gemini 3):
|
|
76
|
+
|
|
77
|
+
| # | Model | Variants | Description |
|
|
78
|
+
|---| ------------------------------------------- | ------------------------------ | ------------------------------ |
|
|
79
|
+
| 01| `google/antigravity-gemini-3-pro` | `-low`, `-high` | Gemini 3 Pro with thinking |
|
|
80
|
+
| 02| `google/antigravity-gemini-3-flash` | `-minimal`, `-low`, `-medium`, `-high` | Gemini 3 Flash with thinking |
|
|
81
|
+
| 03| `google/antigravity-claude-opus-4-5-thinking` | `-low`, `-medium`, `-high` | Claude Opus 4.5 with thinking |
|
|
82
|
+
| 04| `google/antigravity-claude-sonnet-4-5-thinking` | `-low`, `-medium`, `-high` | Claude Sonnet 4.5 with thinking|
|
|
83
|
+
| 05| `google/antigravity-claude-sonnet-4-5` | - | Claude Sonnet 4.5 (no thinking)|
|
|
105
84
|
|
|
106
85
|
### Gemini CLI Quota
|
|
107
86
|
|
|
108
|
-
Models
|
|
87
|
+
Models without `antigravity-` prefix use **Gemini CLI quota**:
|
|
88
|
+
|
|
89
|
+
| # | Model | Variants | Description |
|
|
90
|
+
|---| ------------------------------- | ------------------------------------- | ------------------------------ |
|
|
91
|
+
| 06| `google/gemini-3-pro-preview` | `-low`, `-medium`, `-high` | Gemini 3 Pro (CLI quota) |
|
|
92
|
+
| 07| `google/gemini-3-flash-preview` | `-minimal`, `-low`, `-medium`, `-high`| Gemini 3 Flash (CLI quota) |
|
|
93
|
+
| 08| `google/gemini-2.5-pro` | - | Gemini 2.5 Pro |
|
|
94
|
+
| 09| `google/gemini-2.5-flash` | - | Gemini 2.5 Flash |
|
|
95
|
+
| 10| `google/gemini-2.5-flash-lite` | - | Gemini 2.5 Flash Lite |
|
|
96
|
+
|
|
97
|
+
## Complete Configuration
|
|
98
|
+
|
|
99
|
+
Copy this to `~/.config/opencode/opencode.json`:
|
|
100
|
+
|
|
101
|
+
```json
|
|
102
|
+
{
|
|
103
|
+
"$schema": "https://opencode.ai/config.json",
|
|
104
|
+
"plugin": ["opencode-antigravity-auth-remix@1.1.1"],
|
|
105
|
+
"provider": {
|
|
106
|
+
"google": {
|
|
107
|
+
"models": {
|
|
108
|
+
"antigravity-gemini-3-pro": {
|
|
109
|
+
"id": "antigravity-gemini-3-pro",
|
|
110
|
+
"name": "#01 Gemini 3 Pro (Antigravity)",
|
|
111
|
+
"reasoning": true,
|
|
112
|
+
"limit": { "context": 1048576, "output": 65535 },
|
|
113
|
+
"cost": { "input": 0, "output": 0 },
|
|
114
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
115
|
+
"variants": {
|
|
116
|
+
"low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
|
|
117
|
+
"high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"antigravity-gemini-3-flash": {
|
|
121
|
+
"id": "antigravity-gemini-3-flash",
|
|
122
|
+
"name": "#02 Gemini 3 Flash (Antigravity)",
|
|
123
|
+
"reasoning": true,
|
|
124
|
+
"limit": { "context": 1048576, "output": 65536 },
|
|
125
|
+
"cost": { "input": 0, "output": 0 },
|
|
126
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
127
|
+
"variants": {
|
|
128
|
+
"minimal": { "options": { "thinkingConfig": { "thinkingLevel": "minimal", "includeThoughts": true } } },
|
|
129
|
+
"low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
|
|
130
|
+
"medium": { "options": { "thinkingConfig": { "thinkingLevel": "medium", "includeThoughts": true } } },
|
|
131
|
+
"high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"antigravity-claude-opus-4-5-thinking": {
|
|
135
|
+
"id": "antigravity-claude-opus-4-5-thinking",
|
|
136
|
+
"name": "#03 Claude Opus 4.5 Thinking (Antigravity)",
|
|
137
|
+
"reasoning": true,
|
|
138
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
139
|
+
"cost": { "input": 0, "output": 0 },
|
|
140
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
141
|
+
"variants": {
|
|
142
|
+
"low": { "options": { "thinkingConfig": { "thinkingBudget": 8192, "includeThoughts": true } } },
|
|
143
|
+
"medium": { "options": { "thinkingConfig": { "thinkingBudget": 16384, "includeThoughts": true } } },
|
|
144
|
+
"high": { "options": { "thinkingConfig": { "thinkingBudget": 32768, "includeThoughts": true } } }
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"antigravity-claude-sonnet-4-5-thinking": {
|
|
148
|
+
"id": "antigravity-claude-sonnet-4-5-thinking",
|
|
149
|
+
"name": "#04 Claude Sonnet 4.5 Thinking (Antigravity)",
|
|
150
|
+
"reasoning": true,
|
|
151
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
152
|
+
"cost": { "input": 0, "output": 0 },
|
|
153
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
154
|
+
"variants": {
|
|
155
|
+
"low": { "options": { "thinkingConfig": { "thinkingBudget": 8192, "includeThoughts": true } } },
|
|
156
|
+
"medium": { "options": { "thinkingConfig": { "thinkingBudget": 16384, "includeThoughts": true } } },
|
|
157
|
+
"high": { "options": { "thinkingConfig": { "thinkingBudget": 32768, "includeThoughts": true } } }
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"antigravity-claude-sonnet-4-5": {
|
|
161
|
+
"id": "antigravity-claude-sonnet-4-5",
|
|
162
|
+
"name": "#05 Claude Sonnet 4.5 (Antigravity)",
|
|
163
|
+
"reasoning": false,
|
|
164
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
165
|
+
"cost": { "input": 0, "output": 0 },
|
|
166
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
167
|
+
},
|
|
168
|
+
"gemini-3-pro-preview": {
|
|
169
|
+
"id": "gemini-3-pro-preview",
|
|
170
|
+
"name": "#06 Gemini 3 Pro (CLI)",
|
|
171
|
+
"reasoning": true,
|
|
172
|
+
"limit": { "context": 1000000, "output": 64000 },
|
|
173
|
+
"cost": { "input": 0, "output": 0 },
|
|
174
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
175
|
+
"variants": {
|
|
176
|
+
"low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
|
|
177
|
+
"medium": { "options": { "thinkingConfig": { "thinkingLevel": "medium", "includeThoughts": true } } },
|
|
178
|
+
"high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"gemini-3-flash-preview": {
|
|
182
|
+
"id": "gemini-3-flash-preview",
|
|
183
|
+
"name": "#07 Gemini 3 Flash (CLI)",
|
|
184
|
+
"reasoning": true,
|
|
185
|
+
"limit": { "context": 1048576, "output": 65536 },
|
|
186
|
+
"cost": { "input": 0, "output": 0 },
|
|
187
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
188
|
+
"variants": {
|
|
189
|
+
"minimal": { "options": { "thinkingConfig": { "thinkingLevel": "minimal", "includeThoughts": true } } },
|
|
190
|
+
"low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
|
|
191
|
+
"medium": { "options": { "thinkingConfig": { "thinkingLevel": "medium", "includeThoughts": true } } },
|
|
192
|
+
"high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"gemini-2.5-pro": {
|
|
196
|
+
"id": "gemini-2.5-pro",
|
|
197
|
+
"name": "#08 Gemini 2.5 Pro (CLI)",
|
|
198
|
+
"reasoning": true,
|
|
199
|
+
"limit": { "context": 1048576, "output": 65536 },
|
|
200
|
+
"cost": { "input": 0, "output": 0 },
|
|
201
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
202
|
+
},
|
|
203
|
+
"gemini-2.5-flash": {
|
|
204
|
+
"id": "gemini-2.5-flash",
|
|
205
|
+
"name": "#09 Gemini 2.5 Flash (CLI)",
|
|
206
|
+
"reasoning": false,
|
|
207
|
+
"limit": { "context": 1048576, "output": 65536 },
|
|
208
|
+
"cost": { "input": 0, "output": 0 },
|
|
209
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
210
|
+
},
|
|
211
|
+
"gemini-2.5-flash-lite": {
|
|
212
|
+
"id": "gemini-2.5-flash-lite",
|
|
213
|
+
"name": "#10 Gemini 2.5 Flash Lite (CLI)",
|
|
214
|
+
"reasoning": false,
|
|
215
|
+
"limit": { "context": 1048576, "output": 65536 },
|
|
216
|
+
"cost": { "input": 0, "output": 0 },
|
|
217
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Usage Examples
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
# Antigravity quota models
|
|
229
|
+
opencode run "Hello" --model=google/antigravity-claude-sonnet-4-5-thinking-high
|
|
230
|
+
opencode run "Hello" --model=google/antigravity-gemini-3-pro-high
|
|
109
231
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
| `google/gemini-3-flash-preview` | Gemini 3 Flash (preview) |
|
|
115
|
-
| `google/gemini-3-pro-preview` | Gemini 3 Pro (preview) |
|
|
232
|
+
# Gemini CLI quota models
|
|
233
|
+
opencode run "Hello" --model=google/gemini-3-pro-preview-high
|
|
234
|
+
opencode run "Hello" --model=google/gemini-2.5-flash
|
|
235
|
+
```
|
|
116
236
|
|
|
117
237
|
## Built-in Tools
|
|
118
238
|
|
|
@@ -140,3 +260,266 @@ Web search and URL analysis. Currently experimental and may return "Preview acce
|
|
|
140
260
|
## License
|
|
141
261
|
|
|
142
262
|
MIT
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
266
|
+
<a name="简体中文"></a>
|
|
267
|
+
|
|
268
|
+
# Antigravity + Gemini CLI OAuth Opencode 插件 (增强分支)
|
|
269
|
+
|
|
270
|
+
[English](#english) | [简体中文](#简体中文)
|
|
271
|
+
|
|
272
|
+
[](LICENSE)
|
|
273
|
+
|
|
274
|
+
> **这是一个增强分支**,融合了多个优秀项目的核心功能:
|
|
275
|
+
>
|
|
276
|
+
> | 功能 | 来源 |
|
|
277
|
+
> | ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------- |
|
|
278
|
+
> | 双配额系统、多账号轮换、会话恢复、思考过程恢复 | [NoeFabris/opencode-antigravity-auth](https://github.com/NoeFabris/opencode-antigravity-auth) |
|
|
279
|
+
> | `google_search` 工具 (实验性) | [shekohex/opencode-google-antigravity-auth](https://github.com/shekohex/opencode-google-antigravity-auth) |
|
|
280
|
+
> | `generate_image` 工具 (原生实现) | 移植自 Antigravity Manager 逻辑 |
|
|
281
|
+
>
|
|
282
|
+
> **状态:** 版本 1.1.1 - 修复了 `@opencode-ai/plugin` 依赖解析问题 (已升级至 v1.0.182+)
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
使 Opencode 能够通过 OAuth 验证 **Antigravity** (Google 的 IDE),从而让你可以使用 Google 凭据访问 Antigravity 配额并使用 `gemini-3-pro-high` 和 `claude-opus-4-5-thinking` 等模型。
|
|
287
|
+
|
|
288
|
+
## 核心功能
|
|
289
|
+
|
|
290
|
+
- **Google OAuth 登录** - 通过 `opencode auth login` 自动刷新令牌
|
|
291
|
+
- **双配额系统** - 单个插件即可访问 Antigravity 配额 (Claude, Gemini 3) 和 Gemini CLI 配额
|
|
292
|
+
- **多账号轮换** - 支持添加多个 Google 账号;当某个账号触发频率限制时自动切换
|
|
293
|
+
- **实时 SSE 流式传输** - 包括思考块 (Thinking blocks) 和增量输出
|
|
294
|
+
- **扩展思考能力** - 原生支持 Claude 思考预算和 Gemini 3 思考等级
|
|
295
|
+
- **自动恢复** - 自动处理 Claude 的 `tool_result_missing` 错误并恢复会话
|
|
296
|
+
- **插件兼容性** - 可与其他 OpenCode 插件 (如 opencodesync 等) 同时运行
|
|
297
|
+
- **generate_image 工具** - AI 图像生成,支持自动保存、WebP 转换和 4K 输出 (稳定性视配额而定)
|
|
298
|
+
- **google_search 工具** - (开发中) 内置网页搜索。目前可能会返回 "Preview access required" 错误。
|
|
299
|
+
|
|
300
|
+
## 安装步骤
|
|
301
|
+
|
|
302
|
+
### 智能助手安装 (推荐)
|
|
303
|
+
|
|
304
|
+
将以下指令发送给任何 LLM 助手 (Claude Code, OpenCode, Cursor 等):
|
|
305
|
+
|
|
306
|
+
```
|
|
307
|
+
参考 https://raw.githubusercontent.com/Darkstarrd-dev/opencode-antigravity-auth/main/README.md 安装 opencode-antigravity-auth-remix 插件,并将 Antigravity 模型定义添加到 ~/.config/opencode/opencode.json。
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### 手动安装
|
|
311
|
+
|
|
312
|
+
1. **在配置中添加插件** (`~/.config/opencode/opencode.json`):
|
|
313
|
+
|
|
314
|
+
```json
|
|
315
|
+
{
|
|
316
|
+
"plugin": ["opencode-antigravity-auth-remix@1.1.1"]
|
|
317
|
+
}
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
2. **身份验证:**
|
|
321
|
+
|
|
322
|
+
```bash
|
|
323
|
+
opencode auth login
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
3. **添加模型定义** - 将下方的完整配置复制到你的 `~/.config/opencode/opencode.json`。
|
|
327
|
+
|
|
328
|
+
4. **开始使用:**
|
|
329
|
+
|
|
330
|
+
```bash
|
|
331
|
+
opencode run "你好" --model=google/antigravity-claude-sonnet-4-5-thinking-high
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
## 可用模型
|
|
335
|
+
|
|
336
|
+
### Antigravity 配额 (Antigravity Quota)
|
|
337
|
+
|
|
338
|
+
带有 `antigravity-` 前缀的模型使用 **Antigravity 配额** (包含 Claude 和 Gemini 3):
|
|
339
|
+
|
|
340
|
+
| # | 模型 | 变体 (Variants) | 描述 |
|
|
341
|
+
|---| ------------------------------------------- | ------------------------------ | ------------------------------ |
|
|
342
|
+
| 01| `google/antigravity-gemini-3-pro` | `-low`, `-high` | Gemini 3 Pro (带思考过程) |
|
|
343
|
+
| 02| `google/antigravity-gemini-3-flash` | `-minimal`, `-low`, `-medium`, `-high` | Gemini 3 Flash (带思考过程) |
|
|
344
|
+
| 03| `google/antigravity-claude-opus-4-5-thinking` | `-low`, `-medium`, `-high` | Claude Opus 4.5 (带思考预算) |
|
|
345
|
+
| 04| `google/antigravity-claude-sonnet-4-5-thinking` | `-low`, `-medium`, `-high` | Claude Sonnet 4.5 (带思考预算)|
|
|
346
|
+
| 05| `google/antigravity-claude-sonnet-4-5` | - | Claude Sonnet 4.5 (普通模式)|
|
|
347
|
+
|
|
348
|
+
### Gemini CLI 配额 (Gemini CLI Quota)
|
|
349
|
+
|
|
350
|
+
不带 `antigravity-` 前缀的模型使用 **Gemini CLI 配额**:
|
|
351
|
+
|
|
352
|
+
| # | 模型 | 变体 (Variants) | 描述 |
|
|
353
|
+
|---| ------------------------------- | ------------------------------------- | ------------------------------ |
|
|
354
|
+
| 06| `google/gemini-3-pro-preview` | `-low`, `-medium`, `-high` | Gemini 3 Pro (CLI 配额) |
|
|
355
|
+
| 07| `google/gemini-3-flash-preview` | `-minimal`, `-low`, `-medium`, `-high`| Gemini 3 Flash (CLI 配额) |
|
|
356
|
+
| 08| `google/gemini-2.5-pro` | - | Gemini 2.5 Pro |
|
|
357
|
+
| 09| `google/gemini-2.5-flash` | - | Gemini 2.5 Flash |
|
|
358
|
+
| 10| `google/gemini-2.5-flash-lite` | - | Gemini 2.5 Flash Lite |
|
|
359
|
+
|
|
360
|
+
## 完整配置示例
|
|
361
|
+
|
|
362
|
+
将以下内容复制到 `~/.config/opencode/opencode.json`:
|
|
363
|
+
|
|
364
|
+
```json
|
|
365
|
+
{
|
|
366
|
+
"$schema": "https://opencode.ai/config.json",
|
|
367
|
+
"plugin": ["opencode-antigravity-auth-remix@1.1.1"],
|
|
368
|
+
"provider": {
|
|
369
|
+
"google": {
|
|
370
|
+
"models": {
|
|
371
|
+
"antigravity-gemini-3-pro": {
|
|
372
|
+
"id": "antigravity-gemini-3-pro",
|
|
373
|
+
"name": "#01 Gemini 3 Pro (Antigravity)",
|
|
374
|
+
"reasoning": true,
|
|
375
|
+
"limit": { "context": 1048576, "output": 65535 },
|
|
376
|
+
"cost": { "input": 0, "output": 0 },
|
|
377
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
378
|
+
"variants": {
|
|
379
|
+
"low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
|
|
380
|
+
"high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
"antigravity-gemini-3-flash": {
|
|
384
|
+
"id": "antigravity-gemini-3-flash",
|
|
385
|
+
"name": "#02 Gemini 3 Flash (Antigravity)",
|
|
386
|
+
"reasoning": true,
|
|
387
|
+
"limit": { "context": 1048576, "output": 65536 },
|
|
388
|
+
"cost": { "input": 0, "output": 0 },
|
|
389
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
390
|
+
"variants": {
|
|
391
|
+
"minimal": { "options": { "thinkingConfig": { "thinkingLevel": "minimal", "includeThoughts": true } } },
|
|
392
|
+
"low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
|
|
393
|
+
"medium": { "options": { "thinkingConfig": { "thinkingLevel": "medium", "includeThoughts": true } } },
|
|
394
|
+
"high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
"antigravity-claude-opus-4-5-thinking": {
|
|
398
|
+
"id": "antigravity-claude-opus-4-5-thinking",
|
|
399
|
+
"name": "#03 Claude Opus 4.5 Thinking (Antigravity)",
|
|
400
|
+
"reasoning": true,
|
|
401
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
402
|
+
"cost": { "input": 0, "output": 0 },
|
|
403
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
404
|
+
"variants": {
|
|
405
|
+
"low": { "options": { "thinkingConfig": { "thinkingBudget": 8192, "includeThoughts": true } } },
|
|
406
|
+
"medium": { "options": { "thinkingConfig": { "thinkingBudget": 16384, "includeThoughts": true } } },
|
|
407
|
+
"high": { "options": { "thinkingConfig": { "thinkingBudget": 32768, "includeThoughts": true } } }
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
"antigravity-claude-sonnet-4-5-thinking": {
|
|
411
|
+
"id": "antigravity-claude-sonnet-4-5-thinking",
|
|
412
|
+
"name": "#04 Claude Sonnet 4.5 Thinking (Antigravity)",
|
|
413
|
+
"reasoning": true,
|
|
414
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
415
|
+
"cost": { "input": 0, "output": 0 },
|
|
416
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
417
|
+
"variants": {
|
|
418
|
+
"low": { "options": { "thinkingConfig": { "thinkingBudget": 8192, "includeThoughts": true } } },
|
|
419
|
+
"medium": { "options": { "thinkingConfig": { "thinkingBudget": 16384, "includeThoughts": true } } },
|
|
420
|
+
"high": { "options": { "thinkingConfig": { "thinkingBudget": 32768, "includeThoughts": true } } }
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
"antigravity-claude-sonnet-4-5": {
|
|
424
|
+
"id": "antigravity-claude-sonnet-4-5",
|
|
425
|
+
"name": "#05 Claude Sonnet 4.5 (Antigravity)",
|
|
426
|
+
"reasoning": false,
|
|
427
|
+
"limit": { "context": 200000, "output": 64000 },
|
|
428
|
+
"cost": { "input": 0, "output": 0 },
|
|
429
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
430
|
+
},
|
|
431
|
+
"gemini-3-pro-preview": {
|
|
432
|
+
"id": "gemini-3-pro-preview",
|
|
433
|
+
"name": "#06 Gemini 3 Pro (CLI)",
|
|
434
|
+
"reasoning": true,
|
|
435
|
+
"limit": { "context": 1000000, "output": 64000 },
|
|
436
|
+
"cost": { "input": 0, "output": 0 },
|
|
437
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
438
|
+
"variants": {
|
|
439
|
+
"low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
|
|
440
|
+
"medium": { "options": { "thinkingConfig": { "thinkingLevel": "medium", "includeThoughts": true } } },
|
|
441
|
+
"high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
"gemini-3-flash-preview": {
|
|
445
|
+
"id": "gemini-3-flash-preview",
|
|
446
|
+
"name": "#07 Gemini 3 Flash (CLI)",
|
|
447
|
+
"reasoning": true,
|
|
448
|
+
"limit": { "context": 1048576, "output": 65536 },
|
|
449
|
+
"cost": { "input": 0, "output": 0 },
|
|
450
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] },
|
|
451
|
+
"variants": {
|
|
452
|
+
"minimal": { "options": { "thinkingConfig": { "thinkingLevel": "minimal", "includeThoughts": true } } },
|
|
453
|
+
"low": { "options": { "thinkingConfig": { "thinkingLevel": "low", "includeThoughts": true } } },
|
|
454
|
+
"medium": { "options": { "thinkingConfig": { "thinkingLevel": "medium", "includeThoughts": true } } },
|
|
455
|
+
"high": { "options": { "thinkingConfig": { "thinkingLevel": "high", "includeThoughts": true } } }
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
"gemini-2.5-pro": {
|
|
459
|
+
"id": "gemini-2.5-pro",
|
|
460
|
+
"name": "#08 Gemini 2.5 Pro (CLI)",
|
|
461
|
+
"reasoning": true,
|
|
462
|
+
"limit": { "context": 1048576, "output": 65536 },
|
|
463
|
+
"cost": { "input": 0, "output": 0 },
|
|
464
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
465
|
+
},
|
|
466
|
+
"gemini-2.5-flash": {
|
|
467
|
+
"id": "gemini-2.5-flash",
|
|
468
|
+
"name": "#09 Gemini 2.5 Flash (CLI)",
|
|
469
|
+
"reasoning": false,
|
|
470
|
+
"limit": { "context": 1048576, "output": 65536 },
|
|
471
|
+
"cost": { "input": 0, "output": 0 },
|
|
472
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
473
|
+
},
|
|
474
|
+
"gemini-2.5-flash-lite": {
|
|
475
|
+
"id": "gemini-2.5-flash-lite",
|
|
476
|
+
"name": "#10 Gemini 2.5 Flash Lite (CLI)",
|
|
477
|
+
"reasoning": false,
|
|
478
|
+
"limit": { "context": 1048576, "output": 65536 },
|
|
479
|
+
"cost": { "input": 0, "output": 0 },
|
|
480
|
+
"modalities": { "input": ["text", "image", "pdf"], "output": ["text"] }
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
## 使用示例
|
|
489
|
+
|
|
490
|
+
```bash
|
|
491
|
+
# 使用 Antigravity 配额模型
|
|
492
|
+
opencode run "你好" --model=google/antigravity-claude-sonnet-4-5-thinking-high
|
|
493
|
+
opencode run "你好" --model=google/antigravity-gemini-3-pro-high
|
|
494
|
+
|
|
495
|
+
# 使用 Gemini CLI 配额模型
|
|
496
|
+
opencode run "你好" --model=google/gemini-3-pro-preview-high
|
|
497
|
+
opencode run "你好" --model=google/gemini-2.5-flash
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
## 内置工具
|
|
501
|
+
|
|
502
|
+
### generate_image (生图工具)
|
|
503
|
+
|
|
504
|
+
基于 `gemini-3-pro-image` 实现的 AI 图像生成工具,支持自动保存和 WebP 格式转换。
|
|
505
|
+
|
|
506
|
+
| 参数 | 类型 | 是否必填 | 默认值 | 描述 |
|
|
507
|
+
|-----------|------|----------|---------|-------------|
|
|
508
|
+
| `prompt` | string | 是 | - | 图像描述词 |
|
|
509
|
+
| `aspect_ratio` | string | 否 | "1:1" | 纵横比 |
|
|
510
|
+
| `quality` | string | 否 | "standard" | 图像质量 (hd = 4K) |
|
|
511
|
+
|
|
512
|
+
**支持的纵横比:** `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `21:9`
|
|
513
|
+
|
|
514
|
+
**主要特性:**
|
|
515
|
+
- 自动保存至项目目录下的 `{project}/imgs/`
|
|
516
|
+
- 同时生成 WebP 版本 (75% 质量) 以节省空间
|
|
517
|
+
- 支持动态配置 4K (HD) 高清输出
|
|
518
|
+
|
|
519
|
+
### google_search (搜索工具 - 开发中)
|
|
520
|
+
|
|
521
|
+
网页搜索和 URL 分析。由于 API 限制,目前处于实验阶段,可能会触发 "Preview access required" 错误。
|
|
522
|
+
|
|
523
|
+
## 开源协议
|
|
524
|
+
|
|
525
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-antigravity-auth-remix",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Remix of Antigravity Auth: Dual Account + Google Search (WIP) + Image Generation",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"typescript": "^5"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@opencode-ai/
|
|
52
|
+
"@opencode-ai/sdk": "^1.0.182",
|
|
53
53
|
"@types/node": "^24.10.1",
|
|
54
54
|
"@types/proper-lockfile": "^4.1.4",
|
|
55
55
|
"@types/sharp": "^0.32.0",
|
|
@@ -60,6 +60,7 @@
|
|
|
60
60
|
"zod-to-json-schema": "^3.25.0"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
+
"@opencode-ai/plugin": "^1.0.182",
|
|
63
64
|
"@openauthjs/openauth": "^0.4.3",
|
|
64
65
|
"proper-lockfile": "^4.1.2",
|
|
65
66
|
"sharp": "^0.34.5",
|