oh-my-opencode 2.4.7 → 2.5.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/README.ja.md CHANGED
@@ -157,76 +157,23 @@ Windows から Linux に初めて乗り換えた時のこと、自分の思い
157
157
  あなたがユーザーの oh-my-opencode 設定を支援する LLM エージェントなら、以下の手順に従ってください:
158
158
 
159
159
 
160
- ### ステップ 0: セットアップについてユーザーに尋ねる
161
-
162
- OpenCode は様々なモデルをサポートしており、当プラグインは様々な最先端 LLM の使用を提案しています。そのため、ユーザーに以下の質問をする必要があります。
163
-
164
- **重要**: ユーザーがどのプロバイダーを持っているか追跡してください。ユーザーが Claude を持っていると確認した場合のみ、`anthropic/claude-opus-4-5` をフォールバックとして使用できます。Claude がない場合は、代わりに `opencode/big-pickle` をフォールバックとして使用してください。
165
-
166
- 1. **Claude Pro/Max のサブスクリプションをお持ちですか?** お持ちでない場合、メインオーケストレーターモデルとして 'opencode/big-pickle' (GLM 4.6 として知られる) を使用することになります (非推奨)。
167
- - ユーザーが**「はい」**と答えた場合、追加質問: **max20 (20x モード) を使用していますか?**
168
- - **「はい」 (max20)**: ToDo 追加: "ユーザーの Claude Pro/Max 認証設定" — librarian に Claude Sonnet 4.5 をフル使用。**記憶: Claude がフォールバックとして使用可能。**
169
- - **「いいえ」 (max20 ではない)**: ToDo 追加: "ユーザーの Claude Pro/Max 認証設定"、そして `~/.config/opencode/oh-my-opencode.json` に以下をマージ。**記憶: Claude がフォールバックとして使用可能。**
170
- ```json
171
- {
172
- "agents": {
173
- "librarian": { "model": "opencode/big-pickle" }
174
- }
175
- }
176
- ```
177
- - ユーザーが**「いいえ」** (Claude サブスクリプションなし) と答えた場合、`~/.config/opencode/oh-my-opencode.json` に以下を保存。**記憶: Claude は使用不可 — すべてのフォールバックは `opencode/big-pickle` を使用する必要があります。**
178
- ```json
179
- {
180
- "agents": {
181
- "Sisyphus": { "model": "opencode/big-pickle" },
182
- "librarian": { "model": "opencode/big-pickle" }
183
- }
184
- }
185
- ```
186
-
187
- 2. **ChatGPT のサブスクリプションをお持ちですか?** お持ちでない場合、oracle エージェントにフォールバックモデルを使用することになります。
188
- - ユーザーが**「はい」**と答えた場合、ToDo 追加: "ユーザーの ChatGPT 認証設定"
189
- - ユーザーが**「いいえ」**と答えた場合:
190
- - **Claude が使用可能な場合**: `oh-my-opencode.json` に以下をマージ:
191
- ```json
192
- {
193
- "agents": {
194
- "oracle": { "model": "anthropic/claude-opus-4-5" }
195
- }
196
- }
197
- ```
198
- - **Claude が使用不可の場合**: `oh-my-opencode.json` に以下をマージ:
199
- ```json
200
- {
201
- "agents": {
202
- "oracle": { "model": "opencode/big-pickle" }
203
- }
204
- }
205
- ```
206
-
207
- 3. **Gemini モデルを統合しますか?** 統合しない場合、美しいデザインを享受できません。
208
- - ユーザーが**「はい」**と答えた場合、ToDo 追加: "Google OAuth 設定"
209
- - ユーザーが**「いいえ」**と答えた場合:
210
- - **Claude が使用可能な場合**: `oh-my-opencode.json` に以下をマージ:
211
- ```json
212
- {
213
- "agents": {
214
- "frontend-ui-ux-engineer": { "model": "anthropic/claude-opus-4-5" },
215
- "document-writer": { "model": "anthropic/claude-opus-4-5" },
216
- "multimodal-looker": { "model": "anthropic/claude-opus-4-5" }
217
- }
218
- }
219
- ```
220
- - **Claude が使用不可の場合**: `oh-my-opencode.json` に以下をマージ:
221
- ```json
222
- {
223
- "agents": {
224
- "frontend-ui-ux-engineer": { "model": "opencode/big-pickle" },
225
- "document-writer": { "model": "opencode/big-pickle" },
226
- "multimodal-looker": { "model": "opencode/big-pickle" }
227
- }
228
- }
229
- ```
160
+ ### ステップ 0: サブスクリプション情報を確認
161
+
162
+ 以下の 3 つの質問をして CLI オプションを決定してください:
163
+
164
+ 1. **Claude Pro/Max のサブスクリプションをお持ちですか?**
165
+ - **はい**: **max20 (20x モード) を使用していますか?**
166
+ - **max20** `--claude=max20`
167
+ - **max20 ではない** `--claude=yes`
168
+ - **いいえ** `--claude=no`
169
+
170
+ 2. **ChatGPT のサブスクリプションをお持ちですか?**
171
+ - **はい** → `--chatgpt=yes`
172
+ - **いいえ** → `--chatgpt=no`
173
+
174
+ 3. **Gemini モデルを使用しますか?**
175
+ - **はい** → `--gemini=yes`
176
+ - **いいえ** → `--gemini=no`
230
177
 
231
178
  ### ステップ 1: OpenCode インストール確認
232
179
 
@@ -241,36 +188,28 @@ fi
241
188
 
242
189
  OpenCode がインストールされていない場合は、[OpenCode インストールガイド](https://opencode.ai/docs)を確認し、インストールを進めてください。コンテキストを節約するため、サブエージェントを呼び出してインストールを行わせ、その結果を報告させるように案内してください。
243
190
 
244
- ### ステップ 2: oh-my-opencode プラグイン設定
245
-
246
- #### JSONC
247
- - `~/.config/opencode/opencode.jsonc` が存在する場合は、そこで `oh-my-opencode` プラグインを追加してください。
191
+ ### ステップ 2: インストーラーを実行
248
192
 
249
- #### JSON
250
- - opencode.jsonc が存在しない場合は、以下のコマンドを実行して作成・登録してください。
193
+ ユーザーの回答に基づいて、適切なフラグで CLI インストーラーを実行してください:
251
194
 
252
195
  ```bash
253
- mkdir -p ~/.config/opencode
254
-
255
- if [ -f ~/.config/opencode/opencode.json ]; then
256
- # 既存の設定ファイルがある場合: jq または python で plugin を追加
257
- if command -v jq &> /dev/null; then
258
- jq '.plugin = ((.plugin // []) + ["oh-my-opencode"] | unique)' \
259
- ~/.config/opencode/opencode.json > /tmp/oc.json && \
260
- mv /tmp/oc.json ~/.config/opencode/opencode.json
261
- else
262
- echo "~/.config/opencode/opencode.json の plugin 配列に \"oh-my-opencode\" を追加してください"
263
- fi
264
- else
265
- # 新しい設定ファイル作成
266
- echo '{"plugin":["oh-my-opencode"]}' > ~/.config/opencode/opencode.json
267
- fi
196
+ bunx oh-my-opencode install --no-tui --claude=<yes|no|max20> --chatgpt=<yes|no> --gemini=<yes|no>
268
197
  ```
269
198
 
199
+ **例:**
200
+ - すべてのサブスクリプション + max20: `bunx oh-my-opencode install --no-tui --claude=max20 --chatgpt=yes --gemini=yes`
201
+ - Claude のみ(max20 なし): `bunx oh-my-opencode install --no-tui --claude=yes --chatgpt=no --gemini=no`
202
+ - サブスクリプションなし: `bunx oh-my-opencode install --no-tui --claude=no --chatgpt=no --gemini=no`
203
+
204
+ CLI が行うこと:
205
+ - `opencode.json` にプラグインを登録
206
+ - サブスクリプションフラグに基づいてエージェントモデルを設定
207
+ - 必要な認証ステップを表示
208
+
270
209
  ### ステップ 3: 設定確認
271
210
 
272
211
  ```bash
273
- opencode --version # 1.0.132 以上であること
212
+ opencode --version # 1.0.150 以上であること
274
213
  cat ~/.config/opencode/opencode.json # plugin 配列に "oh-my-opencode" が含まれていること
275
214
  ```
276
215
 
package/README.ko.md CHANGED
@@ -154,76 +154,23 @@ OpenCode 가 낭만이 사라진것같은 오늘날의 시대에, 당신에게
154
154
  당신이 사용자의 oh-my-opencode 설정을 돕는 LLM Agent라면, 다음 단계를 따르세요. 업데이트 과정이라고 할지라도 아래의 내용을 그대로 따르세요. 단, 설치 과정에서 이미 답했을 질문은 또 하지 않습니다.
155
155
 
156
156
 
157
- ### 0단계: 사용자에게 설정에 대해 물어보세요.
158
-
159
- OpenCode는 다양한 모델을 지원하며, 플러그인은 다양한 프론티어 LLM 사용을 제안합니다. 따라서 사용자에게 다음 질문을 해야 합니다.
160
-
161
- **중요**: 사용자가 어떤 프로바이더를 가지고 있는지 추적하세요. 사용자가 Claude 있다고 확인한 경우에만 `anthropic/claude-opus-4-5`를 폴백으로 사용할 수 있습니다. Claude가 없다면 `opencode/big-pickle`을 폴백으로 사용해야 합니다.
162
-
163
- 1. **Claude Pro/Max 구독이 있으신가요?** 그렇지 않다면 메인 오케스트레이터 모델로 'opencode/big-pickle'(GLM 4.6으로 알려짐)을 사용하게 됩니다 (권장하지 않음).
164
- - 사용자가 **'예'**라고 답하면, 추가 질문: **max20 (20x 모드)를 사용하고 계신가요?**
165
- - **'예' (max20)**: 할 일 추가: "사용자 Claude Pro/Max 인증 설정" — librarian에 Claude Sonnet 4.5 전체 사용. **기억: Claude를 폴백으로 사용 가능.**
166
- - **'아니오' (max20 아님)**: 할 일 추가: "사용자 Claude Pro/Max 인증 설정", 그리고 `~/.config/opencode/oh-my-opencode.json`에 다음을 병합. **기억: Claude를 폴백으로 사용 가능.**
167
- ```json
168
- {
169
- "agents": {
170
- "librarian": { "model": "opencode/big-pickle" }
171
- }
172
- }
173
- ```
174
- - 사용자가 **'아니오'** (Claude 구독 없음)라고 답하면, `~/.config/opencode/oh-my-opencode.json`에 다음을 저장. **기억: Claude 사용 불가 — 모든 폴백은 `opencode/big-pickle`을 사용해야 함.**
175
- ```json
176
- {
177
- "agents": {
178
- "Sisyphus": { "model": "opencode/big-pickle" },
179
- "librarian": { "model": "opencode/big-pickle" }
180
- }
181
- }
182
- ```
183
-
184
- 2. **ChatGPT 구독이 있으신가요?** 그렇지 않다면 oracle 에이전트에 폴백 모델을 사용하게 됩니다.
185
- - 사용자가 **'예'**라고 답하면, 할 일 추가: "사용자 ChatGPT 인증 설정"
186
- - 사용자가 **'아니오'**라고 답하면:
187
- - **Claude가 사용 가능한 경우**: `oh-my-opencode.json`에 다음을 병합:
188
- ```json
189
- {
190
- "agents": {
191
- "oracle": { "model": "anthropic/claude-opus-4-5" }
192
- }
193
- }
194
- ```
195
- - **Claude가 사용 불가능한 경우**: `oh-my-opencode.json`에 다음을 병합:
196
- ```json
197
- {
198
- "agents": {
199
- "oracle": { "model": "opencode/big-pickle" }
200
- }
201
- }
202
- ```
203
-
204
- 3. **Gemini 모델을 통합하시겠습니까?** 그렇지 않다면 아름다운 디자인을 즐길 수 없습니다.
205
- - 사용자가 **'예'**라고 답하면, 할 일 추가: "Google OAuth 설정"
206
- - 사용자가 **'아니오'**라고 답하면:
207
- - **Claude가 사용 가능한 경우**: `oh-my-opencode.json`에 다음을 병합:
208
- ```json
209
- {
210
- "agents": {
211
- "frontend-ui-ux-engineer": { "model": "anthropic/claude-opus-4-5" },
212
- "document-writer": { "model": "anthropic/claude-opus-4-5" },
213
- "multimodal-looker": { "model": "anthropic/claude-opus-4-5" }
214
- }
215
- }
216
- ```
217
- - **Claude가 사용 불가능한 경우**: `oh-my-opencode.json`에 다음을 병합:
218
- ```json
219
- {
220
- "agents": {
221
- "frontend-ui-ux-engineer": { "model": "opencode/big-pickle" },
222
- "document-writer": { "model": "opencode/big-pickle" },
223
- "multimodal-looker": { "model": "opencode/big-pickle" }
224
- }
225
- }
226
- ```
157
+ ### 0단계: 구독 정보 확인
158
+
159
+ 사용자에게 다음 3가지 질문을 하여 CLI 옵션을 결정하세요:
160
+
161
+ 1. **Claude Pro/Max 구독이 있으신가요?**
162
+ - **예**: **max20 (20x 모드)를 사용하고 계신가요?**
163
+ - **max20** `--claude=max20`
164
+ - **max20 아님** `--claude=yes`
165
+ - **아니오** `--claude=no`
166
+
167
+ 2. **ChatGPT 구독이 있으신가요?**
168
+ - **예** → `--chatgpt=yes`
169
+ - **아니오** → `--chatgpt=no`
170
+
171
+ 3. **Gemini 모델을 사용하시겠습니까?**
172
+ - **예** → `--gemini=yes`
173
+ - **아니오** → `--gemini=no`
227
174
 
228
175
  ### 1단계: OpenCode 설치 확인
229
176
 
@@ -238,36 +185,28 @@ fi
238
185
 
239
186
  OpenCode가 설치되어 있지 않다면, [OpenCode 설치 가이드](https://opencode.ai/docs)를 읽고, 설치를 진행하세요. 컨텍스트를 줄이기 위해 Subagent 로 호출하여 설치를 하라고 안내하고, 그 결과를 보고 받는다고 말하세요.
240
187
 
241
- ### 2단계: oh-my-opencode 플러그인 설정
242
-
243
- #### JSONC
244
- - `~/.config/opencode/opencode.jsonc`가 존재한다면, 그곳에 `oh-my-opencode` 플러그인을 추가하세요.
188
+ ### 2단계: 설치 프로그램 실행
245
189
 
246
- #### JSON
247
- - opencode.jsonc가 없다면, 다음 명령어를 실행하여 생성하고 등록하세요.
190
+ 사용자의 답변을 바탕으로 적절한 플래그와 함께 CLI 설치 프로그램을 실행하세요:
248
191
 
249
192
  ```bash
250
- mkdir -p ~/.config/opencode
251
-
252
- if [ -f ~/.config/opencode/opencode.json ]; then
253
- # 기존 설정 파일이 있는 경우: jq 또는 python으로 plugin 추가
254
- if command -v jq &> /dev/null; then
255
- jq '.plugin = ((.plugin // []) + ["oh-my-opencode"] | unique)' \
256
- ~/.config/opencode/opencode.json > /tmp/oc.json && \
257
- mv /tmp/oc.json ~/.config/opencode/opencode.json
258
- else
259
- echo "~/.config/opencode/opencode.json의 plugin 배열에 \"oh-my-opencode\"를 추가하세요"
260
- fi
261
- else
262
- # 새 설정 파일 생성
263
- echo '{"plugin":["oh-my-opencode"]}' > ~/.config/opencode/opencode.json
264
- fi
193
+ bunx oh-my-opencode install --no-tui --claude=<yes|no|max20> --chatgpt=<yes|no> --gemini=<yes|no>
265
194
  ```
266
195
 
196
+ **예시:**
197
+ - 모든 구독 + max20: `bunx oh-my-opencode install --no-tui --claude=max20 --chatgpt=yes --gemini=yes`
198
+ - Claude만 (max20 없음): `bunx oh-my-opencode install --no-tui --claude=yes --chatgpt=no --gemini=no`
199
+ - 구독 없음: `bunx oh-my-opencode install --no-tui --claude=no --chatgpt=no --gemini=no`
200
+
201
+ CLI가 수행하는 작업:
202
+ - `opencode.json`에 플러그인 등록
203
+ - 구독 플래그에 따라 에이전트 모델 설정
204
+ - 필요한 인증 단계 안내
205
+
267
206
  ### 3단계: 설정 확인
268
207
 
269
208
  ```bash
270
- opencode --version # 1.0.132 이상이어야 함
209
+ opencode --version # 1.0.150 이상이어야 함
271
210
  cat ~/.config/opencode/opencode.json # plugin 배열에 "oh-my-opencode"가 있어야 함
272
211
  ```
273
212
 
package/README.md CHANGED
@@ -168,7 +168,17 @@ If you don't want all this, as mentioned, you can just pick and choose specific
168
168
 
169
169
  ### For Humans
170
170
 
171
- Let the LLM Agent handle the grunt work. Paste this into a fresh opencode session:
171
+ Run the interactive installer:
172
+
173
+ ```bash
174
+ bunx oh-my-opencode install
175
+ ```
176
+
177
+ Follow the prompts to configure your Claude, ChatGPT, and Gemini subscriptions. After installation, authenticate your providers as instructed.
178
+
179
+ **Alternative: Let an LLM Agent do it**
180
+
181
+ Paste this into a fresh opencode session:
172
182
  ```
173
183
  Install and configure by following the instructions here https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/refs/heads/master/README.md
174
184
  ```
@@ -182,80 +192,25 @@ If you're an LLM Agent helping set up oh-my-opencode, Welcome! You'll now help y
182
192
 
183
193
  follow these steps:
184
194
 
185
- ### Step 0: Ask user about the setup.
186
-
187
- Since OpenCode supports various models, and our plugin suggests various frontier LLMs, you must ask user the following questions.
188
-
189
- **IMPORTANT**: Track which providers the user has. Only use `anthropic/claude-opus-4-5` as fallback when the user confirmed they have Claude. If they don't have Claude, use `opencode/big-pickle` as fallback instead.
190
-
191
- 1. **Do you have a Claude Pro/Max Subscription?** Otherwise, we'll use 'opencode/big-pickle' (known for GLM 4.6) as a main orchestrator model (not recommended)
192
- - If user said **yes**, ask follow-up: **Are you on max20 (20x mode)?**
193
- - If **yes (max20)**: Add ToDo: "Setup user Claude Pro/Max Auth" — full Claude Sonnet 4.5 for librarian. **Remember: Claude is available for fallbacks.**
194
- - If **no (not max20)**: Add ToDo: "Setup user Claude Pro/Max Auth", then merge the following to `~/.config/opencode/oh-my-opencode.json`. **Remember: Claude is available for fallbacks.**
195
- ```json
196
- {
197
- "agents": {
198
- "librarian": { "model": "opencode/big-pickle" }
199
- }
200
- }
201
- ```
202
- - If user said **no** (no Claude subscription), merge the following to `~/.config/opencode/oh-my-opencode.json`. **Remember: Claude is NOT available — all fallbacks must use `opencode/big-pickle`.**
203
- ```json
204
- {
205
- "agents": {
206
- "Sisyphus": { "model": "opencode/big-pickle" },
207
- "librarian": { "model": "opencode/big-pickle" }
208
- }
209
- }
210
- ```
211
-
212
- 2. **Do you have a ChatGPT Subscription?** Otherwise, we'll use a fallback model for oracle agent.
213
- - If user said **yes**, add ToDo: "Setup user ChatGPT Auth"
214
- - If user said **no**:
215
- - **If Claude is available**: merge the following to `oh-my-opencode.json`:
216
- ```json
217
- {
218
- "agents": {
219
- "oracle": { "model": "anthropic/claude-opus-4-5" }
220
- }
221
- }
222
- ```
223
- - **If Claude is NOT available**: merge the following to `oh-my-opencode.json`:
224
- ```json
225
- {
226
- "agents": {
227
- "oracle": { "model": "opencode/big-pickle" }
228
- }
229
- }
230
- ```
231
-
232
- 3. **Will you integrate Gemini models?** Otherwise, you cannot enjoy the beautiful design.
233
- - If user said **yes**, add ToDo: "Setup Google OAuth"
234
- - If user said **no**:
235
- - **If Claude is available**: merge the following to `oh-my-opencode.json`:
236
- ```json
237
- {
238
- "agents": {
239
- "frontend-ui-ux-engineer": { "model": "anthropic/claude-opus-4-5" },
240
- "document-writer": { "model": "anthropic/claude-opus-4-5" },
241
- "multimodal-looker": { "model": "anthropic/claude-opus-4-5" }
242
- }
243
- }
244
- ```
245
- - **If Claude is NOT available**: merge the following to `oh-my-opencode.json`:
246
- ```json
247
- {
248
- "agents": {
249
- "frontend-ui-ux-engineer": { "model": "opencode/big-pickle" },
250
- "document-writer": { "model": "opencode/big-pickle" },
251
- "multimodal-looker": { "model": "opencode/big-pickle" }
252
- }
253
- }
254
- ```
255
-
256
- ### Step 1: Install OpenCode, if not
257
-
258
- Run following command to verify OpenCode Installation:
195
+ ### Step 0: Ask user about subscriptions
196
+
197
+ Ask the user these 3 questions to determine CLI options:
198
+
199
+ 1. **Do you have a Claude Pro/Max Subscription?**
200
+ - If **yes**: **Are you on max20 (20x mode)?**
201
+ - **max20** `--claude=max20`
202
+ - **not max20** `--claude=yes`
203
+ - If **no** `--claude=no`
204
+
205
+ 2. **Do you have a ChatGPT Subscription?**
206
+ - If **yes** → `--chatgpt=yes`
207
+ - If **no** → `--chatgpt=no`
208
+
209
+ 3. **Will you integrate Gemini models?**
210
+ - If **yes** → `--gemini=yes`
211
+ - If **no** → `--gemini=no`
212
+
213
+ ### Step 1: Install OpenCode (if not installed)
259
214
 
260
215
  ```bash
261
216
  if command -v opencode &> /dev/null; then
@@ -269,37 +224,29 @@ fi
269
224
  If OpenCode isn't installed, check the [OpenCode Installation Guide](https://opencode.ai/docs).
270
225
  Spawn a subagent to handle installation and report back - to save context.
271
226
 
272
- ### Step 2: Configure oh-my-opencode Plugin
273
-
274
- #### JSONC
275
- - If `~/.config/opencode/opencode.jsonc` exists, work in there to add `oh-my-opencode` plugin
227
+ ### Step 2: Run the installer
276
228
 
277
- #### JSON
278
- - If no opencode.jsonc exists, run following command to create and register it.
229
+ Based on user's answers, run the CLI installer with appropriate flags:
279
230
 
280
231
  ```bash
281
- mkdir -p ~/.config/opencode
282
-
283
- if [ -f ~/.config/opencode/opencode.json ]; then
284
- # Existing config: add plugin using jq or python
285
- if command -v jq &> /dev/null; then
286
- jq '.plugin = ((.plugin // []) + ["oh-my-opencode"] | unique)' \
287
- ~/.config/opencode/opencode.json > /tmp/oc.json && \
288
- mv /tmp/oc.json ~/.config/opencode/opencode.json
289
- else
290
- echo "Please add \"oh-my-opencode\" to the plugin array in ~/.config/opencode/opencode.json"
291
- fi
292
- else
293
- # Create new config
294
- echo '{"plugin":["oh-my-opencode"]}' > ~/.config/opencode/opencode.json
295
- fi
232
+ bunx oh-my-opencode install --no-tui --claude=<yes|no|max20> --chatgpt=<yes|no> --gemini=<yes|no>
296
233
  ```
297
234
 
235
+ **Examples:**
236
+ - User has all subscriptions with max20: `bunx oh-my-opencode install --no-tui --claude=max20 --chatgpt=yes --gemini=yes`
237
+ - User has only Claude (no max20): `bunx oh-my-opencode install --no-tui --claude=yes --chatgpt=no --gemini=no`
238
+ - User has no subscriptions: `bunx oh-my-opencode install --no-tui --claude=no --chatgpt=no --gemini=no`
239
+
240
+ The CLI will:
241
+ - Register the plugin in `opencode.json`
242
+ - Configure agent models based on subscription flags
243
+ - Show which auth steps are needed
244
+
298
245
  ### Step 3: Verify Setup
299
246
 
300
247
  ```bash
301
- opencode --version # Should be 1.0.132 or higher
302
- cat ~/.config/opencode/opencode.json # Should contain "oh-my-opencode" in plugin array, or maybe check jsonc
248
+ opencode --version # Should be 1.0.150 or higher
249
+ cat ~/.config/opencode/opencode.json # Should contain "oh-my-opencode" in plugin array
303
250
  ```
304
251
 
305
252
  ### Step 4: Configure Authentication
package/README.zh-cn.md CHANGED
@@ -163,76 +163,23 @@ Install and configure by following the instructions here https://raw.githubuserc
163
163
 
164
164
  按步骤来:
165
165
 
166
- ### 步骤 0:摸清用户底细
167
-
168
- OpenCode 支持各种模型,我们这个插件也建议用各种前沿 LLM。所以先问清楚。
169
-
170
- **重要**:追踪用户有哪些 provider。只有用户确认有 Claude 的情况下,才能用 `anthropic/claude-opus-4-5` 做 fallback。没有 Claude 就用 `opencode/big-pickle` 做 fallback。
171
-
172
- 1. **有 Claude Pro/Max 订阅吗?** 没有的话,主编排模型只能用 'opencode/big-pickle'(也就是 GLM 4.6),这体验可不太好(不推荐)。
173
- - 用户说**有**,继续问:**你用的是 max20 (20x 模式) 吗?**
174
- - **是 (max20)**:加个待办:"配置用户 Claude Pro/Max 认证" — librarian 用完整的 Claude Sonnet 4.5。**记住:Claude 可以做 fallback。**
175
- - **不是 (没有 max20)**:加个待办:"配置用户 Claude Pro/Max 认证",然后把这个合并到 `~/.config/opencode/oh-my-opencode.json`。**记住:Claude 可以做 fallback。**
176
- ```json
177
- {
178
- "agents": {
179
- "librarian": { "model": "opencode/big-pickle" }
180
- }
181
- }
182
- ```
183
- - 用户说**没有** (没有 Claude 订阅),把这坨配置写到 `~/.config/opencode/oh-my-opencode.json`。**记住:没有 Claude — 所有 fallback 都得用 `opencode/big-pickle`。**
184
- ```json
185
- {
186
- "agents": {
187
- "Sisyphus": { "model": "opencode/big-pickle" },
188
- "librarian": { "model": "opencode/big-pickle" }
189
- }
190
- }
191
- ```
192
-
193
- 2. **有 ChatGPT 订阅吗?** 没有的话,oracle Agent 就用 fallback 模型了。
194
- - 用户说**有**,加个待办:"配置用户 ChatGPT 认证"
195
- - 用户说**没有**:
196
- - **有 Claude 的情况下**:把这个合并到 `oh-my-opencode.json`:
197
- ```json
198
- {
199
- "agents": {
200
- "oracle": { "model": "anthropic/claude-opus-4-5" }
201
- }
202
- }
203
- ```
204
- - **没有 Claude 的情况下**:把这个合并到 `oh-my-opencode.json`:
205
- ```json
206
- {
207
- "agents": {
208
- "oracle": { "model": "opencode/big-pickle" }
209
- }
210
- }
211
- ```
212
-
213
- 3. **要接 Gemini 模型吗?** 不接的话,那么漂亮的 UI 设计你就无福消受了。
214
- - 用户说**要**,加个待办:"配置 Google OAuth"
215
- - 用户说**不要**:
216
- - **有 Claude 的情况下**:把这个合并到 `oh-my-opencode.json`:
217
- ```json
218
- {
219
- "agents": {
220
- "frontend-ui-ux-engineer": { "model": "anthropic/claude-opus-4-5" },
221
- "document-writer": { "model": "anthropic/claude-opus-4-5" },
222
- "multimodal-looker": { "model": "anthropic/claude-opus-4-5" }
223
- }
224
- }
225
- ```
226
- - **没有 Claude 的情况下**:把这个合并到 `oh-my-opencode.json`:
227
- ```json
228
- {
229
- "agents": {
230
- "frontend-ui-ux-engineer": { "model": "opencode/big-pickle" },
231
- "document-writer": { "model": "opencode/big-pickle" },
232
- "multimodal-looker": { "model": "opencode/big-pickle" }
233
- }
234
- }
235
- ```
166
+ ### 步骤 0:确认订阅情况
167
+
168
+ 问用户这 3 个问题来确定 CLI 参数:
169
+
170
+ 1. **有 Claude Pro/Max 订阅吗?**
171
+ - **有**:**用的是 max20 (20x 模式) 吗?**
172
+ - **max20** `--claude=max20`
173
+ - **不是 max20** `--claude=yes`
174
+ - **没有** `--claude=no`
175
+
176
+ 2. **有 ChatGPT 订阅吗?**
177
+ - **有** → `--chatgpt=yes`
178
+ - **没有** → `--chatgpt=no`
179
+
180
+ 3. **要用 Gemini 模型吗?**
181
+ - **要** → `--gemini=yes`
182
+ - **不要** → `--gemini=no`
236
183
 
237
184
  ### 步骤 1:确认 OpenCode 装没装
238
185
 
@@ -249,36 +196,28 @@ fi
249
196
 
250
197
  如果没装,看 [OpenCode 安装指南](https://opencode.ai/docs)。可以生成个子 Agent 去搞定安装,完事汇报——省点上下文。
251
198
 
252
- ### 步骤 2:配置 oh-my-opencode 插件
253
-
254
- #### JSONC
255
- - 如果 `~/.config/opencode/opencode.jsonc` 存在,就在里面加 `oh-my-opencode` 插件。
199
+ ### 步骤 2:跑安装程序
256
200
 
257
- #### JSON
258
- - 如果没 opencode.jsonc,跑这个命令创建并注册:
201
+ 根据用户的回答,用对应的参数运行 CLI 安装程序:
259
202
 
260
203
  ```bash
261
- mkdir -p ~/.config/opencode
262
-
263
- if [ -f ~/.config/opencode/opencode.json ]; then
264
- # 已有配置:用 jq 或 python 加插件
265
- if command -v jq &> /dev/null; then
266
- jq '.plugin = ((.plugin // []) + ["oh-my-opencode"] | unique)' \
267
- ~/.config/opencode/opencode.json > /tmp/oc.json && \
268
- mv /tmp/oc.json ~/.config/opencode/opencode.json
269
- else
270
- echo "请手动在 ~/.config/opencode/opencode.json 的 plugin 数组里加上 \"oh-my-opencode\""
271
- fi
272
- else
273
- # 新建配置
274
- echo '{"plugin":["oh-my-opencode"]}' > ~/.config/opencode/opencode.json
275
- fi
204
+ bunx oh-my-opencode install --no-tui --claude=<yes|no|max20> --chatgpt=<yes|no> --gemini=<yes|no>
276
205
  ```
277
206
 
207
+ **例子:**
208
+ - 全套订阅 + max20:`bunx oh-my-opencode install --no-tui --claude=max20 --chatgpt=yes --gemini=yes`
209
+ - 只有 Claude(没 max20):`bunx oh-my-opencode install --no-tui --claude=yes --chatgpt=no --gemini=no`
210
+ - 啥订阅都没有:`bunx oh-my-opencode install --no-tui --claude=no --chatgpt=no --gemini=no`
211
+
212
+ CLI 会干这些事:
213
+ - 在 `opencode.json` 注册插件
214
+ - 根据订阅参数配置 Agent 模型
215
+ - 告诉你接下来要做哪些认证
216
+
278
217
  ### 步骤 3:验货
279
218
 
280
219
  ```bash
281
- opencode --version # 得是 1.0.132 以上
220
+ opencode --version # 得是 1.0.150 以上
282
221
  cat ~/.config/opencode/opencode.json # plugin 数组里得有 "oh-my-opencode"
283
222
  ```
284
223
 
@@ -0,0 +1,18 @@
1
+ import type { ConfigMergeResult, InstallConfig, DetectedConfig } from "./types";
2
+ export declare function fetchLatestVersion(packageName: string): Promise<string | null>;
3
+ type ConfigFormat = "json" | "jsonc" | "none";
4
+ export declare function detectConfigFormat(): {
5
+ format: ConfigFormat;
6
+ path: string;
7
+ };
8
+ export declare function addPluginToOpenCodeConfig(): ConfigMergeResult;
9
+ export declare function generateOmoConfig(installConfig: InstallConfig): Record<string, unknown>;
10
+ export declare function writeOmoConfig(installConfig: InstallConfig): ConfigMergeResult;
11
+ export declare function isOpenCodeInstalled(): Promise<boolean>;
12
+ export declare function getOpenCodeVersion(): Promise<string | null>;
13
+ export declare function addAuthPlugins(config: InstallConfig): Promise<ConfigMergeResult>;
14
+ export declare function setupChatGPTHotfix(): ConfigMergeResult;
15
+ export declare function runBunInstall(): Promise<boolean>;
16
+ export declare function addProviderConfig(config: InstallConfig): ConfigMergeResult;
17
+ export declare function detectCurrentConfig(): DetectedConfig;
18
+ export {};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ export {};
@@ -0,0 +1,2 @@
1
+ import type { InstallArgs } from "./types";
2
+ export declare function install(args: InstallArgs): Promise<number>;
@@ -0,0 +1,27 @@
1
+ export type ClaudeSubscription = "no" | "yes" | "max20";
2
+ export type BooleanArg = "no" | "yes";
3
+ export interface InstallArgs {
4
+ tui: boolean;
5
+ claude?: ClaudeSubscription;
6
+ chatgpt?: BooleanArg;
7
+ gemini?: BooleanArg;
8
+ skipAuth?: boolean;
9
+ }
10
+ export interface InstallConfig {
11
+ hasClaude: boolean;
12
+ isMax20: boolean;
13
+ hasChatGPT: boolean;
14
+ hasGemini: boolean;
15
+ }
16
+ export interface ConfigMergeResult {
17
+ success: boolean;
18
+ configPath: string;
19
+ error?: string;
20
+ }
21
+ export interface DetectedConfig {
22
+ isInstalled: boolean;
23
+ hasClaude: boolean;
24
+ isMax20: boolean;
25
+ hasChatGPT: boolean;
26
+ hasGemini: boolean;
27
+ }
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "oh-my-opencode",
3
- "version": "2.4.7",
3
+ "version": "2.5.0",
4
4
  "description": "OpenCode plugin - custom agents (oracle, librarian) and enhanced features",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "module",
8
+ "bin": {
9
+ "oh-my-opencode": "./dist/cli/index.js"
10
+ },
8
11
  "files": [
9
12
  "dist"
10
13
  ],
@@ -20,7 +23,7 @@
20
23
  "./schema.json": "./dist/oh-my-opencode.schema.json"
21
24
  },
22
25
  "scripts": {
23
- "build": "bun build src/index.ts src/google-auth.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun run build:schema",
26
+ "build": "bun build src/index.ts src/google-auth.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm && bun run build:schema",
24
27
  "build:schema": "bun run script/build-schema.ts",
25
28
  "clean": "rm -rf dist",
26
29
  "prepublishOnly": "bun run clean && bun run build",
@@ -49,10 +52,13 @@
49
52
  "dependencies": {
50
53
  "@ast-grep/cli": "^0.40.0",
51
54
  "@ast-grep/napi": "^0.40.0",
55
+ "@clack/prompts": "^0.11.0",
52
56
  "@code-yeongyu/comment-checker": "^0.6.0",
53
57
  "@openauthjs/openauth": "^0.4.3",
54
58
  "@opencode-ai/plugin": "^1.0.162",
59
+ "commander": "^14.0.2",
55
60
  "hono": "^4.10.4",
61
+ "picocolors": "^1.1.1",
56
62
  "picomatch": "^4.0.2",
57
63
  "xdg-basedir": "^5.1.0",
58
64
  "zod": "^4.1.8"