refactor: remove built-in Google auth in favor of external plugin

- Delete src/auth/antigravity/ directory (28 files)
- Delete src/google-auth.ts standalone wrapper
- Delete src/cli/commands/auth.ts CLI command
- Remove google_auth config option from schema
- Update CLI to remove auth command registration
- Update config-manager to remove google_auth handling
- Update documentation to reference external opencode-antigravity-auth plugin only
- Regenerate JSON schema

Users should install the opencode-antigravity-auth plugin for Gemini authentication.

BREAKING CHANGE: The google_auth config option is removed. Use the external plugin instead.
This commit is contained in:
Kenny
2026-01-13 09:01:04 -05:00
parent d68f90f796
commit 3afdaadaad
8 changed files with 10 additions and 120 deletions

View File

@@ -327,11 +327,10 @@ opencode auth login
#### 4.2.2 oh-my-opencode エージェントモデルのオーバーライド
`opencode-antigravity-auth` プラグインは内蔵 Google auth と異なるモデル名を使用します。`oh-my-opencode.json`(または `.opencode/oh-my-opencode.json`)でエージェントモデルをオーバーライドし、内蔵 `google_auth` を無効化してください:
`opencode-antigravity-auth` プラグインは特定のモデル名を使用します。エージェントモデルを `oh-my-opencode.json`(または `.opencode/oh-my-opencode.json`)でオーバーライドしてください:
```json
{
"google_auth": false,
"agents": {
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro-high" },
"document-writer": { "model": "google/antigravity-gemini-3-flash" },
@@ -393,7 +392,7 @@ opencode auth login
**ユーザーが明示的に要求しない限り、モデル設定を変更したり、機能エージェント、フック、MCPを無効化しないでください。**
プラグインはデフォルトで完璧に動作します。推奨される `google_auth: true` 設定を除き、明示的な要求なしに他の設定を変更したり機能をオフにしないでください。
プラグインはデフォルトで完璧に動作します。`opencode-antigravity-auth` を使用する場合は、上記の通りエージェントモデルをオーバーライドしてください。明示的な要求なしに他の設定を変更したり機能をオフにしないでください。
### セットアップの確認
@@ -760,9 +759,6 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
{
"$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
// Antigravity OAuth 経由で Google Gemini を有効にする
"google_auth": false,
/* エージェントのオーバーライド - 特定のタスクに合わせてモデルをカスタマイズ */
"agents": {
"oracle": {
@@ -779,11 +775,10 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
**推奨**: 外部の [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) プラグインを使用してください。マルチアカウントロードバランシング、より多くのモデルAntigravity 経由の Claude を含む)、活発なメンテナンスを提供します。[インストール > Google Gemini](#42-google-gemini-antigravity-oauth) を参照。
`opencode-antigravity-auth` 使用時は内蔵 auth を無効化し、`oh-my-opencode.json` でエージェントモデルをオーバーライドしてください:
`opencode-antigravity-auth` 使用時は `oh-my-opencode.json` でエージェントモデルをオーバーライドしてください:
```json
{
"google_auth": false,
"agents": {
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro-high" },
"document-writer": { "model": "google/antigravity-gemini-3-flash" },
@@ -792,14 +787,6 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
}
```
**代替案**: 内蔵 Antigravity OAuth を有効化単一アカウント、Gemini モデルのみ):
```json
{
"google_auth": true
}
```
### Agents
内蔵エージェント設定をオーバーライドできます:

View File

@@ -354,11 +354,10 @@ Read the [opencode-antigravity-auth documentation](https://github.com/NoeFabris/
##### oh-my-opencode Agent Model Override
The `opencode-antigravity-auth` plugin uses different model names than the built-in Google auth. Override the agent models in `oh-my-opencode.json` (or `.opencode/oh-my-opencode.json`) and disable the built-in `google_auth`:
The `opencode-antigravity-auth` plugin uses different model names than the built-in Google auth. Override the agent models in `oh-my-opencode.json` (or `.opencode/oh-my-opencode.json`):
```json
{
"google_auth": false,
"agents": {
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro-high" },
"document-writer": { "model": "google/antigravity-gemini-3-flash" },
@@ -420,7 +419,7 @@ opencode auth login
**Unless the user explicitly requests it, do not change model settings or disable features (agents, hooks, MCPs).**
The plugin works perfectly by default. Except for the recommended `google_auth: true` setting, do not change other settings or turn off features without an explicit request.
The plugin works perfectly by default. Do not change settings or turn off features without an explicit request.
### Verify the setup
@@ -804,9 +803,6 @@ When both `oh-my-opencode.jsonc` and `oh-my-opencode.json` files exist, `.jsonc`
{
"$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
// Enable Google Gemini via Antigravity OAuth
"google_auth": false,
/* Agent overrides - customize models for specific tasks */
"agents": {
"oracle": {
@@ -821,28 +817,7 @@ When both `oh-my-opencode.jsonc` and `oh-my-opencode.json` files exist, `.jsonc`
### Google Auth
**Recommended**: Use the external [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) plugin. It provides multi-account load balancing, more models (including Claude via Antigravity), and active maintenance. See [Installation > Google Gemini](#google-gemini-antigravity-oauth).
When using `opencode-antigravity-auth`, disable the built-in auth and override agent models in `oh-my-opencode.json`:
```json
{
"google_auth": false,
"agents": {
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro-high" },
"document-writer": { "model": "google/antigravity-gemini-3-flash" },
"multimodal-looker": { "model": "google/antigravity-gemini-3-flash" }
}
}
```
**Alternative**: Enable built-in Antigravity OAuth (single account, Gemini models only):
```json
{
"google_auth": true
}
```
**Recommended**: For Google Gemini authentication, install the [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) plugin. It provides multi-account load balancing, more models (including Claude via Antigravity), and active maintenance. See [Installation > Google Gemini](#google-gemini-antigravity-oauth).
### Agents

View File

@@ -353,11 +353,10 @@ opencode auth login
##### oh-my-opencode 智能体模型覆盖
`opencode-antigravity-auth` 插件使用与内置 Google 认证不同的模型名称。在 `oh-my-opencode.json`(或 `.opencode/oh-my-opencode.json`)中覆盖智能体模型,并禁用内置的 `google_auth`
`opencode-antigravity-auth` 插件使用特定的模型名称。在 `oh-my-opencode.json`(或 `.opencode/oh-my-opencode.json`)中覆盖智能体模型:
```json
{
"google_auth": false,
"agents": {
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro-high" },
"document-writer": { "model": "google/antigravity-gemini-3-flash" },
@@ -419,7 +418,7 @@ opencode auth login
**除非用户明确要求否则不要更改模型设置或禁用功能智能体、钩子、MCP**
该插件默认情况下运行良好。未使用外部 Antigravity 插件时保持 `google_auth: true`;如果按上方说明接入 `opencode-antigravity-auth`,请将 `google_auth` 设为 `false`覆盖智能体模型。除此之外,不要在没有明确请求的情况下更改其他设置或关闭功能。
该插件默认情况下运行良好。如果使用 `opencode-antigravity-auth`,请按上方说明覆盖智能体模型。除此之外,不要在没有明确请求的情况下更改其他设置或关闭功能。
### 验证安装
@@ -803,9 +802,6 @@ Oh My OpenCode 从以下位置读取和执行钩子:
{
"$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
// 通过 Antigravity OAuth 启用 Google Gemini
"google_auth": false,
/* 智能体覆盖 - 为特定任务自定义模型 */
"agents": {
"oracle": {
@@ -820,13 +816,12 @@ Oh My OpenCode 从以下位置读取和执行钩子:
### Google 认证
**推荐**使用外部 [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) 插件。它提供多账号负载均衡、更多模型(包括通过 Antigravity 的 Claude和积极的维护。参见[安装 > Google Gemini](#google-gemini-antigravity-oauth)。
使用外部 [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) 插件进行 Google 认证。它提供多账号负载均衡、更多模型(包括通过 Antigravity 的 Claude和积极的维护。参见[安装 > Google Gemini](#google-gemini-antigravity-oauth)。
使用 `opencode-antigravity-auth` 时,禁用内置认证并在 `oh-my-opencode.json` 中覆盖智能体模型:
使用 `opencode-antigravity-auth` 时,在 `oh-my-opencode.json` 中覆盖智能体模型:
```json
{
"google_auth": false,
"agents": {
"frontend-ui-ux-engineer": { "model": "google/antigravity-gemini-3-pro-high" },
"document-writer": { "model": "google/antigravity-gemini-3-flash" },
@@ -835,14 +830,6 @@ Oh My OpenCode 从以下位置读取和执行钩子:
}
```
**替代方案**:启用内置 Antigravity OAuth单账号仅 Gemini 模型):
```json
{
"google_auth": true
}
```
### 智能体
覆盖内置智能体设置:

View File

@@ -2099,9 +2099,6 @@
}
}
},
"google_auth": {
"type": "boolean"
},
"sisyphus_agent": {
"type": "object",
"properties": {

View File

@@ -267,10 +267,6 @@ export function generateOmoConfig(installConfig: InstallConfig): Record<string,
$schema: "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
}
if (installConfig.hasGemini) {
config.google_auth = false
}
const agents: Record<string, Record<string, unknown>> = {}
if (!installConfig.hasClaude) {
@@ -642,7 +638,6 @@ export function addProviderConfig(config: InstallConfig): ConfigMergeResult {
}
interface OmoConfigData {
google_auth?: boolean
agents?: Record<string, { model?: string }>
}
@@ -713,9 +708,6 @@ export function detectCurrentConfig(): DetectedConfig {
result.hasChatGPT = false
}
if (omoConfig.google_auth === false) {
result.hasGemini = plugins.some((p) => p.startsWith("opencode-antigravity-auth"))
}
} catch {
/* intentionally empty - malformed omo config returns defaults from opencode config detection */
}

View File

@@ -4,7 +4,6 @@ import { install } from "./install"
import { run } from "./run"
import { getLocalVersion } from "./get-local-version"
import { doctor } from "./doctor"
import { listAccounts, removeAccount } from "./commands/auth"
import type { InstallArgs } from "./types"
import type { RunOptions } from "./run"
import type { GetLocalVersionOptions } from "./get-local-version/types"
@@ -135,45 +134,6 @@ Categories:
process.exit(exitCode)
})
const authCommand = program
.command("auth")
.description("Manage Google Antigravity accounts")
authCommand
.command("list")
.description("List all Google Antigravity accounts")
.addHelpText("after", `
Examples:
$ bunx oh-my-opencode auth list
Shows:
- Account index and email
- Account tier (free/paid)
- Active account (marked with *)
- Rate limit status per model family
`)
.action(async () => {
const exitCode = await listAccounts()
process.exit(exitCode)
})
authCommand
.command("remove <index-or-email>")
.description("Remove an account by index or email")
.addHelpText("after", `
Examples:
$ bunx oh-my-opencode auth remove 0
$ bunx oh-my-opencode auth remove user@example.com
Note:
- Use 'auth list' to see account indices
- Removing the active account will switch to the next available account
`)
.action(async (indexOrEmail: string) => {
const exitCode = await removeAccount(indexOrEmail)
process.exit(exitCode)
})
program
.command("version")
.description("Show version information")

View File

@@ -311,7 +311,6 @@ export const OhMyOpenCodeConfigSchema = z.object({
agents: AgentOverridesSchema.optional(),
categories: CategoriesConfigSchema.optional(),
claude_code: ClaudeCodeConfigSchema.optional(),
google_auth: z.boolean().optional(),
sisyphus_agent: SisyphusAgentConfigSchema.optional(),
comment_checker: CommentCheckerConfigSchema.optional(),
experimental: ExperimentalConfigSchema.optional(),

View File

@@ -36,7 +36,6 @@ import {
createContextInjectorHook,
createContextInjectorMessagesTransformHook,
} from "./features/context-injector";
import { createGoogleAntigravityAuthPlugin } from "./auth/antigravity";
import { applyAgentVariant, resolveAgentVariant } from "./shared/agent-variant";
import { createFirstMessageVariantGate } from "./shared/first-message-variant";
import {
@@ -293,10 +292,6 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
? createAutoSlashCommandHook({ skills: mergedSkills })
: null;
const googleAuthHooks = pluginConfig.google_auth !== false
? await createGoogleAntigravityAuthPlugin(ctx)
: null;
const configHandler = createConfigHandler({
ctx,
pluginConfig,
@@ -304,8 +299,6 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
});
return {
...(googleAuthHooks ? { auth: googleAuthHooks.auth } : {}),
tool: {
...builtinTools,
...backgroundTools,