oh-my-opencode 2.4.7 → 2.5.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.ja.md +54 -92
- package/README.ko.md +54 -92
- package/README.md +70 -100
- package/README.zh-cn.md +54 -93
- package/dist/cli/config-manager.d.ts +89 -0
- package/dist/cli/config-manager.test.d.ts +1 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +3745 -0
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/types.d.ts +27 -0
- package/dist/google-auth.js +1735 -0
- package/dist/index.js +1 -1
- package/package.json +8 -2
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
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
|
253
|
-
|
|
254
|
-
#### JSONC
|
|
255
|
-
- 如果 `~/.config/opencode/opencode.jsonc` 存在,就在里面加 `oh-my-opencode` 插件。
|
|
199
|
+
### 步骤 2:跑安装程序
|
|
256
200
|
|
|
257
|
-
|
|
258
|
-
- 如果没 opencode.jsonc,跑这个命令创建并注册:
|
|
201
|
+
根据用户的回答,用对应的参数运行 CLI 安装程序:
|
|
259
202
|
|
|
260
203
|
```bash
|
|
261
|
-
|
|
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.
|
|
220
|
+
opencode --version # 得是 1.0.150 以上
|
|
282
221
|
cat ~/.config/opencode/opencode.json # plugin 数组里得有 "oh-my-opencode"
|
|
283
222
|
```
|
|
284
223
|
|
|
@@ -858,7 +797,6 @@ Oh My OpenCode 送你重构工具(重命名、代码操作)。
|
|
|
858
797
|
|
|
859
798
|
**警告**:这些功能是实验性的,可能会导致意外行为。只有在理解其影响的情况下才启用。
|
|
860
799
|
|
|
861
|
-
|
|
862
800
|
## 作者的话
|
|
863
801
|
|
|
864
802
|
装个 Oh My OpenCode 试试。
|
|
@@ -904,6 +842,29 @@ Oh My OpenCode 送你重构工具(重命名、代码操作)。
|
|
|
904
842
|
|
|
905
843
|
*感谢 [@junhoyeo](https://github.com/junhoyeo) 制作了这张超帅的 hero 图。*
|
|
906
844
|
|
|
845
|
+
## 用户评价
|
|
846
|
+
|
|
847
|
+
> "如果 Claude Code 能在 7 天内完成人类 3 个月的工作,那么 Sisyphus 只需要 1 小时"
|
|
848
|
+
> -- B, Quant Researcher
|
|
849
|
+
|
|
850
|
+
> "只用了一天,就用 Oh My Opencode 干掉了 8000 个 eslint 警告"
|
|
851
|
+
> -- Jacob Ferrari, from [X](https://x.com/jacobferrari_/status/2003258761952289061)
|
|
852
|
+
|
|
853
|
+
> "如果你能说服 @yeon_gyu_kim,就雇佣他吧,这家伙彻底彻底改变了 opencode"
|
|
854
|
+
> -- [回复 Sam Altman 的帖子](https://x.com/mysticaltech/status/2001858758608376079)
|
|
855
|
+
|
|
856
|
+
> "你们应该把它合并到核心代码里并聘用他。认真的。这真的、真的、真的很好"
|
|
857
|
+
> -- Henning Kilset, from X
|
|
858
|
+
|
|
859
|
+
> "哇靠 @androolloyd 这玩意儿是真的,oh my opencode 太强了"
|
|
860
|
+
> -- z80.eth, from [X](https://x.com/0xz80/status/2001815226505924791)
|
|
861
|
+
|
|
862
|
+
> "用了 oh-my-opencode,你就回不去了"
|
|
863
|
+
> -- [d0t3ch](https://x.com/d0t3ch/status/2001685618200580503)
|
|
864
|
+
|
|
865
|
+
> "Oh My Opencode 独孤求败,没有对手"
|
|
866
|
+
> -- [RyanOnThePath](https://x.com/RyanOnThePath/status/2001438321252118548)
|
|
867
|
+
|
|
907
868
|
## 以下企业的专业人士都在用
|
|
908
869
|
|
|
909
870
|
- [Indent](https://indentcorp.com)
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import type { ConfigMergeResult, DetectedConfig, InstallConfig } 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 const ANTIGRAVITY_PROVIDER_CONFIG: {
|
|
17
|
+
google: {
|
|
18
|
+
name: string;
|
|
19
|
+
api: string;
|
|
20
|
+
models: {
|
|
21
|
+
"gemini-3-pro-high": {
|
|
22
|
+
name: string;
|
|
23
|
+
thinking: boolean;
|
|
24
|
+
attachment: boolean;
|
|
25
|
+
limit: {
|
|
26
|
+
context: number;
|
|
27
|
+
output: number;
|
|
28
|
+
};
|
|
29
|
+
modalities: {
|
|
30
|
+
input: string[];
|
|
31
|
+
output: string[];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
"gemini-3-pro-medium": {
|
|
35
|
+
name: string;
|
|
36
|
+
thinking: boolean;
|
|
37
|
+
attachment: boolean;
|
|
38
|
+
limit: {
|
|
39
|
+
context: number;
|
|
40
|
+
output: number;
|
|
41
|
+
};
|
|
42
|
+
modalities: {
|
|
43
|
+
input: string[];
|
|
44
|
+
output: string[];
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
"gemini-3-pro-low": {
|
|
48
|
+
name: string;
|
|
49
|
+
thinking: boolean;
|
|
50
|
+
attachment: boolean;
|
|
51
|
+
limit: {
|
|
52
|
+
context: number;
|
|
53
|
+
output: number;
|
|
54
|
+
};
|
|
55
|
+
modalities: {
|
|
56
|
+
input: string[];
|
|
57
|
+
output: string[];
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
"gemini-3-flash": {
|
|
61
|
+
name: string;
|
|
62
|
+
attachment: boolean;
|
|
63
|
+
limit: {
|
|
64
|
+
context: number;
|
|
65
|
+
output: number;
|
|
66
|
+
};
|
|
67
|
+
modalities: {
|
|
68
|
+
input: string[];
|
|
69
|
+
output: string[];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
"gemini-3-flash-lite": {
|
|
73
|
+
name: string;
|
|
74
|
+
attachment: boolean;
|
|
75
|
+
limit: {
|
|
76
|
+
context: number;
|
|
77
|
+
output: number;
|
|
78
|
+
};
|
|
79
|
+
modalities: {
|
|
80
|
+
input: string[];
|
|
81
|
+
output: string[];
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
export declare function addProviderConfig(config: InstallConfig): ConfigMergeResult;
|
|
88
|
+
export declare function detectCurrentConfig(): DetectedConfig;
|
|
89
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|