oh-my-opencode 0.3.0 → 0.3.2
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.ko.md +22 -7
- package/README.md +30 -14
- package/dist/hooks/directory-readme-injector/constants.d.ts +3 -0
- package/dist/hooks/directory-readme-injector/index.d.ts +22 -0
- package/dist/hooks/directory-readme-injector/storage.d.ts +3 -0
- package/dist/hooks/directory-readme-injector/types.d.ts +5 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/session-recovery/storage.d.ts +1 -0
- package/dist/index.js +824 -333
- package/dist/tools/skill/tools.d.ts +2 -1
- package/dist/tools/skill/types.d.ts +17 -0
- package/package.json +1 -1
package/README.ko.md
CHANGED
|
@@ -106,7 +106,19 @@ opencode --version # 1.0.132 이상이어야 함
|
|
|
106
106
|
cat ~/.config/opencode/opencode.json # plugin 배열에 "oh-my-opencode"가 있어야 함
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
-
|
|
109
|
+
### 4단계: 인증정보 설정
|
|
110
|
+
|
|
111
|
+
plugin 에 oh my opencode 를 추가했다면, tmux 를 사용하여 다음의 내용을 진행주세요.
|
|
112
|
+
|
|
113
|
+
1. tmux 를 사용하여 셸 열기
|
|
114
|
+
2. opencode auth login > Provider Anthropic > Login method Claude Pro/Max > 사용자에게 oauth 화면에서 인증하라고 안내
|
|
115
|
+
3. 사용자에게 macOS 일 경우 VibeProxy, 아닐 경우 CLIProxyAPI 를 사용하여 OpenAI / Google 인증을 완료하라고 안내
|
|
116
|
+
|
|
117
|
+
### ⚠️ 주의
|
|
118
|
+
|
|
119
|
+
**사용자가 명시적으로 요청하지 않는 한, `oh-my-opencode.json` 설정 파일을 생성하거나 수정하지 마세요.**
|
|
120
|
+
|
|
121
|
+
플러그인은 설정 파일 없이도 기본값으로 완벽하게 동작합니다. 설정 파일은 사용자가 커스터마이징을 원할 때만 필요합니다.
|
|
110
122
|
|
|
111
123
|
</details>
|
|
112
124
|
|
|
@@ -154,6 +166,7 @@ OpenCode 는 아주 확장가능하고 아주 커스터마이저블합니다.
|
|
|
154
166
|
│ └── Button.tsx # 이 파일을 읽으면 위 3개 AGENTS.md 모두 주입
|
|
155
167
|
```
|
|
156
168
|
`Button.tsx`를 읽으면 순서대로 주입됩니다: `project/AGENTS.md` → `src/AGENTS.md` → `components/AGENTS.md`. 각 디렉토리의 컨텍스트는 세션당 한 번만 주입됩니다. Claude Code의 CLAUDE.md 기능에서 영감을 받았습니다.
|
|
169
|
+
- **Directory README.md Injector**: 파일을 읽을 때 `README.md` 내용을 자동으로 주입합니다. AGENTS.md Injector와 동일하게 동작하며, 파일 디렉토리부터 프로젝트 루트까지 탐색합니다. LLM 에이전트에게 프로젝트 문서 컨텍스트를 제공합니다. 각 디렉토리의 README는 세션당 한 번만 주입됩니다.
|
|
157
170
|
- **Think Mode**: 확장된 사고(Extended Thinking)가 필요한 상황을 자동으로 감지하고 모드를 전환합니다. 사용자가 깊은 사고를 요청하는 표현(예: "think deeply", "ultrathink")을 감지하면, 추론 능력을 극대화하도록 모델 설정을 동적으로 조정합니다.
|
|
158
171
|
- **Anthropic Auto Compact**: Anthropic 모델 사용 시 컨텍스트 한계에 도달하면 대화 기록을 자동으로 압축하여 효율적으로 관리합니다.
|
|
159
172
|
- **Empty Task Response Detector**: 서브 에이전트가 수행한 작업이 비어있거나 무의미한 응답을 반환하는 경우를 감지하여, 오류 없이 우아하게 처리합니다.
|
|
@@ -326,7 +339,7 @@ Schema 자동 완성이 지원됩니다:
|
|
|
326
339
|
|
|
327
340
|
각 에이전트에서 지원하는 옵션: `model`, `temperature`, `top_p`, `prompt`, `tools`, `disable`, `description`, `mode`, `color`, `permission`.
|
|
328
341
|
|
|
329
|
-
또는 `disabled_agents
|
|
342
|
+
또는 ~/.config/opencode/oh-my-opencode.json 혹은 .opencode/oh-my-opencode.json 의 `disabled_agents` 를 사용하여 비활성화할 수 있습니다:
|
|
330
343
|
|
|
331
344
|
```json
|
|
332
345
|
{
|
|
@@ -338,7 +351,9 @@ Schema 자동 완성이 지원됩니다:
|
|
|
338
351
|
|
|
339
352
|
### MCPs
|
|
340
353
|
|
|
341
|
-
|
|
354
|
+
기본적으로 Context7, Exa MCP 를 지원합니다.
|
|
355
|
+
|
|
356
|
+
이것이 마음에 들지 않는다면, ~/.config/opencode/oh-my-opencode.json 혹은 .opencode/oh-my-opencode.json 의 `disabled_mcps` 를 사용하여 비활성화할 수 있습니다:
|
|
342
357
|
|
|
343
358
|
```json
|
|
344
359
|
{
|
|
@@ -346,13 +361,13 @@ Schema 자동 완성이 지원됩니다:
|
|
|
346
361
|
}
|
|
347
362
|
```
|
|
348
363
|
|
|
349
|
-
더 자세한 내용은 [OpenCode MCP Servers](https://opencode.ai/docs/mcp-servers)를 참조하세요.
|
|
350
|
-
|
|
351
364
|
### LSP
|
|
352
365
|
|
|
353
|
-
|
|
366
|
+
OpenCode 는 분석을 위해 LSP 도구를 제공합니다.
|
|
367
|
+
Oh My OpenCode 에서는 LSP 의 리팩토링(이름 변경, 코드 액션) 도구를 제공합니다.
|
|
368
|
+
OpenCode 에서 지원하는 모든 LSP 구성 및 커스텀 설정 (opencode.json 에 설정 된 것) 을 그대로 지원하고, Oh My OpenCode 만을 위한 추가적인 설정도 아래와 같이 설정 할 수 있습니다.
|
|
354
369
|
|
|
355
|
-
`lsp` 옵션을 통해 LSP 서버를
|
|
370
|
+
~/.config/opencode/oh-my-opencode.json 혹은 .opencode/oh-my-opencode.json 의 `lsp` 옵션을 통해 LSP 서버를 추가로 설정 할 수 있습니다:
|
|
356
371
|
|
|
357
372
|
```json
|
|
358
373
|
{
|
package/README.md
CHANGED
|
@@ -28,11 +28,12 @@ Oh My OpenCode
|
|
|
28
28
|
oMoMoMoMoMo···
|
|
29
29
|
|
|
30
30
|
If you work in tech, you likely appreciated [Claude Code](https://www.claude.com/product/claude-code).
|
|
31
|
-
If you are a hacker, you will fucking
|
|
31
|
+
If you are a hacker, you will fucking fall in love with [OpenCode](https://github.com/sst/opencode).
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
Do you remember the first time you switched from Windows to Linux? The excitement of configuring everything just the way you wanted?
|
|
34
|
+
In an era where that romance feels lost, OpenCode will be that project for you.
|
|
35
|
+
If you love coding and computers, OpenCode will feel exactly like that moment you first touched Linux after years of Windows.
|
|
36
|
+
Even if you don't, invest a little time. Boost your skills and productivity by multipliers.
|
|
36
37
|
|
|
37
38
|
## TL;DR
|
|
38
39
|
|
|
@@ -42,7 +43,7 @@ To you, OpenCode will feel like the paradigm shift from Windows to Linux. Not yo
|
|
|
42
43
|
- For OpenAI models, I recommend the [OpenCode-OpenAI-Codex-Auth plugin](https://github.com/numman-ali/opencode-openai-codex-auth).
|
|
43
44
|
- For Gemini and GPT, use [VibeProxy (macOS Only)](https://github.com/automazeio/vibeproxy) or [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI).
|
|
44
45
|
- **Truth be told, the rest is optional. Just install it. Once set up, no further learning is required. It simply evolves.**
|
|
45
|
-
- **Paste this document into Claude Code, OpenCode, or Cursor, instruct it to install, and ask for assistance if needed. It
|
|
46
|
+
- **Paste this document into Claude Code, OpenCode, or Cursor, instruct it to install, and ask for assistance if needed. It just installs.**
|
|
46
47
|
- If you are an LLM Agent, install the required plugins and dependencies, then run `opencode auth login` via tmux to assist the user with configuration.
|
|
47
48
|
|
|
48
49
|
## Installation
|
|
@@ -104,7 +105,19 @@ opencode --version # Should be >= 1.0.132
|
|
|
104
105
|
cat ~/.config/opencode/opencode.json # Should contain "oh-my-opencode" in plugin array
|
|
105
106
|
```
|
|
106
107
|
|
|
107
|
-
|
|
108
|
+
### Step 4: Configure Authentication
|
|
109
|
+
|
|
110
|
+
Once `oh-my-opencode` is added to the plugin list, use `tmux` to proceed with the following:
|
|
111
|
+
|
|
112
|
+
1. Open a shell using `tmux`.
|
|
113
|
+
2. Run `opencode auth login` > Select Provider `Anthropic` > Select Login method `Claude Pro/Max` > Instruct the user to authenticate via the OAuth screen.
|
|
114
|
+
3. Recommend the setup: [VibeProxy](https://github.com/automazeio/vibeproxy) for macOS users, or [CLIProxyAPI](https://github.com/router-for-me/CLIProxyAPI) for others.
|
|
115
|
+
|
|
116
|
+
### ⚠️ Warning
|
|
117
|
+
|
|
118
|
+
**Do NOT create or modify the `oh-my-opencode.json` configuration file unless the user explicitly requests it.**
|
|
119
|
+
|
|
120
|
+
The plugin works perfectly with default settings without any configuration file. The configuration file is only needed when the user wants customization.
|
|
108
121
|
|
|
109
122
|
</details>
|
|
110
123
|
|
|
@@ -115,7 +128,7 @@ OpenCode is limitlessly extensible and customizable. Zero screen flicker.
|
|
|
115
128
|
You can mix and orchestrate models to your exact specifications.
|
|
116
129
|
It is feature-rich. It is elegant. It handles the terminal without hesitation. It is high-performance.
|
|
117
130
|
|
|
118
|
-
But here is the catch: the learning curve is steep. There is a lot to master.
|
|
131
|
+
But here is the catch: the learning curve is steep. There is a lot to master. And your time is expensive.
|
|
119
132
|
|
|
120
133
|
Inspired by [AmpCode](https://ampcode.com) and [Claude Code](https://code.claude.com/docs/en/overview), I have implemented their features here—often with superior execution.
|
|
121
134
|
Because this is OpenCode.
|
|
@@ -150,6 +163,7 @@ I believe in the right tool for the job. For your wallet's sake, use CLIProxyAPI
|
|
|
150
163
|
│ └── Button.tsx # Reading this injects ALL 3 AGENTS.md files
|
|
151
164
|
```
|
|
152
165
|
When reading `Button.tsx`, the hook injects contexts in order: `project/AGENTS.md` → `src/AGENTS.md` → `components/AGENTS.md`. Each directory's context is injected only once per session. Inspired by Claude Code's CLAUDE.md feature.
|
|
166
|
+
- **Directory README.md Injector**: Automatically injects `README.md` contents when reading files. Works identically to the AGENTS.md Injector, searching upward from the file's directory to project root. Provides project documentation context to the LLM agent. Each directory's README is injected only once per session.
|
|
153
167
|
- **Think Mode**: Automatic extended thinking detection and mode switching. Detects when user requests deep thinking (e.g., "think deeply", "ultrathink") and dynamically adjusts model settings for enhanced reasoning.
|
|
154
168
|
- **Anthropic Auto Compact**: Automatically compacts conversation history when approaching context limits for Anthropic models.
|
|
155
169
|
- **Empty Task Response Detector**: Detects when subagent tasks return empty or meaningless responses and handles gracefully.
|
|
@@ -323,7 +337,7 @@ Override built-in agent settings:
|
|
|
323
337
|
|
|
324
338
|
Each agent supports: `model`, `temperature`, `top_p`, `prompt`, `tools`, `disable`, `description`, `mode`, `color`, `permission`.
|
|
325
339
|
|
|
326
|
-
Or disable
|
|
340
|
+
Or you can disable them using `disabled_agents` in `~/.config/opencode/oh-my-opencode.json` or `.opencode/oh-my-opencode.json`:
|
|
327
341
|
|
|
328
342
|
```json
|
|
329
343
|
{
|
|
@@ -335,7 +349,9 @@ Available agents: `oracle`, `librarian`, `explore`, `frontend-ui-ux-engineer`, `
|
|
|
335
349
|
|
|
336
350
|
### MCPs
|
|
337
351
|
|
|
338
|
-
|
|
352
|
+
By default, Context7 and Exa MCP are supported.
|
|
353
|
+
|
|
354
|
+
If you don't want these, you can disable them using `disabled_mcps` in `~/.config/opencode/oh-my-opencode.json` or `.opencode/oh-my-opencode.json`:
|
|
339
355
|
|
|
340
356
|
```json
|
|
341
357
|
{
|
|
@@ -343,13 +359,13 @@ Disable built-in MCPs:
|
|
|
343
359
|
}
|
|
344
360
|
```
|
|
345
361
|
|
|
346
|
-
See [OpenCode MCP Servers](https://opencode.ai/docs/mcp-servers) for more.
|
|
347
|
-
|
|
348
362
|
### LSP
|
|
349
363
|
|
|
350
|
-
|
|
364
|
+
OpenCode provides LSP tools for analysis.
|
|
365
|
+
Oh My OpenCode provides LSP tools for refactoring (rename, code actions).
|
|
366
|
+
It supports all LSP configurations and custom settings supported by OpenCode (those configured in opencode.json), and you can also configure additional settings specifically for Oh My OpenCode as shown below.
|
|
351
367
|
|
|
352
|
-
|
|
368
|
+
You can configure additional LSP servers via the `lsp` option in `~/.config/opencode/oh-my-opencode.json` or `.opencode/oh-my-opencode.json`:
|
|
353
369
|
|
|
354
370
|
```json
|
|
355
371
|
{
|
|
@@ -389,7 +405,7 @@ If this sounds arrogant and you have a superior solution, send a PR. You are wel
|
|
|
389
405
|
|
|
390
406
|
As of now, I have no affiliation with any of the projects or models mentioned here. This plugin is purely based on personal experimentation and preference.
|
|
391
407
|
|
|
392
|
-
I constructed 99% of this project using OpenCode. I focused on functional verification
|
|
408
|
+
I constructed 99% of this project using OpenCode. I focused on functional verification, and honestly, I don't know how to write proper TypeScript. **But I personally reviewed and comprehensively rewritten this documentation, so you can rely on it with confidence.**
|
|
393
409
|
## Warnings
|
|
394
410
|
|
|
395
411
|
- If you are on [1.0.132](https://github.com/sst/opencode/releases/tag/v1.0.132) or lower, OpenCode has a bug that might break config.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
interface ToolExecuteInput {
|
|
3
|
+
tool: string;
|
|
4
|
+
sessionID: string;
|
|
5
|
+
callID: string;
|
|
6
|
+
}
|
|
7
|
+
interface ToolExecuteOutput {
|
|
8
|
+
title: string;
|
|
9
|
+
output: string;
|
|
10
|
+
metadata: unknown;
|
|
11
|
+
}
|
|
12
|
+
interface EventInput {
|
|
13
|
+
event: {
|
|
14
|
+
type: string;
|
|
15
|
+
properties?: unknown;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare function createDirectoryReadmeInjectorHook(ctx: PluginInput): {
|
|
19
|
+
"tool.execute.after": (input: ToolExecuteInput, output: ToolExecuteOutput) => Promise<void>;
|
|
20
|
+
event: ({ event }: EventInput) => Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { createSessionRecoveryHook } from "./session-recovery";
|
|
|
5
5
|
export { createCommentCheckerHooks } from "./comment-checker";
|
|
6
6
|
export { createGrepOutputTruncatorHook } from "./grep-output-truncator";
|
|
7
7
|
export { createDirectoryAgentsInjectorHook } from "./directory-agents-injector";
|
|
8
|
+
export { createDirectoryReadmeInjectorHook } from "./directory-readme-injector";
|
|
8
9
|
export { createEmptyTaskResponseDetectorHook } from "./empty-task-response-detector";
|
|
9
10
|
export { createAnthropicAutoCompactHook } from "./anthropic-auto-compact";
|
|
10
11
|
export { createThinkModeHook } from "./think-mode";
|
|
@@ -7,6 +7,7 @@ export declare function hasContent(part: StoredPart): boolean;
|
|
|
7
7
|
export declare function messageHasContent(messageID: string): boolean;
|
|
8
8
|
export declare function injectTextPart(sessionID: string, messageID: string, text: string): boolean;
|
|
9
9
|
export declare function findEmptyMessages(sessionID: string): string[];
|
|
10
|
+
export declare function findEmptyMessageByIndex(sessionID: string, targetIndex: number): string | null;
|
|
10
11
|
export declare function findFirstEmptyMessage(sessionID: string): string | null;
|
|
11
12
|
export declare function findMessagesWithThinkingBlocks(sessionID: string): string[];
|
|
12
13
|
export declare function findMessagesWithOrphanThinking(sessionID: string): string[];
|