feat: add OpenCode support and fix hook basename detection#1
Merged
itai-delphos merged 1 commit intomasterfrom Feb 23, 2026
Merged
feat: add OpenCode support and fix hook basename detection#1itai-delphos merged 1 commit intomasterfrom
itai-delphos merged 1 commit intomasterfrom
Conversation
**OpenCode Integration:** - Add platform abstraction layer (src/platform.rs) for Claude Code and OpenCode - New OpenCode plugin (hooks/rtk-rewrite.ts) with full command rewrite logic - OpenCode session provider for discover/learn commands (scans ~/.local/share/opencode/opencode.db) - Multi-platform support: discover/learn scan both platforms by default - Updated documentation (README, INSTALL, ARCHITECTURE, TROUBLESHOOTING) for dual-platform usage **Hook Fixes:** - Fix critical basename detection bug: pattern `*/rtk\ *` incorrectly matched `git -C /path/to/rtk status` - Changed to basename checking: only skip if first command word is literally 'rtk' - Add workaround for git -C/-c flags (not yet supported by RTK core) - Hooks now skip rewriting git commands with global options - Prevents "unexpected argument '-C' found" errors - Documented as known limitation in TROUBLESHOOTING.md **Testing:** - All 435 tests pass - Manual testing confirms hooks work in both platforms - Hook correctly rewrites: `git status` → `rtk git status` - Hook correctly skips: `git -C /path status` (no rewrite) - Hook correctly skips: `rtk git status` (already using rtk) **Files Changed:** - NEW: hooks/rtk-rewrite.ts (OpenCode plugin) - NEW: src/platform.rs (platform abstraction) - FIXED: hooks/rtk-rewrite.sh (basename detection + git -C skip) - UPDATED: src/discover/, src/init.rs, src/learn/ (multi-platform) - DOCS: README, INSTALL, ARCHITECTURE, TROUBLESHOOTING
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
OpenCode Integration:
Hook Fixes:
*/rtk\ *incorrectly matchedgit -C /path/to/rtk statusTesting:
git status→rtk git statusgit -C /path status(no rewrite)rtk git status(already using rtk)Files Changed: