Skip to content

Commit 555abbc

Browse files
committed
fix(google-auth): integrate into main package via config option
Fixes #30. OpenCode's plugin loader treats subpath exports like "oh-my-opencode/google-auth" as separate npm packages, causing BunInstallFailedError. Solution: Enable Google auth via `google_auth: true` in oh-my-opencode.json instead of a separate subpath plugin. 🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
1 parent 3b129f1 commit 555abbc

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

README.ko.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ OpenCode 가 낭만이 사라진것같은 오늘날의 시대에, 당신에게
4343
- 이 플러그인은 [OpenCode Zen](https://opencode.ai/docs/zen/), Google, OpenAI, Anthropic 의 모델을 사용합니다.
4444
- Anthropic 모델들을 사용하기 위해 [OpenCode 의 내장 Claude Code Max Plan 로그인 기능](https://opencode.ai/docs/providers/#anthropic)을 사용하세요.
4545
- OpenAI 모델 (ChatGPT Plus/Pro)을 사용하기 위해 [OpenCode-OpenAI-Codex-Auth 플러그인](https://github.com/numman-ali/opencode-openai-codex-auth)을 설치하세요.
46-
- Google Gemini 모델을 위해 `oh-my-opencode/google-auth` 플러그인을 추가하세요 (**내장 Antigravity OAuth**).
46+
- Google Gemini 모델을 위해 `oh-my-opencode.json`에서 `google_auth: true`를 활성화하세요 (**내장 Antigravity OAuth**).
4747
- 다른 프로바이더를 위해 [VibeProxy (macOS Only)](https://github.com/automazeio/vibeproxy) 또는 [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI)를 대안으로 사용할 수 있습니다.
4848
- **사실 밑의 내용은 읽지 않아도 됩니다. 그냥 설치하시면 됩니다. 모델 설정하고나면 추가로 공부하거나 알 필요가 없고, 설치하고 나면 그냥 더 좋아집니다.**
4949
- **이 문서도 그냥 Claude Code, OpenCode, Cursor에 붙여넣고, 설치하고, 사용자의 개입이 필요할 때 알려달라고 프롬프팅하세요. 그럼 그냥 깔립니다.**
@@ -123,14 +123,11 @@ opencode auth login
123123

124124
#### 4.2 Google Gemini (내장 Antigravity OAuth)
125125

126-
먼저 google-auth 플러그인을 추가:
126+
먼저 `~/.config/opencode/oh-my-opencode.json` (또는 프로젝트 레벨의 `.opencode/oh-my-opencode.json`)에서 Google auth를 활성화:
127127

128128
```json
129129
{
130-
"plugin": [
131-
"oh-my-opencode",
132-
"oh-my-opencode/google-auth"
133-
]
130+
"google_auth": true
134131
}
135132
```
136133

README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Even if you don't, invest a little time. Boost your skills and productivity by m
4242
- This plugin utilizes models from [OpenCode Zen](https://opencode.ai/docs/zen/), Google, OpenAI, and Anthropic.
4343
- For Anthropic models, use [OpenCode's built-in Claude Code Max Plan login](https://opencode.ai/docs/providers/#anthropic).
4444
- For OpenAI models (ChatGPT Plus/Pro), install the [OpenCode-OpenAI-Codex-Auth plugin](https://github.com/numman-ali/opencode-openai-codex-auth).
45-
- For Google Gemini models, add `oh-my-opencode/google-auth` plugin for **built-in Antigravity OAuth**.
45+
- For Google Gemini models, enable `google_auth: true` in `oh-my-opencode.json` for **built-in Antigravity OAuth**.
4646
- For other providers, [VibeProxy (macOS Only)](https://github.com/automazeio/vibeproxy) or [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) remain available as alternatives.
4747
- **Truth be told, the rest is optional. Just install it. Once set up, no further learning is required. It simply evolves.**
4848
- **Paste this document into Claude Code, OpenCode, or Cursor, instruct it to install, and ask for assistance if needed. It just installs.**
@@ -122,14 +122,11 @@ opencode auth login
122122

123123
#### 4.2 Google Gemini (Built-in Antigravity OAuth)
124124

125-
First, add the google-auth plugin:
125+
First, enable Google auth in `~/.config/opencode/oh-my-opencode.json` (or `.opencode/oh-my-opencode.json` for project-level):
126126

127127
```json
128128
{
129-
"plugin": [
130-
"oh-my-opencode",
131-
"oh-my-opencode/google-auth"
132-
]
129+
"google_auth": true
133130
}
134131
```
135132

src/config/schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export const OhMyOpenCodeConfigSchema = z.object({
6464
disabled_agents: z.array(AgentNameSchema).optional(),
6565
agents: AgentOverridesSchema.optional(),
6666
claude_code: ClaudeCodeConfigSchema.optional(),
67+
google_auth: z.boolean().optional(),
6768
})
6869

6970
export type OhMyOpenCodeConfig = z.infer<typeof OhMyOpenCodeConfigSchema>

src/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
createBackgroundNotificationHook,
1717
createAutoUpdateCheckerHook,
1818
} from "./hooks";
19+
import { createGoogleAntigravityAuthPlugin } from "./auth/antigravity";
1920
import {
2021
loadUserCommands,
2122
loadProjectCommands,
@@ -173,7 +174,13 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
173174

174175
const callOmoAgent = createCallOmoAgent(ctx, backgroundManager);
175176

177+
const googleAuthHooks = pluginConfig.google_auth
178+
? await createGoogleAntigravityAuthPlugin(ctx)
179+
: null;
180+
176181
return {
182+
...(googleAuthHooks ? { auth: googleAuthHooks.auth } : {}),
183+
177184
tool: {
178185
...builtinTools,
179186
...backgroundTools,

0 commit comments

Comments
 (0)