docs: add missing hooks, session tools, and sync sections across all READMEs
- Added 4 missing hooks to disabled_hooks config: preemptive-compaction, compaction-context-injector, thinking-block-validator, claude-code-hooks - Added session management tools section documenting: session_list, session_read, session_search, session_info, call_omo_agent - Added Uninstallation section to KO/JA/ZH-CN READMEs (synced with EN) - Added JSONC Support section to KO/JA/ZH-CN READMEs (synced with EN) 🤖 Generated with assistance of OhMyOpenCode (https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
80
README.ja.md
80
README.ja.md
@@ -390,6 +390,39 @@ gh repo star code-yeongyu/oh-my-opencode
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
## アンインストール
|
||||||
|
|
||||||
|
oh-my-opencode を削除するには:
|
||||||
|
|
||||||
|
1. **OpenCode 設定からプラグインを削除**
|
||||||
|
|
||||||
|
`~/.config/opencode/opencode.json` (または `opencode.jsonc`) を編集し、`plugin` 配列から `"oh-my-opencode"` を削除します:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# jq を使用する例
|
||||||
|
jq '.plugin = [.plugin[] | select(. != "oh-my-opencode")]' \
|
||||||
|
~/.config/opencode/opencode.json > /tmp/oc.json && \
|
||||||
|
mv /tmp/oc.json ~/.config/opencode/opencode.json
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **設定ファイルの削除 (オプション)**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# ユーザー設定を削除
|
||||||
|
rm -f ~/.config/opencode/oh-my-opencode.json
|
||||||
|
|
||||||
|
# プロジェクト設定を削除 (存在する場合)
|
||||||
|
rm -f .opencode/oh-my-opencode.json
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **削除の確認**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
opencode --version
|
||||||
|
# プラグインがロードされなくなっているはずです
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## 機能
|
## 機能
|
||||||
|
|
||||||
### Agents: あなたの新しいチームメイト
|
### Agents: あなたの新しいチームメイト
|
||||||
@@ -457,6 +490,19 @@ Ask @explore for the policy on this feature
|
|||||||
- **ast_grep_search**: AST 認識コードパターン検索 (25言語対応)
|
- **ast_grep_search**: AST 認識コードパターン検索 (25言語対応)
|
||||||
- **ast_grep_replace**: AST 認識コード置換
|
- **ast_grep_replace**: AST 認識コード置換
|
||||||
|
|
||||||
|
#### セッション管理
|
||||||
|
|
||||||
|
OpenCode セッション履歴をナビゲートおよび検索するためのツール:
|
||||||
|
|
||||||
|
- **session_list**: 日付およびリミットでフィルタリングしながらすべての OpenCode セッションを一覧表示
|
||||||
|
- **session_read**: 特定のセッションからメッセージと履歴を読み取る
|
||||||
|
- **session_search**: セッションメッセージ全体を全文検索
|
||||||
|
- **session_info**: セッションに関するメタデータと統計情報を取得
|
||||||
|
|
||||||
|
これらのツールにより、エージェントは以前の会話を参照し、セッション間の継続性を維持できます。
|
||||||
|
|
||||||
|
- **call_omo_agent**: 専門的な explore/librarian エージェントを起動。非同期実行のための `run_in_background` パラメータをサポート。
|
||||||
|
|
||||||
#### Context Is All You Need
|
#### Context Is All You Need
|
||||||
- **Directory AGENTS.md / README.md Injector**: ファイルを読み込む際、`AGENTS.md` と `README.md` の内容を自動的に注入します。ファイルディレクトリからプロジェクトルートまで遡り、パス上の **すべて** の `AGENTS.md` ファイルを収集します。ネストされたディレクトリごとの指示をサポートします:
|
- **Directory AGENTS.md / README.md Injector**: ファイルを読み込む際、`AGENTS.md` と `README.md` の内容を自動的に注入します。ファイルディレクトリからプロジェクトルートまで遡り、パス上の **すべて** の `AGENTS.md` ファイルを収集します。ネストされたディレクトリごとの指示をサポートします:
|
||||||
```
|
```
|
||||||
@@ -619,7 +665,7 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
|
|||||||
|
|
||||||
| プラットフォーム | ユーザー設定パス |
|
| プラットフォーム | ユーザー設定パス |
|
||||||
|------------------|------------------|
|
|------------------|------------------|
|
||||||
| **Windows** | `~/.config/opencode/oh-my-opencode.json` (優先) または `%APPDATA%\opencode\oh-my-opencode.json` (フォールバック) |
|
| **Windows** | `~/.config/opencode/oh-my-opencode.json` (推奨) または `%APPDATA%\opencode\oh-my-opencode.json` (fallback) |
|
||||||
| **macOS/Linux** | `~/.config/opencode/oh-my-opencode.json` |
|
| **macOS/Linux** | `~/.config/opencode/oh-my-opencode.json` |
|
||||||
|
|
||||||
スキーマ自動補完がサポートされています:
|
スキーマ自動補完がサポートされています:
|
||||||
@@ -630,6 +676,36 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### JSONC のサポート
|
||||||
|
|
||||||
|
`oh-my-opencode` 設定ファイルは JSONC (コメント付き JSON) をサポートしています:
|
||||||
|
- 行コメント: `// コメント`
|
||||||
|
- ブロックコメント: `/* コメント */`
|
||||||
|
- 末尾のカンマ: `{ "key": "value", }`
|
||||||
|
|
||||||
|
`oh-my-opencode.jsonc` と `oh-my-opencode.json` の両方が存在する場合、`.jsonc` が優先されます。
|
||||||
|
|
||||||
|
**コメント付きの例:**
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
"$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": {
|
||||||
|
"model": "openai/gpt-5.2" // 戦略的な推論のための GPT
|
||||||
|
},
|
||||||
|
"explore": {
|
||||||
|
"model": "opencode/grok-code" // 探索のための高速かつ無料のモデル
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Google Auth
|
### Google Auth
|
||||||
|
|
||||||
**推奨**: 外部の [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) プラグインを使用してください。マルチアカウントロードバランシング、より多くのモデル(Antigravity 経由の Claude を含む)、活発なメンテナンスを提供します。[インストール > Google Gemini](#42-google-gemini-antigravity-oauth) を参照。
|
**推奨**: 外部の [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) プラグインを使用してください。マルチアカウントロードバランシング、より多くのモデル(Antigravity 経由の Claude を含む)、活発なメンテナンスを提供します。[インストール > Google Gemini](#42-google-gemini-antigravity-oauth) を参照。
|
||||||
@@ -792,7 +868,7 @@ Oh My OpenCode は以下の場所からフックを読み込んで実行しま
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
利用可能なフック:`todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-auto-compact`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`
|
利用可能なフック:`todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-auto-compact`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`
|
||||||
|
|
||||||
**`auto-update-checker`と`startup-toast`について**: `startup-toast` フックは `auto-update-checker` のサブ機能です。アップデートチェックは有効なまま起動トースト通知のみを無効化するには、`disabled_hooks` に `"startup-toast"` を追加してください。すべてのアップデートチェック機能(トーストを含む)を無効化するには、`"auto-update-checker"` を追加してください。
|
**`auto-update-checker`と`startup-toast`について**: `startup-toast` フックは `auto-update-checker` のサブ機能です。アップデートチェックは有効なまま起動トースト通知のみを無効化するには、`disabled_hooks` に `"startup-toast"` を追加してください。すべてのアップデートチェック機能(トーストを含む)を無効化するには、`"auto-update-checker"` を追加してください。
|
||||||
|
|
||||||
|
|||||||
83
README.ko.md
83
README.ko.md
@@ -387,6 +387,39 @@ gh repo star code-yeongyu/oh-my-opencode
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
## 언인스톨
|
||||||
|
|
||||||
|
oh-my-opencode를 제거하려면:
|
||||||
|
|
||||||
|
1. **OpenCode 설정에서 플러그인 제거**
|
||||||
|
|
||||||
|
`~/.config/opencode/opencode.json` (또는 `opencode.jsonc`)를 편집하여 `plugin` 배열에서 `"oh-my-opencode"`를 제거합니다:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# jq 사용 예시
|
||||||
|
jq '.plugin = [.plugin[] | select(. != "oh-my-opencode")]' \
|
||||||
|
~/.config/opencode/opencode.json > /tmp/oc.json && \
|
||||||
|
mv /tmp/oc.json ~/.config/opencode/opencode.json
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **설정 파일 삭제 (선택 사항)**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 사용자 설정 삭제
|
||||||
|
rm -f ~/.config/opencode/oh-my-opencode.json
|
||||||
|
|
||||||
|
# 프로젝트 설정 삭제 (존재하는 경우)
|
||||||
|
rm -f .opencode/oh-my-opencode.json
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **제거 확인**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
opencode --version
|
||||||
|
# 플러그인이 더 이상 로드되지 않아야 합니다
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## 기능
|
## 기능
|
||||||
|
|
||||||
### Agents: 당신의 새로운 팀원들
|
### Agents: 당신의 새로운 팀원들
|
||||||
@@ -450,6 +483,18 @@ Syntax Highlighting, Autocomplete, Refactoring, Navigation, Analysis, 그리고
|
|||||||
- **lsp_code_action_resolve**: 코드 액션 적용
|
- **lsp_code_action_resolve**: 코드 액션 적용
|
||||||
- **ast_grep_search**: AST 인식 코드 패턴 검색 (25개 언어)
|
- **ast_grep_search**: AST 인식 코드 패턴 검색 (25개 언어)
|
||||||
- **ast_grep_replace**: AST 인식 코드 교체
|
- **ast_grep_replace**: AST 인식 코드 교체
|
||||||
|
- **call_omo_agent**: 전문 explore/librarian 에이전트를 생성합니다. 비동기 실행을 위한 `run_in_background` 파라미터를 지원합니다.
|
||||||
|
|
||||||
|
#### 세션 관리 (Session Management)
|
||||||
|
|
||||||
|
OpenCode 세션 히스토리를 탐색하고 검색하기 위한 도구들입니다:
|
||||||
|
|
||||||
|
- **session_list**: 날짜 및 개수 제한 필터링을 포함한 모든 OpenCode 세션 목록 조회
|
||||||
|
- **session_read**: 특정 세션의 메시지 및 히스토리 읽기
|
||||||
|
- **session_search**: 세션 메시지 전체 텍스트 검색
|
||||||
|
- **session_info**: 세션에 대한 메타데이터 및 통계 정보 조회
|
||||||
|
|
||||||
|
이 도구들을 통해 에이전트는 이전 대화를 참조하고 세션 간의 연속성을 유지할 수 있습니다.
|
||||||
|
|
||||||
#### Context is all you need.
|
#### Context is all you need.
|
||||||
- **Directory AGENTS.md / README.md Injector**: 파일을 읽을 때 `AGENTS.md`, `README.md` 내용을 자동으로 주입합니다. 파일 디렉토리부터 프로젝트 루트까지 탐색하며, 경로 상의 **모든** `AGENTS.md` 파일을 수집합니다. 중첩된 디렉토리별 지침을 지원합니다:
|
- **Directory AGENTS.md / README.md Injector**: 파일을 읽을 때 `AGENTS.md`, `README.md` 내용을 자동으로 주입합니다. 파일 디렉토리부터 프로젝트 루트까지 탐색하며, 경로 상의 **모든** `AGENTS.md` 파일을 수집합니다. 중첩된 디렉토리별 지침을 지원합니다:
|
||||||
@@ -602,6 +647,10 @@ Oh My OpenCode는 다음 위치의 훅을 읽고 실행합니다:
|
|||||||
- **Empty Message Sanitizer**: 빈 채팅 메시지로 인한 API 오류를 방지합니다. 전송 전 메시지 내용을 자동으로 정리합니다.
|
- **Empty Message Sanitizer**: 빈 채팅 메시지로 인한 API 오류를 방지합니다. 전송 전 메시지 내용을 자동으로 정리합니다.
|
||||||
- **Grep Output Truncator**: grep은 산더미 같은 텍스트를 반환할 수 있습니다. 남은 컨텍스트 윈도우에 따라 동적으로 출력을 축소합니다—50% 여유 공간 유지, 최대 50k 토큰.
|
- **Grep Output Truncator**: grep은 산더미 같은 텍스트를 반환할 수 있습니다. 남은 컨텍스트 윈도우에 따라 동적으로 출력을 축소합니다—50% 여유 공간 유지, 최대 50k 토큰.
|
||||||
- **Tool Output Truncator**: 같은 아이디어, 더 넓은 범위. Grep, Glob, LSP 도구, AST-grep의 출력을 축소합니다. 한 번의 장황한 검색이 전체 컨텍스트를 잡아먹는 것을 방지합니다.
|
- **Tool Output Truncator**: 같은 아이디어, 더 넓은 범위. Grep, Glob, LSP 도구, AST-grep의 출력을 축소합니다. 한 번의 장황한 검색이 전체 컨텍스트를 잡아먹는 것을 방지합니다.
|
||||||
|
- **선제적 압축 (Preemptive Compaction)**: 세션 토큰 한계에 도달하기 전에 선제적으로 세션을 압축합니다. 문제가 발생하기 전에 미리 실행됩니다.
|
||||||
|
- **압축 컨텍스트 주입기 (Compaction Context Injector)**: 세션 압축 중에 중요한 컨텍스트(AGENTS.md, 현재 디렉토리 정보 등)를 유지하여 중요한 상태를 잃지 않도록 합니다.
|
||||||
|
- **사고 블록 검증기 (Thinking Block Validator)**: 사고(thinking) 블록의 형식이 올바른지 검증하여 잘못된 형식으로 인한 API 오류를 방지합니다.
|
||||||
|
- **Claude Code 훅 (Claude Code Hooks)**: Claude Code의 settings.json에 설정된 훅을 실행합니다. PreToolUse/PostToolUse/UserPromptSubmit/Stop 이벤트를 지원하는 호환성 레이어입니다.
|
||||||
|
|
||||||
## 설정
|
## 설정
|
||||||
|
|
||||||
@@ -613,7 +662,7 @@ Oh My OpenCode는 다음 위치의 훅을 읽고 실행합니다:
|
|||||||
|
|
||||||
| 플랫폼 | 사용자 설정 경로 |
|
| 플랫폼 | 사용자 설정 경로 |
|
||||||
|--------|------------------|
|
|--------|------------------|
|
||||||
| **Windows** | `~/.config/opencode/oh-my-opencode.json` (우선) 또는 `%APPDATA%\opencode\oh-my-opencode.json` (fallback) |
|
| **Windows** | `~/.config/opencode/oh-my-opencode.json` (권장) 또는 `%APPDATA%\opencode\oh-my-opencode.json` (fallback) |
|
||||||
| **macOS/Linux** | `~/.config/opencode/oh-my-opencode.json` |
|
| **macOS/Linux** | `~/.config/opencode/oh-my-opencode.json` |
|
||||||
|
|
||||||
Schema 자동 완성이 지원됩니다:
|
Schema 자동 완성이 지원됩니다:
|
||||||
@@ -624,6 +673,36 @@ Schema 자동 완성이 지원됩니다:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### JSONC 지원
|
||||||
|
|
||||||
|
`oh-my-opencode` 설정 파일은 JSONC(주석이 포함된 JSON)를 지원합니다:
|
||||||
|
- 한 줄 주석: `// 주석`
|
||||||
|
- 블록 주석: `/* 주석 */`
|
||||||
|
- 후행 콤마(Trailing commas): `{ "key": "value", }`
|
||||||
|
|
||||||
|
`oh-my-opencode.jsonc`와 `oh-my-opencode.json` 파일이 모두 존재할 경우, `.jsonc` 파일이 우선순위를 갖습니다.
|
||||||
|
|
||||||
|
**주석이 포함된 예시:**
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
"$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": {
|
||||||
|
"model": "openai/gpt-5.2" // 전략적 추론을 위한 GPT
|
||||||
|
},
|
||||||
|
"explore": {
|
||||||
|
"model": "opencode/grok-code" // 탐색을 위한 빠르고 무료인 모델
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Google Auth
|
### Google Auth
|
||||||
|
|
||||||
**권장**: 외부 [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) 플러그인을 사용하세요. 멀티 계정 로드밸런싱, 더 많은 모델(Antigravity를 통한 Claude 포함), 활발한 유지보수를 제공합니다. [설치 > Google Gemini](#42-google-gemini-antigravity-oauth) 참조.
|
**권장**: 외부 [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) 플러그인을 사용하세요. 멀티 계정 로드밸런싱, 더 많은 모델(Antigravity를 통한 Claude 포함), 활발한 유지보수를 제공합니다. [설치 > Google Gemini](#42-google-gemini-antigravity-oauth) 참조.
|
||||||
@@ -786,7 +865,7 @@ Schema 자동 완성이 지원됩니다:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
사용 가능한 훅: `todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-auto-compact`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`
|
사용 가능한 훅: `todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-auto-compact`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`
|
||||||
|
|
||||||
**`auto-update-checker`와 `startup-toast`에 대한 참고사항**: `startup-toast` 훅은 `auto-update-checker`의 하위 기능입니다. 업데이트 확인은 유지하면서 시작 토스트 알림만 비활성화하려면 `disabled_hooks`에 `"startup-toast"`를 추가하세요. 모든 업데이트 확인 기능(토스트 포함)을 비활성화하려면 `"auto-update-checker"`를 추가하세요.
|
**`auto-update-checker`와 `startup-toast`에 대한 참고사항**: `startup-toast` 훅은 `auto-update-checker`의 하위 기능입니다. 업데이트 확인은 유지하면서 시작 토스트 알림만 비활성화하려면 `disabled_hooks`에 `"startup-toast"`를 추가하세요. 모든 업데이트 확인 기능(토스트 포함)을 비활성화하려면 `"auto-update-checker"`를 추가하세요.
|
||||||
|
|
||||||
|
|||||||
18
README.md
18
README.md
@@ -522,6 +522,18 @@ Hand your best tools to your best colleagues. Now they can properly refactor, na
|
|||||||
- **lsp_code_action_resolve**: Apply code action
|
- **lsp_code_action_resolve**: Apply code action
|
||||||
- **ast_grep_search**: AST-aware code pattern search (25 languages)
|
- **ast_grep_search**: AST-aware code pattern search (25 languages)
|
||||||
- **ast_grep_replace**: AST-aware code replacement
|
- **ast_grep_replace**: AST-aware code replacement
|
||||||
|
- **call_omo_agent**: Spawn specialized explore/librarian agents. Supports `run_in_background` parameter for async execution.
|
||||||
|
|
||||||
|
#### Session Management
|
||||||
|
|
||||||
|
Tools to navigate and search your OpenCode session history:
|
||||||
|
|
||||||
|
- **session_list**: List all OpenCode sessions with filtering by date and limit
|
||||||
|
- **session_read**: Read messages and history from a specific session
|
||||||
|
- **session_search**: Full-text search across session messages
|
||||||
|
- **session_info**: Get metadata and statistics about a session
|
||||||
|
|
||||||
|
These tools enable agents to reference previous conversations and maintain continuity across sessions.
|
||||||
|
|
||||||
#### Context Is All You Need
|
#### Context Is All You Need
|
||||||
- **Directory AGENTS.md / README.md Injector**: Auto-injects `AGENTS.md` and `README.md` when reading files. Walks from file directory to project root, collecting **all** `AGENTS.md` files along the path. Supports nested directory-specific instructions:
|
- **Directory AGENTS.md / README.md Injector**: Auto-injects `AGENTS.md` and `README.md` when reading files. Walks from file directory to project root, collecting **all** `AGENTS.md` files along the path. Supports nested directory-specific instructions:
|
||||||
@@ -674,6 +686,10 @@ When agents thrive, you thrive. But I want to help you directly too.
|
|||||||
- **Empty Message Sanitizer**: Prevents API errors from empty chat messages by automatically sanitizing message content before sending.
|
- **Empty Message Sanitizer**: Prevents API errors from empty chat messages by automatically sanitizing message content before sending.
|
||||||
- **Grep Output Truncator**: Grep can return mountains of text. This dynamically truncates output based on your remaining context window—keeps 50% headroom, caps at 50k tokens.
|
- **Grep Output Truncator**: Grep can return mountains of text. This dynamically truncates output based on your remaining context window—keeps 50% headroom, caps at 50k tokens.
|
||||||
- **Tool Output Truncator**: Same idea, broader scope. Truncates output from Grep, Glob, LSP tools, and AST-grep. Prevents one verbose search from eating your entire context.
|
- **Tool Output Truncator**: Same idea, broader scope. Truncates output from Grep, Glob, LSP tools, and AST-grep. Prevents one verbose search from eating your entire context.
|
||||||
|
- **Preemptive Compaction**: Compacts session proactively before hitting hard token limits. Runs before you get into trouble.
|
||||||
|
- **Compaction Context Injector**: Preserves critical context (AGENTS.md, current directory info) during session compaction so you don't lose important state.
|
||||||
|
- **Thinking Block Validator**: Validates thinking blocks to ensure proper formatting and prevent API errors from malformed thinking content.
|
||||||
|
- **Claude Code Hooks**: Executes hooks from Claude Code's settings.json - this is the compatibility layer that runs PreToolUse/PostToolUse/UserPromptSubmit/Stop hooks.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
@@ -888,7 +904,7 @@ Disable specific built-in hooks via `disabled_hooks` in `~/.config/opencode/oh-m
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Available hooks: `todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-auto-compact`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`
|
Available hooks: `todo-continuation-enforcer`, `context-window-monitor`, `session-recovery`, `session-notification`, `comment-checker`, `grep-output-truncator`, `tool-output-truncator`, `directory-agents-injector`, `directory-readme-injector`, `empty-task-response-detector`, `think-mode`, `anthropic-auto-compact`, `rules-injector`, `background-notification`, `auto-update-checker`, `startup-toast`, `keyword-detector`, `agent-usage-reminder`, `non-interactive-env`, `interactive-bash-session`, `empty-message-sanitizer`, `preemptive-compaction`, `compaction-context-injector`, `thinking-block-validator`, `claude-code-hooks`
|
||||||
|
|
||||||
**Note on `auto-update-checker` and `startup-toast`**: The `startup-toast` hook is a sub-feature of `auto-update-checker`. To disable only the startup toast notification while keeping update checking enabled, add `"startup-toast"` to `disabled_hooks`. To disable all update checking features (including the toast), add `"auto-update-checker"` to `disabled_hooks`.
|
**Note on `auto-update-checker` and `startup-toast`**: The `startup-toast` hook is a sub-feature of `auto-update-checker`. To disable only the startup toast notification while keeping update checking enabled, add `"startup-toast"` to `disabled_hooks`. To disable all update checking features (including the toast), add `"auto-update-checker"` to `disabled_hooks`.
|
||||||
|
|
||||||
|
|||||||
@@ -398,6 +398,39 @@ gh repo star code-yeongyu/oh-my-opencode
|
|||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
||||||
|
## 卸载
|
||||||
|
|
||||||
|
要移除 oh-my-opencode:
|
||||||
|
|
||||||
|
1. **从 OpenCode 配置中移除插件**
|
||||||
|
|
||||||
|
编辑 `~/.config/opencode/opencode.json` (或 `opencode.jsonc`),从 `plugin` 数组中移除 `"oh-my-opencode"`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 使用 jq 的示例
|
||||||
|
jq '.plugin = [.plugin[] | select(. != "oh-my-opencode")]' \
|
||||||
|
~/.config/opencode/opencode.json > /tmp/oc.json && \
|
||||||
|
mv /tmp/oc.json ~/.config/opencode/opencode.json
|
||||||
|
```
|
||||||
|
|
||||||
|
2. **删除配置文件 (可选)**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 删除用户配置
|
||||||
|
rm -f ~/.config/opencode/oh-my-opencode.json
|
||||||
|
|
||||||
|
# 删除项目配置 (如果存在)
|
||||||
|
rm -f .opencode/oh-my-opencode.json
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **确认移除**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
opencode --version
|
||||||
|
# 插件不应再被加载
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## 功能
|
## 功能
|
||||||
|
|
||||||
### Agents:你的神队友
|
### Agents:你的神队友
|
||||||
@@ -461,6 +494,18 @@ OhMyOpenCode 让这些成为可能。
|
|||||||
- **lsp_code_action_resolve**:应用代码操作
|
- **lsp_code_action_resolve**:应用代码操作
|
||||||
- **ast_grep_search**:AST 感知代码搜索(支持 25 种语言)
|
- **ast_grep_search**:AST 感知代码搜索(支持 25 种语言)
|
||||||
- **ast_grep_replace**:AST 感知代码替换
|
- **ast_grep_replace**:AST 感知代码替换
|
||||||
|
- **call_omo_agent**: 产生专门的 explore/librarian Agent。支持用于异步执行的 `run_in_background` 参数。
|
||||||
|
|
||||||
|
#### 会话管理 (Session Management)
|
||||||
|
|
||||||
|
用于导航和搜索 OpenCode 会话历史的工具:
|
||||||
|
|
||||||
|
- **session_list**: 列出所有 OpenCode 会话,支持按日期和数量限制进行过滤
|
||||||
|
- **session_read**: 读取特定会话的消息和历史记录
|
||||||
|
- **session_search**: 在会话消息中进行全文搜索
|
||||||
|
- **session_info**: 获取有关会话的元数据和统计信息
|
||||||
|
|
||||||
|
这些工具使 Agent 能够引用之前的对话并保持跨会话的连续性。
|
||||||
|
|
||||||
#### 上下文就是一切 (Context is all you need)
|
#### 上下文就是一切 (Context is all you need)
|
||||||
- **Directory AGENTS.md / README.md 注入器**:读文件时自动把 `AGENTS.md` 和 `README.md` 塞进去。从当前目录一路往上找,路径上**所有** `AGENTS.md` 全都带上。支持嵌套指令:
|
- **Directory AGENTS.md / README.md 注入器**:读文件时自动把 `AGENTS.md` 和 `README.md` 塞进去。从当前目录一路往上找,路径上**所有** `AGENTS.md` 全都带上。支持嵌套指令:
|
||||||
@@ -620,7 +665,12 @@ Agent 爽了,你自然也爽。但我还想直接让你爽。
|
|||||||
|
|
||||||
配置文件(优先级从高到低):
|
配置文件(优先级从高到低):
|
||||||
1. `.opencode/oh-my-opencode.json`(项目级)
|
1. `.opencode/oh-my-opencode.json`(项目级)
|
||||||
2. `~/.config/opencode/oh-my-opencode.json`(用户级)
|
2. 用户配置(按平台):
|
||||||
|
|
||||||
|
| 平台 | 用户配置路径 |
|
||||||
|
|----------|------------------|
|
||||||
|
| **Windows** | `~/.config/opencode/oh-my-opencode.json` (首选) 或 `%APPDATA%\opencode\oh-my-opencode.json` (备选) |
|
||||||
|
| **macOS/Linux** | `~/.config/opencode/oh-my-opencode.json` |
|
||||||
|
|
||||||
支持 Schema 自动补全:
|
支持 Schema 自动补全:
|
||||||
|
|
||||||
@@ -630,6 +680,36 @@ Agent 爽了,你自然也爽。但我还想直接让你爽。
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### JSONC 支持
|
||||||
|
|
||||||
|
`oh-my-opencode` 配置文件支持 JSONC(带注释的 JSON):
|
||||||
|
- 行注释:`// 注释`
|
||||||
|
- 块注释:`/* 注释 */`
|
||||||
|
- 尾随逗号:`{ "key": "value", }`
|
||||||
|
|
||||||
|
当 `oh-my-opencode.jsonc` 和 `oh-my-opencode.json` 文件同时存在时,`.jsonc` 优先。
|
||||||
|
|
||||||
|
**带注释的示例:**
|
||||||
|
|
||||||
|
```jsonc
|
||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
|
||||||
|
|
||||||
|
// 通过 Antigravity OAuth 启用 Google Gemini
|
||||||
|
"google_auth": false,
|
||||||
|
|
||||||
|
/* Agent 覆盖 - 为特定任务自定义模型 */
|
||||||
|
"agents": {
|
||||||
|
"oracle": {
|
||||||
|
"model": "openai/gpt-5.2" // 用于战略推理的 GPT
|
||||||
|
},
|
||||||
|
"explore": {
|
||||||
|
"model": "opencode/grok-code" // 快速且免费的搜索模型
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Google Auth
|
### Google Auth
|
||||||
|
|
||||||
**强推**:用外部 [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) 插件。多账号负载均衡、更多模型(包括 Antigravity 版 Claude)、有人维护。看 [安装 > Google Gemini](#42-google-gemini-antigravity-oauth)。
|
**强推**:用外部 [`opencode-antigravity-auth`](https://github.com/NoeFabris/opencode-antigravity-auth) 插件。多账号负载均衡、更多模型(包括 Antigravity 版 Claude)、有人维护。看 [安装 > Google Gemini](#42-google-gemini-antigravity-oauth)。
|
||||||
@@ -792,7 +872,7 @@ Sisyphus Agent 也能自定义:
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
可关的 hook:`todo-continuation-enforcer`、`context-window-monitor`、`session-recovery`、`session-notification`、`comment-checker`、`grep-output-truncator`、`tool-output-truncator`、`directory-agents-injector`、`directory-readme-injector`、`empty-task-response-detector`、`think-mode`、`anthropic-auto-compact`、`rules-injector`、`background-notification`、`auto-update-checker`、`startup-toast`、`keyword-detector`、`agent-usage-reminder`、`non-interactive-env`、`interactive-bash-session`、`empty-message-sanitizer`
|
可关的 hook:`todo-continuation-enforcer`、`context-window-monitor`、`session-recovery`、`session-notification`、`comment-checker`、`grep-output-truncator`、`tool-output-truncator`、`directory-agents-injector`、`directory-readme-injector`、`empty-task-response-detector`、`think-mode`、`anthropic-auto-compact`、`rules-injector`、`background-notification`、`auto-update-checker`、`startup-toast`、`keyword-detector`、`agent-usage-reminder`、`non-interactive-env`、`interactive-bash-session`、`empty-message-sanitizer`、`preemptive-compaction`、`compaction-context-injector`、`thinking-block-validator`、`claude-code-hooks`
|
||||||
|
|
||||||
**关于 `auto-update-checker` 和 `startup-toast`**: `startup-toast` hook 是 `auto-update-checker` 的子功能。若想保持更新检查但只禁用启动提示通知,在 `disabled_hooks` 中添加 `"startup-toast"`。若要禁用所有更新检查功能(包括提示),添加 `"auto-update-checker"`。
|
**关于 `auto-update-checker` 和 `startup-toast`**: `startup-toast` hook 是 `auto-update-checker` 的子功能。若想保持更新检查但只禁用启动提示通知,在 `disabled_hooks` 中添加 `"startup-toast"`。若要禁用所有更新检查功能(包括提示),添加 `"auto-update-checker"`。
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user