opencode-gemini-business 2.0.4 β 2.1.0
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/CHANGELOG.md +19 -0
- package/README.md +139 -266
- package/README.ru.md +143 -276
- package/bin/cli.js +1 -1
- package/dist/cli.d.ts +6 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +195 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +7 -55
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -246
- package/dist/index.js.map +1 -1
- package/dist/opencode-gemini-business-2.1.0.tgz +0 -0
- package/dist/src/gemini-business-api.d.ts.map +1 -1
- package/dist/src/gemini-business-api.js +83 -24
- package/dist/src/gemini-business-api.js.map +1 -1
- package/package.json +1 -1
- package/dist/opencode-gemini-business-2.0.4.tgz +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [2.1.0](https://github.com/izzzzzi/opencode-gemini-business/compare/v2.0.5...v2.1.0) (2026-02-15)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* update tests for named export and async plugin factory ([582bada](https://github.com/izzzzzi/opencode-gemini-business/commit/582badaa32aefd7cee8c39642224f06972e15b2e))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* auto-create auth record, update models and streaming ([13c5e8a](https://github.com/izzzzzi/opencode-gemini-business/commit/13c5e8a065051deadc4663757b42cbba189fcaec))
|
|
12
|
+
|
|
13
|
+
## [2.0.5](https://github.com/izzzzzi/opencode-gemini-business/compare/v2.0.4...v2.0.5) (2026-02-15)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Bug Fixes
|
|
17
|
+
|
|
18
|
+
* refactor plugin structure to fix OpenCode compatibility ([c7578ee](https://github.com/izzzzzi/opencode-gemini-business/commit/c7578ee9249cf2a8647470b449275de5684284e7))
|
|
19
|
+
|
|
1
20
|
## [2.0.4](https://github.com/izzzzzi/opencode-gemini-business/compare/v2.0.3...v2.0.4) (2026-02-15)
|
|
2
21
|
|
|
3
22
|
|
package/README.md
CHANGED
|
@@ -1,60 +1,61 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
1
3
|
# π opencode-gemini-business
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
**Multi-account Gemini Business pool with intelligent rotation for OpenCode**
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/opencode-gemini-business)
|
|
8
|
+
[](https://www.npmjs.com/package/opencode-gemini-business)
|
|
9
|
+
[](https://github.com/izzzzzi/opencode-gemini-business/releases)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
[](https://www.typescriptlang.org/)
|
|
12
|
+
[](https://nodejs.org/)
|
|
13
|
+
|
|
14
|
+
[π·πΊ Π ΡΡΡΠΊΠΈΠΉ](README.ru.md) | **π¬π§ English**
|
|
15
|
+
|
|
16
|
+
<br />
|
|
4
17
|
|
|
5
|
-
|
|
18
|
+
*Auth plugin for [OpenCode](https://github.com/anomalyco/opencode) β pool multiple Gemini Business accounts with automatic rotation, failover, and load balancing.*
|
|
6
19
|
|
|
7
|
-
|
|
8
|
-
[](https://www.npmjs.com/package/opencode-gemini-business)
|
|
9
|
-
[](https://nodejs.org/)
|
|
20
|
+
</div>
|
|
10
21
|
|
|
11
22
|
---
|
|
12
23
|
|
|
13
24
|
## π Overview
|
|
14
25
|
|
|
15
|
-
**opencode-gemini-business** is an OpenCode plugin that enables multi-account rotation for **Gemini Business API
|
|
26
|
+
**opencode-gemini-business** is an OpenCode plugin that enables multi-account rotation for **Gemini Business API** (`business.gemini.google`), providing automatic failover and load balancing across multiple accounts.
|
|
16
27
|
|
|
17
|
-
|
|
28
|
+
> **Important**: This plugin uses the **Gemini Business / Enterprise API**, NOT Google AI Studio.
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## β¨ Features
|
|
20
33
|
|
|
21
34
|
| Feature | Description |
|
|
22
35
|
|---------|-------------|
|
|
23
36
|
| π **Multi-Account Rotation** | Automatically rotate between multiple Gemini Business accounts |
|
|
24
37
|
| π‘οΈ **Automatic Failover** | Retry failed requests with different accounts seamlessly |
|
|
25
|
-
| π **
|
|
38
|
+
| π **JWT Authentication** | Built-in XSRF token retrieval and JWT (HS256) signing |
|
|
39
|
+
| π‘ **Streaming Support** | Full SSE streaming, JSON-lines, and fallback parsing |
|
|
26
40
|
| βοΈ **Flexible Strategies** | Round-robin, least-used, or random rotation |
|
|
27
|
-
|
|
|
28
|
-
| π **OpenCode Compatible** | Works seamlessly with OpenCode's provider system |
|
|
29
|
-
| πΎ **Persistent Config** | Secure storage in `~/.config/opencode/gemini-business-accounts.json` |
|
|
30
|
-
|
|
31
|
-
## π€ Supported Models
|
|
41
|
+
| π **Auto Auth Setup** | `add-account` automatically creates OpenCode auth record |
|
|
32
42
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
| Model | Context Length | Max Output | Best For |
|
|
36
|
-
|-------|---------------|------------|----------|
|
|
37
|
-
| `gemini-2.5-pro` | 1M tokens | 32K tokens | Complex reasoning, long documents |
|
|
38
|
-
| `gemini-2.5-flash` | 1M tokens | 8K tokens | Fast responses, simple tasks |
|
|
39
|
-
| `gemini-2.0-pro` | 2M tokens | 32K tokens | Massive context, deep analysis |
|
|
40
|
-
| `gemini-1.5-pro` | 2M tokens | 8K tokens | Production workloads |
|
|
41
|
-
| `gemini-1.5-flash` | 1M tokens | 8K tokens | Cost-effective development |
|
|
42
|
-
|
|
43
|
-
## π§ Installation & Configuration
|
|
43
|
+
---
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
## π€ Supported Models
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
| Model | Internal API ID | Best For |
|
|
48
|
+
|-------|:---------------:|---------|
|
|
49
|
+
| `gemini-2.5-flash` | `gemini-2.5-flash` | Everyday tasks, fast responses |
|
|
50
|
+
| `gemini-2.5-pro` | `gemini-2.5-pro` | Complex reasoning |
|
|
51
|
+
| `gemini-3-flash` | `gemini-3-flash-preview` | Next-gen fast model |
|
|
52
|
+
| `gemini-3-pro` | `gemini-3-pro-preview` | Next-gen reasoning |
|
|
50
53
|
|
|
51
|
-
|
|
54
|
+
---
|
|
52
55
|
|
|
53
|
-
|
|
54
|
-
npx opencode-gemini-business@latest
|
|
55
|
-
```
|
|
56
|
+
## π Quick Start
|
|
56
57
|
|
|
57
|
-
###
|
|
58
|
+
### Step 1: Configure OpenCode
|
|
58
59
|
|
|
59
60
|
Add to `~/.config/opencode/opencode.json`:
|
|
60
61
|
|
|
@@ -64,106 +65,31 @@ Add to `~/.config/opencode/opencode.json`:
|
|
|
64
65
|
"plugin": ["opencode-gemini-business@latest"],
|
|
65
66
|
"provider": {
|
|
66
67
|
"gemini-business": {
|
|
68
|
+
"name": "Gemini Business",
|
|
69
|
+
"options": {
|
|
70
|
+
"baseURL": "https://business.gemini.google/v1",
|
|
71
|
+
"apiKey": "unused"
|
|
72
|
+
},
|
|
67
73
|
"models": {
|
|
68
|
-
"gemini-2.5-pro": {
|
|
69
|
-
"name": "Gemini 2.5 Pro (Business)",
|
|
70
|
-
"limit": { "context": 1048576, "output": 32768 },
|
|
71
|
-
"modalities": { "input": ["text"], "output": ["text"] }
|
|
72
|
-
},
|
|
73
|
-
"gemini-2.5-flash": {
|
|
74
|
-
"name": "Gemini 2.5 Flash (Business)",
|
|
75
|
-
"limit": { "context": 1048576, "output": 8192 },
|
|
76
|
-
"modalities": { "input": ["text"], "output": ["text"] }
|
|
77
|
-
},
|
|
78
|
-
"gemini-2.0-pro": {
|
|
79
|
-
"name": "Gemini 2.0 Pro (Business)",
|
|
80
|
-
"limit": { "context": 2097152, "output": 32768 },
|
|
81
|
-
"modalities": { "input": ["text"], "output": ["text"] }
|
|
82
|
-
},
|
|
83
|
-
"gemini-1.5-pro": {
|
|
84
|
-
"name": "Gemini 1.5 Pro (Business)",
|
|
85
|
-
"limit": { "context": 2097152, "output": 8192 },
|
|
86
|
-
"modalities": { "input": ["text"], "output": ["text"] }
|
|
87
|
-
},
|
|
88
|
-
"gemini-1.5-flash": {
|
|
89
|
-
"name": "Gemini 1.5 Flash (Business)",
|
|
90
|
-
"limit": { "context": 1048576, "output": 8192 },
|
|
91
|
-
"modalities": { "input": ["text"], "output": ["text"] }
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
**Or use short aliases:**
|
|
100
|
-
|
|
101
|
-
```json
|
|
102
|
-
{
|
|
103
|
-
"$schema": "https://opencode.ai/config.json",
|
|
104
|
-
"plugin": ["opencode-gemini-business@latest"],
|
|
105
|
-
"provider": {
|
|
106
|
-
"gemini-business": {
|
|
107
|
-
"models": {
|
|
108
|
-
"gemini-2.5-pro": { "name": "Gemini 2.5 Pro" },
|
|
109
74
|
"gemini-2.5-flash": { "name": "Gemini 2.5 Flash" },
|
|
110
|
-
"gemini-2.
|
|
111
|
-
"gemini-
|
|
112
|
-
"gemini-
|
|
75
|
+
"gemini-2.5-pro": { "name": "Gemini 2.5 Pro" },
|
|
76
|
+
"gemini-3-flash": { "name": "Gemini 3 Flash" },
|
|
77
|
+
"gemini-3-pro": { "name": "Gemini 3 Pro" }
|
|
113
78
|
}
|
|
114
79
|
}
|
|
115
80
|
}
|
|
116
81
|
}
|
|
117
82
|
```
|
|
118
83
|
|
|
119
|
-
###
|
|
120
|
-
|
|
121
|
-
#### Method 1: Using Browser Extension (RECOMMENDED) β‘
|
|
122
|
-
|
|
123
|
-
**Use the "Get cookies.txt LOCALLY" extension** to export cookies including HttpOnly:
|
|
124
|
-
|
|
125
|
-
1. **Install Extension**:
|
|
126
|
-
- [Chrome Web Store: Get cookies.txt LOCALLY](https://chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc)
|
|
127
|
-
- This extension can export **all cookies** including HttpOnly (which JavaScript cannot access)
|
|
128
|
-
|
|
129
|
-
2. **Login** to [Gemini Business](https://business.gemini.google)
|
|
130
|
-
|
|
131
|
-
3. **Click extension icon** β Export cookies for `business.gemini.google`
|
|
132
|
-
|
|
133
|
-
4. **Find in exported file**:
|
|
134
|
-
- `__Secure-C_SES`: `CSE.xxx...`
|
|
135
|
-
- `__Host-C_OSES`: `COS.xxx...`
|
|
136
|
-
|
|
137
|
-
5. **Get csesidx from URL**:
|
|
138
|
-
- Look at your browser URL: `?csesidx=1370433092`
|
|
139
|
-
- Copy the number after `csesidx=`
|
|
140
|
-
|
|
141
|
-
6. **Get team_id from URL**:
|
|
142
|
-
- Look at your browser URL: `/cid/e1f353e7-0291-44cf-9085-e0b6efd20e41/`
|
|
143
|
-
- Copy the UUID after `/cid/` - this is your `team_id`
|
|
144
|
-
- Format: `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
|
|
145
|
-
|
|
146
|
-
7. **Add account** (see below)
|
|
84
|
+
### Step 2: Add Gemini Business account
|
|
147
85
|
|
|
148
|
-
|
|
86
|
+
Install the CLI tool:
|
|
149
87
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
- Look at your browser URL: `/cid/e1f353e7-0291-44cf-9085-e0b6efd20e41/`
|
|
154
|
-
- Copy the UUID after `/cid/` - this is your `team_id`
|
|
155
|
-
|
|
156
|
-
3. **Get csesidx from URL**:
|
|
157
|
-
- Look at your browser URL: `?csesidx=1370433092`
|
|
158
|
-
- Copy the number after `csesidx=`
|
|
159
|
-
|
|
160
|
-
4. **Open DevTools** (F12) β **Application** tab β **Cookies** β `https://business.gemini.google`
|
|
161
|
-
|
|
162
|
-
5. **Copy cookies**:
|
|
163
|
-
- Find `__Secure-C_SES` β copy the value
|
|
164
|
-
- Find `__Host-C_OSES` β copy the value
|
|
88
|
+
```bash
|
|
89
|
+
npm install -g opencode-gemini-business
|
|
90
|
+
```
|
|
165
91
|
|
|
166
|
-
|
|
92
|
+
Then add your account:
|
|
167
93
|
|
|
168
94
|
```bash
|
|
169
95
|
opencode-gemini-business add-account \
|
|
@@ -174,7 +100,17 @@ opencode-gemini-business add-account \
|
|
|
174
100
|
"1370433092"
|
|
175
101
|
```
|
|
176
102
|
|
|
177
|
-
|
|
103
|
+
Arguments:
|
|
104
|
+
|
|
105
|
+
| # | Argument | Description |
|
|
106
|
+
|:-:|----------|-------------|
|
|
107
|
+
| 1 | Account name | Display name for the account |
|
|
108
|
+
| 2 | `team_id` | UUID from URL `/cid/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/` |
|
|
109
|
+
| 3 | `__Secure-C_SES` | Cookie value (starts with `CSE.`) |
|
|
110
|
+
| 4 | `__Host-C_OSES` | Cookie value (starts with `COS.`) |
|
|
111
|
+
| 5 | `csesidx` | Number from URL `?csesidx=...` |
|
|
112
|
+
|
|
113
|
+
Or use environment variables:
|
|
178
114
|
|
|
179
115
|
```bash
|
|
180
116
|
export GEMINI_ACCOUNT_NAME="My Account"
|
|
@@ -186,206 +122,143 @@ export GEMINI_CSESIDX="1370433092"
|
|
|
186
122
|
opencode-gemini-business add-account
|
|
187
123
|
```
|
|
188
124
|
|
|
189
|
-
|
|
125
|
+
> **Note:** `add-account` automatically creates the auth record in `~/.local/share/opencode/auth.json`, so you don't need to run `opencode auth login`.
|
|
190
126
|
|
|
191
|
-
###
|
|
127
|
+
### Step 3: Use it
|
|
192
128
|
|
|
193
129
|
```bash
|
|
194
|
-
#
|
|
195
|
-
opencode run "
|
|
130
|
+
# Flash model (fast)
|
|
131
|
+
opencode run --model=gemini-business/gemini-2.5-flash "Fix this bug"
|
|
196
132
|
|
|
197
|
-
#
|
|
198
|
-
opencode run
|
|
133
|
+
# Pro model (best quality)
|
|
134
|
+
opencode run --model=gemini-business/gemini-2.5-pro "Design architecture"
|
|
199
135
|
|
|
200
|
-
#
|
|
201
|
-
opencode run
|
|
136
|
+
# Next-gen models
|
|
137
|
+
opencode run --model=gemini-business/gemini-3-flash "Quick task"
|
|
138
|
+
opencode run --model=gemini-business/gemini-3-pro "Complex reasoning"
|
|
202
139
|
```
|
|
203
140
|
|
|
204
|
-
|
|
141
|
+
Set as default model in `opencode.json`:
|
|
205
142
|
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
|
|
143
|
+
```json
|
|
144
|
+
{
|
|
145
|
+
"model": "gemini-business/gemini-2.5-flash"
|
|
146
|
+
}
|
|
147
|
+
```
|
|
209
148
|
|
|
210
|
-
|
|
211
|
-
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## π Extracting Credentials
|
|
212
152
|
|
|
213
|
-
|
|
214
|
-
opencode run "Analyze entire codebase" --model=gemini-2-pro
|
|
153
|
+
### Where to find each value
|
|
215
154
|
|
|
216
|
-
|
|
217
|
-
opencode run "Review this PR" --model=gemini-1.5-pro
|
|
155
|
+
Login to [business.gemini.google](https://business.gemini.google) and look at the URL:
|
|
218
156
|
|
|
219
|
-
|
|
220
|
-
|
|
157
|
+
```
|
|
158
|
+
https://business.gemini.google/home/cid/e1f353e7-0291-44cf-9085-e0b6efd20e41/r/session/123?csesidx=1370433092
|
|
159
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^
|
|
160
|
+
team_id (UUID after /cid/) csesidx
|
|
221
161
|
```
|
|
222
162
|
|
|
223
|
-
###
|
|
163
|
+
### Cookies
|
|
224
164
|
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
165
|
+
**Method 1: Browser Extension (Recommended)**
|
|
166
|
+
|
|
167
|
+
1. Install [Get cookies.txt LOCALLY](https://chromewebstore.google.com/detail/get-cookiestxt-locally/cclelndahbckbenkjhflpdbgdldlbecc)
|
|
168
|
+
2. Open `business.gemini.google` and export cookies
|
|
169
|
+
3. Find `__Secure-C_SES` (starts with `CSE.`) and `__Host-C_OSES` (starts with `COS.`)
|
|
230
170
|
|
|
231
|
-
|
|
171
|
+
**Method 2: DevTools**
|
|
172
|
+
|
|
173
|
+
1. Open DevTools (F12) β **Application** β **Cookies** β `https://business.gemini.google`
|
|
174
|
+
2. Copy `__Secure-C_SES` and `__Host-C_OSES` values
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## π§ Account Management
|
|
232
179
|
|
|
233
180
|
```bash
|
|
234
181
|
# List all accounts
|
|
235
182
|
opencode-gemini-business list-accounts
|
|
236
183
|
|
|
237
|
-
# Test
|
|
184
|
+
# Test account connectivity
|
|
238
185
|
opencode-gemini-business test-account <account_id>
|
|
239
186
|
|
|
240
187
|
# Remove account
|
|
241
188
|
opencode-gemini-business remove-account <account_id>
|
|
242
189
|
|
|
243
|
-
#
|
|
190
|
+
# Help
|
|
244
191
|
opencode-gemini-business help
|
|
245
192
|
```
|
|
246
193
|
|
|
247
|
-
|
|
194
|
+
---
|
|
248
195
|
|
|
249
|
-
|
|
250
|
-
|----------|----------|----------|
|
|
251
|
-
| `round-robin` | Cycles through accounts in order | Balanced usage across all accounts |
|
|
252
|
-
| `least-used` | Selects account with oldest last_used timestamp | Minimize individual account usage |
|
|
253
|
-
| `random` | Random probabilistic selection | Unpredictable load distribution |
|
|
196
|
+
## βοΈ Rotation Strategies
|
|
254
197
|
|
|
255
|
-
|
|
198
|
+
| Strategy | Behavior |
|
|
199
|
+
|----------|----------|
|
|
200
|
+
| `round-robin` (default) | Cycles through accounts in order |
|
|
201
|
+
| `least-used` | Selects least recently used account |
|
|
202
|
+
| `random` | Random selection |
|
|
256
203
|
|
|
257
|
-
|
|
258
|
-
{
|
|
259
|
-
"$schema": "https://opencode.ai/config.json",
|
|
260
|
-
"plugin": ["opencode-gemini-business@latest"],
|
|
261
|
-
"provider": {
|
|
262
|
-
"gemini-business": {
|
|
263
|
-
"rotation_strategy": "least-used", // β Change here
|
|
264
|
-
"models": {
|
|
265
|
-
"gemini-2.5-pro": {
|
|
266
|
-
"name": "Gemini 2.5 Pro (Business)",
|
|
267
|
-
"limit": { "context": 1048576, "output": 32768 },
|
|
268
|
-
"modalities": { "input": ["text"], "output": ["text"] }
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
## β FAQ
|
|
204
|
+
Configure in `~/.config/opencode/gemini-business-accounts.json` (auto-created on first `add-account`).
|
|
278
205
|
|
|
279
|
-
|
|
280
|
-
<summary><b>Q: How do I handle session expiration?</b></summary>
|
|
206
|
+
---
|
|
281
207
|
|
|
282
|
-
|
|
208
|
+
## π οΈ How It Works
|
|
283
209
|
|
|
284
|
-
|
|
210
|
+
1. Plugin registers as an OpenCode auth provider for `gemini-business`
|
|
211
|
+
2. When a request comes in, `loader()` returns a custom `fetch()` function
|
|
212
|
+
3. Custom `fetch()` intercepts the request from `@ai-sdk/openai-compatible`
|
|
213
|
+
4. Instead of calling `baseURL/chat/completions`, it:
|
|
214
|
+
- Picks an account via rotation strategy
|
|
215
|
+
- Gets XSRF token and creates JWT (HS256)
|
|
216
|
+
- Creates a session via `widgetCreateSession`
|
|
217
|
+
- Sends the actual request to `widgetStreamAssist`
|
|
218
|
+
- Converts the response back to OpenAI-compatible format
|
|
219
|
+
5. Supports both streaming (SSE) and non-streaming responses
|
|
285
220
|
|
|
286
|
-
|
|
287
|
-
<summary><b>Q: Which model should I use?</b></summary>
|
|
288
|
-
|
|
289
|
-
- **Complex tasks**: `gemini-2.5-pro` or `gemini-2.0-pro` for best reasoning
|
|
290
|
-
- **Quick tasks**: `gemini-2.5-flash` or `gemini-1.5-flash` for speed
|
|
291
|
-
- **Large contexts**: `gemini-2.0-pro` supports up to 2M tokens
|
|
221
|
+
---
|
|
292
222
|
|
|
293
|
-
|
|
223
|
+
## β FAQ
|
|
294
224
|
|
|
295
225
|
<details>
|
|
296
|
-
<summary><b>Q:
|
|
226
|
+
<summary><b>Q: Where do I find team_id?</b></summary>
|
|
297
227
|
|
|
298
|
-
|
|
228
|
+
Look at the URL in your browser: `https://business.gemini.google/home/cid/e1f353e7-0291-44cf-9085-e0b6efd20e41/...`
|
|
299
229
|
|
|
230
|
+
The UUID after `/cid/` is your `team_id`.
|
|
300
231
|
</details>
|
|
301
232
|
|
|
302
233
|
<details>
|
|
303
|
-
<summary><b>Q:
|
|
304
|
-
|
|
305
|
-
**Easy way:** Look at your browser URL when logged into Gemini Business:
|
|
306
|
-
```
|
|
307
|
-
https://business.gemini.google/home/cid/e1f353e7-0291-44cf-9085-e0b6efd20e41/...
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
The UUID after `/cid/` is your `team_id`. Format: `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
|
|
311
|
-
|
|
312
|
-
This ID identifies your organization/team in Google Workspace and is required for all API requests.
|
|
234
|
+
<summary><b>Q: Do I need to run `opencode auth login`?</b></summary>
|
|
313
235
|
|
|
236
|
+
No. The `add-account` command automatically creates the auth record in `~/.local/share/opencode/auth.json`. If for some reason it wasn't created, you can run `opencode auth login`, select **gemini-business**, and enter any key (e.g. `unused`).
|
|
314
237
|
</details>
|
|
315
238
|
|
|
316
239
|
<details>
|
|
317
|
-
<summary><b>Q:
|
|
318
|
-
|
|
319
|
-
**YES, 100% safe!** The script:
|
|
320
|
-
- β
Runs ONLY in your browser (locally)
|
|
321
|
-
- β
Does NOT send data to external servers
|
|
322
|
-
- β
Only reads cookies from business.gemini.google
|
|
323
|
-
- β
Open source - you can review the code
|
|
324
|
-
|
|
325
|
-
**Never** run scripts from untrusted sources. Only use from official repository.
|
|
240
|
+
<summary><b>Q: Session expired errors?</b></summary>
|
|
326
241
|
|
|
242
|
+
The plugin automatically refreshes sessions (cached for 50 minutes). If you see persistent errors, your cookies may have expired β re-extract them from the browser.
|
|
327
243
|
</details>
|
|
328
244
|
|
|
329
245
|
<details>
|
|
330
|
-
<summary><b>Q:
|
|
331
|
-
|
|
332
|
-
This plugin uses **Gemini Business API** (`business.gemini.google`), which is:
|
|
333
|
-
- β
Enterprise/business accounts
|
|
334
|
-
- β
Higher rate limits
|
|
335
|
-
- β
Business-grade features
|
|
336
|
-
|
|
337
|
-
**NOT** Google AI Studio (`aistudio.google.com`), which is:
|
|
338
|
-
- β Free/developer tier
|
|
339
|
-
- β Lower rate limits
|
|
340
|
-
- β Different API endpoints
|
|
246
|
+
<summary><b>Q: Difference from Google AI Studio?</b></summary>
|
|
341
247
|
|
|
248
|
+
This plugin uses **Gemini Business API** (`business.gemini.google`) β enterprise accounts with higher rate limits. NOT Google AI Studio (`aistudio.google.com`).
|
|
342
249
|
</details>
|
|
343
250
|
|
|
344
|
-
|
|
251
|
+
---
|
|
345
252
|
|
|
346
|
-
|
|
253
|
+
## π Security
|
|
347
254
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
- Store credentials only in ~/.config/opencode/gemini-business-accounts.json
|
|
353
|
-
- Use environment variables for temporary access
|
|
354
|
-
- Rotate credentials regularly
|
|
355
|
-
- Add *.json to .gitignore
|
|
356
|
-
|
|
357
|
-
β DON'T:
|
|
358
|
-
- Commit credentials to git repositories
|
|
359
|
-
- Share credentials with others
|
|
360
|
-
- Store credentials in plain text files
|
|
361
|
-
- Use credentials in public environments
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
### Cookie Extraction Script Safety
|
|
255
|
+
- Credentials are stored locally in `~/.config/opencode/gemini-business-accounts.json`
|
|
256
|
+
- Never commit credentials to git
|
|
257
|
+
- Rotate cookies regularly
|
|
258
|
+
- The plugin does not send credentials to any third-party services
|
|
365
259
|
|
|
366
|
-
|
|
367
|
-
β
The extraction script is SAFE because:
|
|
368
|
-
- Runs 100% locally in your browser
|
|
369
|
-
- NO external network requests
|
|
370
|
-
- NO data transmission to servers
|
|
371
|
-
- Open source and reviewable
|
|
372
|
-
|
|
373
|
-
β οΈ Security Tips:
|
|
374
|
-
- Only use from official repository
|
|
375
|
-
- Review code before running (it's short!)
|
|
376
|
-
- Never paste modified scripts
|
|
377
|
-
- Check browser console for any warnings
|
|
378
|
-
```
|
|
260
|
+
---
|
|
379
261
|
|
|
380
262
|
## π License
|
|
381
263
|
|
|
382
|
-
MIT
|
|
383
|
-
|
|
384
|
-
## π¬ Need Help?
|
|
385
|
-
|
|
386
|
-
- Check the [FAQ](#-faq) above for common questions
|
|
387
|
-
- Test your accounts: `opencode-gemini-business test-account <account_id>`
|
|
388
|
-
- Report issues: [GitHub Issues](https://github.com/izzzzzi/opencode-gemini-business/issues)
|
|
389
|
-
|
|
390
|
-
---
|
|
391
|
-
|
|
264
|
+
[MIT](LICENSE) Β© opencode-gemini-business contributors
|