Repository navigation
feat: add Gemini CLI support via rtk init --gemini - #573
Merged
pszymkowiak merged 1 commit intoMar 18, 2026
Merged
Conversation
- Add `rtk hook gemini` command: native Rust hook processor for Gemini CLI BeforeTool hooks. Reads JSON from stdin, delegates to `rewrite_command()` (single source of truth), outputs Gemini-format JSON response. - Add `--gemini` flag to `rtk init`: installs hook wrapper script, GEMINI.md, and patches ~/.gemini/settings.json with BeforeTool hook entry. - Add `rtk init -g --gemini --uninstall`: clean removal of all Gemini artifacts. - 6 unit tests covering hook format, rewrite delegation, and exclusions. Replaces PR #174 which had too many conflicts after upstream restructuring. Co-Authored-By: Claude Opus 4.6 <[email protected]> Signed-off-by: Ousama Ben Younes <[email protected]>
6 tasks done
Contributor
Author
Live testing on Gemini CLI ✅Tested on Gemini CLI 0.32.1 (Linux) — hook works end-to-end: Setup: rtk init -g --gemini --auto-patch
# → Hook: ~/.gemini/hooks/rtk-hook-gemini.sh
# → GEMINI.md installed
# → settings.json patched with BeforeTool hookResult: Gemini types 3 lines instead of ~15 — standard RTK compression. Hook processor verified with all command families:
Install/uninstall cycle:
|
── curl ──
✅ curl json │ curl -s https://httpbin.org/json │ /home/runner/work/rtk/rtk/target/release/rtk curl https://httpbin.org/json │ 107 → 39 (+63%)
⚠️ curl text │ curl -s https://httpbin.org/robots.txt │ /home/runner/work/rtk/rtk/target/release/rtk curl https://httpbin.org/robots.txt │ 8 → 8 (+0%)
── wget ──
⚠️ wget │ wget -qO- https://httpbin.org/robots.txt │ /home/runner/work/rtk/rtk/target/release/rtk wget https://httpbin.org/robots.txt -O │ 8 → 17 (-112%)
── gh ──
❌ gh pr list │ gh pr list 2>&1 || true │ /home/runner/work/rtk/rtk/target/release/rtk gh pr list │ 35 → - (--)
❌ gh run list │ gh run list 2>&1 || true │ /home/runner/work/rtk/rtk/target/release/rtk gh run list │ 35 → - (--)
── docker ──
✅ docker ps │ docker ps 2>/dev/null || true │ /home/runner/work/rtk/rtk/target/release/rtk docker ps │ 18 → 4 (+77%)
✅ docker images │ docker images 2>/dev/null || true │ /home/runner/work/rtk/rtk/target/release/rtk docker images │ 45 → 18 (+60%)
── kubectl ──
✅ kubectl pods │ kubectl get pods 2>/dev/null || true │ /home/runner/work/rtk/rtk/target/release/rtk kubectl pods │ 0 → 5 (+0%)
✅ kubectl services │ kubectl get services 2>/dev/null || true │ /home/runner/work/rtk/rtk/target/release/rtk kubectl services │ 0 → 6 (+0%)
── python ──
✅ ruff check │ ruff check . 2>&1 || true │ /home/runner/work/rtk/rtk/target/release/rtk ruff check . │ 278 → 62 (+77%)
✅ pytest │ pytest -v 2>&1 || true │ /home/runner/work/rtk/rtk/target/release/rtk pytest -v │ 129 → 7 (+94%)
── go ──
✅ golangci-lint │ golangci-lint run 2>&1 || true │ /home/runner/work/rtk/rtk/target/release/rtk golangci-lint run │ 0 → 8 (+0%)
✅ go test │ go test -v 2>&1 || true │ /home/runner/work/rtk/rtk/target/release/rtk go test -v │ 30 → 9 (+70%)
✅ go build │ go build ./... 2>&1 || true │ /home/runner/work/rtk/rtk/target/release/rtk go build ./... │ 0 → 5 (+0%)
✅ go vet │ go vet ./... 2>&1 || true │ /home/runner/work/rtk/rtk/target/release/rtk go vet ./... │ 0 → 7 (+0%)Thanks @ousamabenyounes , this could be very helpful for the use of gemini-cli. |
pszymkowiak
added a commit
to jeziellopes/rtk
that referenced
this pull request
Mar 18, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat (updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion). - Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI) - Delegates to `rtk rewrite` (single source of truth) - 14 hook tests (format detection, rewrite gating, output shape) - .github/hooks/rtk-rewrite.json for repo-scoped hook config - .github/copilot-instructions.md for RTK awareness - Test script: hooks/test-copilot-rtk-rewrite.sh Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358). Original work by @jeziellopes, cleaned up and rebased by maintainer. Signed-off-by: Patrick szymkowiak <[email protected]>
This was referenced Mar 18, 2026
Merged
pszymkowiak
added a commit
that referenced
this pull request
Mar 18, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat (updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion). - Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI) - Delegates to `rtk rewrite` (single source of truth) - 14 hook tests (format detection, rewrite gating, output shape) - .github/hooks/rtk-rewrite.json for repo-scoped hook config - .github/copilot-instructions.md for RTK awareness - Test script: hooks/test-copilot-rtk-rewrite.sh Rebased on develop (includes Gemini #573, Codex #377, OpenClaw #358). Original work by @jeziellopes, cleaned up and rebased by maintainer. Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Patrick szymkowiak <[email protected]>
This was referenced Mar 18, 2026
FlorianBruniaux
added a commit
that referenced
this pull request
Mar 19, 2026
hook_cmd.rs was added in feat: add Gemini CLI support (#573) but ARCHITECTURE.md was not updated. Fixes pre-push validation failure. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]>
2 tasks
pszymkowiak
pushed a commit
that referenced
this pull request
Mar 19, 2026
… hint (#717) * fix(skill/rtk-triage): increase PR/issue limit to 200 with pagination hint Raise gh pr list limit from 60 to 200 to match gh's max per call. Add inline comment explaining how to paginate for repos with >200 open PRs. Update threshold warning from >60 to >200 PRs/issues. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> * docs(architecture): update module count to 67 (hook_cmd added in #573) hook_cmd.rs was added in feat: add Gemini CLI support (#573) but ARCHITECTURE.md was not updated. Fixes pre-push validation failure. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> --------- Signed-off-by: Florian BRUNIAUX <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
pszymkowiak
added a commit
that referenced
this pull request
Mar 19, 2026
* fix: remove all decorative emojis from CLI output (#687) * fix: remove decorative emojis from CLI output (#511) Replace decorative emojis with plain text to reduce token waste. Keep functional symbols (⚠️ ✓ ❌ ✅ ℹ️) that convey meaning in fewer tokens. Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove remaining decorative emojis from find_cmd and formatter Missed in initial emoji cleanup pass: 📁 in find_cmd.rs and parser/formatter.rs Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove all decorative emojis from CLI output (#511) Replace emojis with plain text tokens across all production files for better LLM compatibility. Test fixtures and external tool detection patterns (e.g. Black's "All done!") are preserved. Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove last decorative emoji from next_cmd.rs Remove ⚡ from Next.js Build header, missed in previous passes. Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove remaining emojis from gh_cmd.rs and init.rs Replace production emojis: - gh_cmd.rs: 🟣→[merged], ⚪→[unknown]/[pending], ⭐→removed, 🔱→removed - init.rs: ⚪→[--] for "not found" status indicators Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove all checkmark emojis from CLI output Replace ✓ (U+2713) with plain text across 19 files: - "ok ✓" → "ok" (git add/commit/push/pull) - "✓ cargo test: ..." → "cargo test: ..." (all tool summaries) - Preserved ✓ in input detection patterns and test fixtures LLMs cannot interpret emoji semantics; plain text is clearer. Signed-off-by: Patrick szymkowiak <[email protected]> --------- Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Patrick szymkowiak <[email protected]> Signed-off-by: Patrick Szymkowiak <[email protected]> * feat: OpenClaw plugin for transparent exec rewriting (#358) * feat: add OpenClaw plugin for transparent exec rewriting Adds an OpenClaw plugin that intercepts exec tool calls via the before_tool_call hook and rewrites commands to their RTK equivalents. This is the OpenClaw equivalent of hooks/rtk-rewrite.sh for Claude Code. The plugin: - Registers a before_tool_call hook on the exec tool - Rewrites git, grep, find, ls, gh, docker, kubectl, and test commands - Guards against rewriting piped/compound commands and heredocs - Returns properly typed PluginHookBeforeToolCallResult - Supports enabled/verbose config options Measured savings: 48-87% token reduction on common commands. Files: - openclaw/index.ts — plugin source - openclaw/openclaw.plugin.json — plugin manifest - openclaw/README.md — installation and usage docs * refactor: delegate OpenClaw plugin to rtk rewrite Replace 60+ hardcoded regex rules with a single call to `rtk rewrite`, matching the OpenCode plugin pattern (hooks/opencode-rtk.ts). Benefits: - Zero maintenance: new RTK filters work automatically - Single source of truth: rewrite logic in Rust (src/discover/registry.rs) - 122 → 73 lines, no rule duplication Also: rebase on develop, fix homepage URL, bump version to 1.0.0. Signed-off-by: Patrick szymkowiak <[email protected]> * feat: add package.json for npm publishing Enables `openclaw plugins install @rtk-ai/rtk-rewrite` for OpenClaw users. Signed-off-by: Patrick szymkowiak <[email protected]> --------- Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Patrick szymkowiak <[email protected]> * feat: add Gemini CLI support via rtk init --gemini (#573) - Add `rtk hook gemini` command: native Rust hook processor for Gemini CLI BeforeTool hooks. Reads JSON from stdin, delegates to `rewrite_command()` (single source of truth), outputs Gemini-format JSON response. - Add `--gemini` flag to `rtk init`: installs hook wrapper script, GEMINI.md, and patches ~/.gemini/settings.json with BeforeTool hook entry. - Add `rtk init -g --gemini --uninstall`: clean removal of all Gemini artifacts. - 6 unit tests covering hook format, rewrite delegation, and exclusions. Replaces PR #174 which had too many conflicts after upstream restructuring. Signed-off-by: Ousama Ben Younes <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]> * feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow (#377) * feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow Add --codex mode to rtk init for Codex CLI integration using AGENTS.md + RTK.md, while keeping the newer develop init/opencode flow intact. Includes Codex install/show/uninstall handling, ASCII status output, stricter flag validation, and expanded tests for Codex AGENTS lifecycle and patch-mode rejection. Signed-off-by: Zacaria <[email protected]> * docs: fix validation metadata Signed-off-by: Zacaria <[email protected]> --------- Signed-off-by: Zacaria <[email protected]> * feat(copilot): add Copilot hook support (VS Code + CLI) (#605) Add `rtk hook copilot` command that handles both VS Code Copilot Chat (updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion). - Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI) - Delegates to `rtk rewrite` (single source of truth) - 14 hook tests (format detection, rewrite gating, output shape) - .github/hooks/rtk-rewrite.json for repo-scoped hook config - .github/copilot-instructions.md for RTK awareness - Test script: hooks/test-copilot-rtk-rewrite.sh Rebased on develop (includes Gemini #573, Codex #377, OpenClaw #358). Original work by @jeziellopes, cleaned up and rebased by maintainer. Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Patrick szymkowiak <[email protected]> * feat: add Cursor Agent support via --agent flag (#595) Add `rtk init -g --agent cursor` to install RTK hooks for Cursor Agent. Cursor's preToolUse hook supports command rewriting via updated_input, functionally identical to Claude Code's PreToolUse. Works with both the Cursor editor and cursor-cli (they share ~/.cursor/hooks.json). Changes: - New `--agent <name>` flag (claude|cursor) on `rtk init`, extensible for future agents. Default is claude (backward compatible). - Cursor hook script (hooks/cursor-rtk-rewrite.sh) outputs Cursor's JSON format: {permission, updated_input} vs Claude's hookSpecificOutput. - `rtk init --show` reports Cursor hook and hooks.json status. - `rtk init -g --uninstall` removes Cursor artifacts. - `rtk discover` notes that Cursor sessions are tracked via `rtk gain` (Cursor transcripts lack structured tool_use/tool_result blocks). - Unit tests for Cursor hooks.json patching, detection, and removal. Made-with: Cursor Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Moisei <[email protected]> * feat: add Windsurf support via rtk init --agent windsurf (#695) (#697) Install RTK rules in .windsurfrules (project-scoped) so Cascade prefixes shell commands with rtk for token savings. Windsurf hooks don't support command rewriting (only blocking), so RTK uses the rules-based approach (like Codex with AGENTS.md). Tested: Windsurf Cascade correctly uses rtk git status after install. Signed-off-by: Patrick szymkowiak <[email protected]> * feat: add Cline/Roo Code support via rtk init --agent cline (#701) (#702) Install RTK rules in .clinerules (project-scoped) so Cline prefixes shell commands with rtk for token savings. Same rules-based approach as Windsurf and Codex. Signed-off-by: Patrick szymkowiak <[email protected]> * fix(skill/rtk-triage): increase PR/issue limit to 200 with pagination hint (#717) * fix(skill/rtk-triage): increase PR/issue limit to 200 with pagination hint Raise gh pr list limit from 60 to 200 to match gh's max per call. Add inline comment explaining how to paginate for repos with >200 open PRs. Update threshold warning from >60 to >200 PRs/issues. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> * docs(architecture): update module count to 67 (hook_cmd added in #573) hook_cmd.rs was added in feat: add Gemini CLI support (#573) but ARCHITECTURE.md was not updated. Fixes pre-push validation failure. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> --------- Signed-off-by: Florian BRUNIAUX <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]> --------- Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Patrick szymkowiak <[email protected]> Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Ousama Ben Younes <[email protected]> Signed-off-by: Zacaria <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> Co-authored-by: Alex <[email protected]> Co-authored-by: Ben Younes <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Zacaria Chtatar <[email protected]> Co-authored-by: Jeziel Lopes <[email protected]> Co-authored-by: Moisei Rabinovich <[email protected]> Co-authored-by: Moisei <[email protected]> Co-authored-by: Florian BRUNIAUX <[email protected]>
helgeu
pushed a commit
to helgeu/rtk
that referenced
this pull request
Mar 27, 2026
- Add `rtk hook gemini` command: native Rust hook processor for Gemini CLI BeforeTool hooks. Reads JSON from stdin, delegates to `rewrite_command()` (single source of truth), outputs Gemini-format JSON response. - Add `--gemini` flag to `rtk init`: installs hook wrapper script, GEMINI.md, and patches ~/.gemini/settings.json with BeforeTool hook entry. - Add `rtk init -g --gemini --uninstall`: clean removal of all Gemini artifacts. - 6 unit tests covering hook format, rewrite delegation, and exclusions. Replaces PR rtk-ai#174 which had too many conflicts after upstream restructuring. Signed-off-by: Ousama Ben Younes <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
helgeu
pushed a commit
to helgeu/rtk
that referenced
this pull request
Mar 27, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat (updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion). - Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI) - Delegates to `rtk rewrite` (single source of truth) - 14 hook tests (format detection, rewrite gating, output shape) - .github/hooks/rtk-rewrite.json for repo-scoped hook config - .github/copilot-instructions.md for RTK awareness - Test script: hooks/test-copilot-rtk-rewrite.sh Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358). Original work by @jeziellopes, cleaned up and rebased by maintainer. Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Patrick szymkowiak <[email protected]>
romualdbassinot-efficy
pushed a commit
to romualdbassinot-efficy/rtk
that referenced
this pull request
Apr 10, 2026
- Add `rtk hook gemini` command: native Rust hook processor for Gemini CLI BeforeTool hooks. Reads JSON from stdin, delegates to `rewrite_command()` (single source of truth), outputs Gemini-format JSON response. - Add `--gemini` flag to `rtk init`: installs hook wrapper script, GEMINI.md, and patches ~/.gemini/settings.json with BeforeTool hook entry. - Add `rtk init -g --gemini --uninstall`: clean removal of all Gemini artifacts. - 6 unit tests covering hook format, rewrite delegation, and exclusions. Replaces PR rtk-ai#174 which had too many conflicts after upstream restructuring. Signed-off-by: Ousama Ben Younes <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
romualdbassinot-efficy
pushed a commit
to romualdbassinot-efficy/rtk
that referenced
this pull request
Apr 10, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat (updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion). - Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI) - Delegates to `rtk rewrite` (single source of truth) - 14 hook tests (format detection, rewrite gating, output shape) - .github/hooks/rtk-rewrite.json for repo-scoped hook config - .github/copilot-instructions.md for RTK awareness - Test script: hooks/test-copilot-rtk-rewrite.sh Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358). Original work by @jeziellopes, cleaned up and rebased by maintainer. Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Patrick szymkowiak <[email protected]>
romualdbassinot-efficy
pushed a commit
to romualdbassinot-efficy/rtk
that referenced
this pull request
Apr 10, 2026
- Add `rtk hook gemini` command: native Rust hook processor for Gemini CLI BeforeTool hooks. Reads JSON from stdin, delegates to `rewrite_command()` (single source of truth), outputs Gemini-format JSON response. - Add `--gemini` flag to `rtk init`: installs hook wrapper script, GEMINI.md, and patches ~/.gemini/settings.json with BeforeTool hook entry. - Add `rtk init -g --gemini --uninstall`: clean removal of all Gemini artifacts. - 6 unit tests covering hook format, rewrite delegation, and exclusions. Replaces PR rtk-ai#174 which had too many conflicts after upstream restructuring. Signed-off-by: Ousama Ben Younes <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
romualdbassinot-efficy
pushed a commit
to romualdbassinot-efficy/rtk
that referenced
this pull request
Apr 10, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat (updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion). - Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI) - Delegates to `rtk rewrite` (single source of truth) - 14 hook tests (format detection, rewrite gating, output shape) - .github/hooks/rtk-rewrite.json for repo-scoped hook config - .github/copilot-instructions.md for RTK awareness - Test script: hooks/test-copilot-rtk-rewrite.sh Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358). Original work by @jeziellopes, cleaned up and rebased by maintainer. Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Patrick szymkowiak <[email protected]>
romualdbassinot-efficy
pushed a commit
to romualdbassinot-efficy/rtk
that referenced
this pull request
Apr 10, 2026
- Add `rtk hook gemini` command: native Rust hook processor for Gemini CLI BeforeTool hooks. Reads JSON from stdin, delegates to `rewrite_command()` (single source of truth), outputs Gemini-format JSON response. - Add `--gemini` flag to `rtk init`: installs hook wrapper script, GEMINI.md, and patches ~/.gemini/settings.json with BeforeTool hook entry. - Add `rtk init -g --gemini --uninstall`: clean removal of all Gemini artifacts. - 6 unit tests covering hook format, rewrite delegation, and exclusions. Replaces PR rtk-ai#174 which had too many conflicts after upstream restructuring. Signed-off-by: Ousama Ben Younes <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
romualdbassinot-efficy
pushed a commit
to romualdbassinot-efficy/rtk
that referenced
this pull request
Apr 10, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat (updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion). - Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI) - Delegates to `rtk rewrite` (single source of truth) - 14 hook tests (format detection, rewrite gating, output shape) - .github/hooks/rtk-rewrite.json for repo-scoped hook config - .github/copilot-instructions.md for RTK awareness - Test script: hooks/test-copilot-rtk-rewrite.sh Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358). Original work by @jeziellopes, cleaned up and rebased by maintainer. Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Patrick szymkowiak <[email protected]>
thehoff
pushed a commit
to thehoff/contextcrawler
that referenced
this pull request
May 14, 2026
- Add `rtk hook gemini` command: native Rust hook processor for Gemini CLI BeforeTool hooks. Reads JSON from stdin, delegates to `rewrite_command()` (single source of truth), outputs Gemini-format JSON response. - Add `--gemini` flag to `rtk init`: installs hook wrapper script, GEMINI.md, and patches ~/.gemini/settings.json with BeforeTool hook entry. - Add `rtk init -g --gemini --uninstall`: clean removal of all Gemini artifacts. - 6 unit tests covering hook format, rewrite delegation, and exclusions. Replaces PR #174 which had too many conflicts after upstream restructuring. Signed-off-by: Ousama Ben Younes <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
thehoff
pushed a commit
to thehoff/contextcrawler
that referenced
this pull request
May 14, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat (updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion). - Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI) - Delegates to `rtk rewrite` (single source of truth) - 14 hook tests (format detection, rewrite gating, output shape) - .github/hooks/rtk-rewrite.json for repo-scoped hook config - .github/copilot-instructions.md for RTK awareness - Test script: hooks/test-copilot-rtk-rewrite.sh Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358). Original work by @jeziellopes, cleaned up and rebased by maintainer. Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Patrick szymkowiak <[email protected]>
thehoff
pushed a commit
to thehoff/contextcrawler
that referenced
this pull request
May 14, 2026
… hint (rtk-ai#717) * fix(skill/rtk-triage): increase PR/issue limit to 200 with pagination hint Raise gh pr list limit from 60 to 200 to match gh's max per call. Add inline comment explaining how to paginate for repos with >200 open PRs. Update threshold warning from >60 to >200 PRs/issues. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> * docs(architecture): update module count to 67 (hook_cmd added in rtk-ai#573) hook_cmd.rs was added in feat: add Gemini CLI support (rtk-ai#573) but ARCHITECTURE.md was not updated. Fixes pre-push validation failure. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> --------- Signed-off-by: Florian BRUNIAUX <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
thehoff
pushed a commit
to thehoff/contextcrawler
that referenced
this pull request
May 14, 2026
* fix: remove all decorative emojis from CLI output (rtk-ai#687) * fix: remove decorative emojis from CLI output (rtk-ai#511) Replace decorative emojis with plain text to reduce token waste. Keep functional symbols (⚠️ ✓ ❌ ✅ ℹ️) that convey meaning in fewer tokens. Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove remaining decorative emojis from find_cmd and formatter Missed in initial emoji cleanup pass: 📁 in find_cmd.rs and parser/formatter.rs Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove all decorative emojis from CLI output (rtk-ai#511) Replace emojis with plain text tokens across all production files for better LLM compatibility. Test fixtures and external tool detection patterns (e.g. Black's "All done!") are preserved. Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove last decorative emoji from next_cmd.rs Remove ⚡ from Next.js Build header, missed in previous passes. Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove remaining emojis from gh_cmd.rs and init.rs Replace production emojis: - gh_cmd.rs: 🟣→[merged], ⚪→[unknown]/[pending], ⭐→removed, 🔱→removed - init.rs: ⚪→[--] for "not found" status indicators Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove all checkmark emojis from CLI output Replace ✓ (U+2713) with plain text across 19 files: - "ok ✓" → "ok" (git add/commit/push/pull) - "✓ cargo test: ..." → "cargo test: ..." (all tool summaries) - Preserved ✓ in input detection patterns and test fixtures LLMs cannot interpret emoji semantics; plain text is clearer. Signed-off-by: Patrick szymkowiak <[email protected]> --------- Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Patrick szymkowiak <[email protected]> Signed-off-by: Patrick Szymkowiak <[email protected]> * feat: OpenClaw plugin for transparent exec rewriting (rtk-ai#358) * feat: add OpenClaw plugin for transparent exec rewriting Adds an OpenClaw plugin that intercepts exec tool calls via the before_tool_call hook and rewrites commands to their RTK equivalents. This is the OpenClaw equivalent of hooks/rtk-rewrite.sh for Claude Code. The plugin: - Registers a before_tool_call hook on the exec tool - Rewrites git, grep, find, ls, gh, docker, kubectl, and test commands - Guards against rewriting piped/compound commands and heredocs - Returns properly typed PluginHookBeforeToolCallResult - Supports enabled/verbose config options Measured savings: 48-87% token reduction on common commands. Files: - openclaw/index.ts — plugin source - openclaw/openclaw.plugin.json — plugin manifest - openclaw/README.md — installation and usage docs * refactor: delegate OpenClaw plugin to rtk rewrite Replace 60+ hardcoded regex rules with a single call to `rtk rewrite`, matching the OpenCode plugin pattern (hooks/opencode-rtk.ts). Benefits: - Zero maintenance: new RTK filters work automatically - Single source of truth: rewrite logic in Rust (src/discover/registry.rs) - 122 → 73 lines, no rule duplication Also: rebase on develop, fix homepage URL, bump version to 1.0.0. Signed-off-by: Patrick szymkowiak <[email protected]> * feat: add package.json for npm publishing Enables `openclaw plugins install @rtk-ai/rtk-rewrite` for OpenClaw users. Signed-off-by: Patrick szymkowiak <[email protected]> --------- Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Patrick szymkowiak <[email protected]> * feat: add Gemini CLI support via rtk init --gemini (rtk-ai#573) - Add `rtk hook gemini` command: native Rust hook processor for Gemini CLI BeforeTool hooks. Reads JSON from stdin, delegates to `rewrite_command()` (single source of truth), outputs Gemini-format JSON response. - Add `--gemini` flag to `rtk init`: installs hook wrapper script, GEMINI.md, and patches ~/.gemini/settings.json with BeforeTool hook entry. - Add `rtk init -g --gemini --uninstall`: clean removal of all Gemini artifacts. - 6 unit tests covering hook format, rewrite delegation, and exclusions. Replaces PR #174 which had too many conflicts after upstream restructuring. Signed-off-by: Ousama Ben Younes <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]> * feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow (rtk-ai#377) * feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow Add --codex mode to rtk init for Codex CLI integration using AGENTS.md + RTK.md, while keeping the newer develop init/opencode flow intact. Includes Codex install/show/uninstall handling, ASCII status output, stricter flag validation, and expanded tests for Codex AGENTS lifecycle and patch-mode rejection. Signed-off-by: Zacaria <[email protected]> * docs: fix validation metadata Signed-off-by: Zacaria <[email protected]> --------- Signed-off-by: Zacaria <[email protected]> * feat(copilot): add Copilot hook support (VS Code + CLI) (rtk-ai#605) Add `rtk hook copilot` command that handles both VS Code Copilot Chat (updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion). - Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI) - Delegates to `rtk rewrite` (single source of truth) - 14 hook tests (format detection, rewrite gating, output shape) - .github/hooks/rtk-rewrite.json for repo-scoped hook config - .github/copilot-instructions.md for RTK awareness - Test script: hooks/test-copilot-rtk-rewrite.sh Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358). Original work by @jeziellopes, cleaned up and rebased by maintainer. Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Patrick szymkowiak <[email protected]> * feat: add Cursor Agent support via --agent flag (rtk-ai#595) Add `rtk init -g --agent cursor` to install RTK hooks for Cursor Agent. Cursor's preToolUse hook supports command rewriting via updated_input, functionally identical to Claude Code's PreToolUse. Works with both the Cursor editor and cursor-cli (they share ~/.cursor/hooks.json). Changes: - New `--agent <name>` flag (claude|cursor) on `rtk init`, extensible for future agents. Default is claude (backward compatible). - Cursor hook script (hooks/cursor-rtk-rewrite.sh) outputs Cursor's JSON format: {permission, updated_input} vs Claude's hookSpecificOutput. - `rtk init --show` reports Cursor hook and hooks.json status. - `rtk init -g --uninstall` removes Cursor artifacts. - `rtk discover` notes that Cursor sessions are tracked via `rtk gain` (Cursor transcripts lack structured tool_use/tool_result blocks). - Unit tests for Cursor hooks.json patching, detection, and removal. Made-with: Cursor Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Moisei <[email protected]> * feat: add Windsurf support via rtk init --agent windsurf (rtk-ai#695) (rtk-ai#697) Install RTK rules in .windsurfrules (project-scoped) so Cascade prefixes shell commands with rtk for token savings. Windsurf hooks don't support command rewriting (only blocking), so RTK uses the rules-based approach (like Codex with AGENTS.md). Tested: Windsurf Cascade correctly uses rtk git status after install. Signed-off-by: Patrick szymkowiak <[email protected]> * feat: add Cline/Roo Code support via rtk init --agent cline (rtk-ai#701) (rtk-ai#702) Install RTK rules in .clinerules (project-scoped) so Cline prefixes shell commands with rtk for token savings. Same rules-based approach as Windsurf and Codex. Signed-off-by: Patrick szymkowiak <[email protected]> * fix(skill/rtk-triage): increase PR/issue limit to 200 with pagination hint (rtk-ai#717) * fix(skill/rtk-triage): increase PR/issue limit to 200 with pagination hint Raise gh pr list limit from 60 to 200 to match gh's max per call. Add inline comment explaining how to paginate for repos with >200 open PRs. Update threshold warning from >60 to >200 PRs/issues. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> * docs(architecture): update module count to 67 (hook_cmd added in rtk-ai#573) hook_cmd.rs was added in feat: add Gemini CLI support (rtk-ai#573) but ARCHITECTURE.md was not updated. Fixes pre-push validation failure. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> --------- Signed-off-by: Florian BRUNIAUX <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]> --------- Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Patrick szymkowiak <[email protected]> Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Ousama Ben Younes <[email protected]> Signed-off-by: Zacaria <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> Co-authored-by: Alex <[email protected]> Co-authored-by: Ben Younes <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Zacaria Chtatar <[email protected]> Co-authored-by: Jeziel Lopes <[email protected]> Co-authored-by: Moisei Rabinovich <[email protected]> Co-authored-by: Moisei <[email protected]> Co-authored-by: Florian BRUNIAUX <[email protected]>
thehoff
pushed a commit
to thehoff/contextcrawler
that referenced
this pull request
May 14, 2026
- Add `rtk hook gemini` command: native Rust hook processor for Gemini CLI BeforeTool hooks. Reads JSON from stdin, delegates to `rewrite_command()` (single source of truth), outputs Gemini-format JSON response. - Add `--gemini` flag to `rtk init`: installs hook wrapper script, GEMINI.md, and patches ~/.gemini/settings.json with BeforeTool hook entry. - Add `rtk init -g --gemini --uninstall`: clean removal of all Gemini artifacts. - 6 unit tests covering hook format, rewrite delegation, and exclusions. Replaces PR #174 which had too many conflicts after upstream restructuring. Signed-off-by: Ousama Ben Younes <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]>
thehoff
pushed a commit
to thehoff/contextcrawler
that referenced
this pull request
May 14, 2026
Add `rtk hook copilot` command that handles both VS Code Copilot Chat (updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion). - Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI) - Delegates to `rtk rewrite` (single source of truth) - 14 hook tests (format detection, rewrite gating, output shape) - .github/hooks/rtk-rewrite.json for repo-scoped hook config - .github/copilot-instructions.md for RTK awareness - Test script: hooks/test-copilot-rtk-rewrite.sh Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358). Original work by @jeziellopes, cleaned up and rebased by maintainer. Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Patrick szymkowiak <[email protected]>
thehoff
pushed a commit
to thehoff/contextcrawler
that referenced
this pull request
May 14, 2026
… hint (rtk-ai#717) * fix(skill/rtk-triage): increase PR/issue limit to 200 with pagination hint Raise gh pr list limit from 60 to 200 to match gh's max per call. Add inline comment explaining how to paginate for repos with >200 open PRs. Update threshold warning from >60 to >200 PRs/issues. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> * docs(architecture): update module count to 67 (hook_cmd added in rtk-ai#573) hook_cmd.rs was added in feat: add Gemini CLI support (rtk-ai#573) but ARCHITECTURE.md was not updated. Fixes pre-push validation failure. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> --------- Signed-off-by: Florian BRUNIAUX <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]>
thehoff
pushed a commit
to thehoff/contextcrawler
that referenced
this pull request
May 14, 2026
* fix: remove all decorative emojis from CLI output (rtk-ai#687) * fix: remove decorative emojis from CLI output (rtk-ai#511) Replace decorative emojis with plain text to reduce token waste. Keep functional symbols (⚠️ ✓ ❌ ✅ ℹ️) that convey meaning in fewer tokens. Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove remaining decorative emojis from find_cmd and formatter Missed in initial emoji cleanup pass: 📁 in find_cmd.rs and parser/formatter.rs Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove all decorative emojis from CLI output (rtk-ai#511) Replace emojis with plain text tokens across all production files for better LLM compatibility. Test fixtures and external tool detection patterns (e.g. Black's "All done!") are preserved. Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove last decorative emoji from next_cmd.rs Remove ⚡ from Next.js Build header, missed in previous passes. Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove remaining emojis from gh_cmd.rs and init.rs Replace production emojis: - gh_cmd.rs: 🟣→[merged], ⚪→[unknown]/[pending], ⭐→removed, 🔱→removed - init.rs: ⚪→[--] for "not found" status indicators Signed-off-by: Patrick szymkowiak <[email protected]> * fix: remove all checkmark emojis from CLI output Replace ✓ (U+2713) with plain text across 19 files: - "ok ✓" → "ok" (git add/commit/push/pull) - "✓ cargo test: ..." → "cargo test: ..." (all tool summaries) - Preserved ✓ in input detection patterns and test fixtures LLMs cannot interpret emoji semantics; plain text is clearer. Signed-off-by: Patrick szymkowiak <[email protected]> --------- Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Patrick szymkowiak <[email protected]> Signed-off-by: Patrick Szymkowiak <[email protected]> * feat: OpenClaw plugin for transparent exec rewriting (rtk-ai#358) * feat: add OpenClaw plugin for transparent exec rewriting Adds an OpenClaw plugin that intercepts exec tool calls via the before_tool_call hook and rewrites commands to their RTK equivalents. This is the OpenClaw equivalent of hooks/rtk-rewrite.sh for Claude Code. The plugin: - Registers a before_tool_call hook on the exec tool - Rewrites git, grep, find, ls, gh, docker, kubectl, and test commands - Guards against rewriting piped/compound commands and heredocs - Returns properly typed PluginHookBeforeToolCallResult - Supports enabled/verbose config options Measured savings: 48-87% token reduction on common commands. Files: - openclaw/index.ts — plugin source - openclaw/openclaw.plugin.json — plugin manifest - openclaw/README.md — installation and usage docs * refactor: delegate OpenClaw plugin to rtk rewrite Replace 60+ hardcoded regex rules with a single call to `rtk rewrite`, matching the OpenCode plugin pattern (hooks/opencode-rtk.ts). Benefits: - Zero maintenance: new RTK filters work automatically - Single source of truth: rewrite logic in Rust (src/discover/registry.rs) - 122 → 73 lines, no rule duplication Also: rebase on develop, fix homepage URL, bump version to 1.0.0. Signed-off-by: Patrick szymkowiak <[email protected]> * feat: add package.json for npm publishing Enables `openclaw plugins install @rtk-ai/rtk-rewrite` for OpenClaw users. Signed-off-by: Patrick szymkowiak <[email protected]> --------- Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Patrick szymkowiak <[email protected]> * feat: add Gemini CLI support via rtk init --gemini (rtk-ai#573) - Add `rtk hook gemini` command: native Rust hook processor for Gemini CLI BeforeTool hooks. Reads JSON from stdin, delegates to `rewrite_command()` (single source of truth), outputs Gemini-format JSON response. - Add `--gemini` flag to `rtk init`: installs hook wrapper script, GEMINI.md, and patches ~/.gemini/settings.json with BeforeTool hook entry. - Add `rtk init -g --gemini --uninstall`: clean removal of all Gemini artifacts. - 6 unit tests covering hook format, rewrite delegation, and exclusions. Replaces PR #174 which had too many conflicts after upstream restructuring. Signed-off-by: Ousama Ben Younes <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]> * feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow (rtk-ai#377) * feat(init): add Codex CLI support via AGENTS.md + RTK.md workflow Add --codex mode to rtk init for Codex CLI integration using AGENTS.md + RTK.md, while keeping the newer develop init/opencode flow intact. Includes Codex install/show/uninstall handling, ASCII status output, stricter flag validation, and expanded tests for Codex AGENTS lifecycle and patch-mode rejection. Signed-off-by: Zacaria <[email protected]> * docs: fix validation metadata Signed-off-by: Zacaria <[email protected]> --------- Signed-off-by: Zacaria <[email protected]> * feat(copilot): add Copilot hook support (VS Code + CLI) (rtk-ai#605) Add `rtk hook copilot` command that handles both VS Code Copilot Chat (updatedInput rewrite) and GitHub Copilot CLI (deny-with-suggestion). - Auto-detects format: snake_case (VS Code) vs camelCase (Copilot CLI) - Delegates to `rtk rewrite` (single source of truth) - 14 hook tests (format detection, rewrite gating, output shape) - .github/hooks/rtk-rewrite.json for repo-scoped hook config - .github/copilot-instructions.md for RTK awareness - Test script: hooks/test-copilot-rtk-rewrite.sh Rebased on develop (includes Gemini rtk-ai#573, Codex rtk-ai#377, OpenClaw rtk-ai#358). Original work by @jeziellopes, cleaned up and rebased by maintainer. Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Patrick szymkowiak <[email protected]> * feat: add Cursor Agent support via --agent flag (rtk-ai#595) Add `rtk init -g --agent cursor` to install RTK hooks for Cursor Agent. Cursor's preToolUse hook supports command rewriting via updated_input, functionally identical to Claude Code's PreToolUse. Works with both the Cursor editor and cursor-cli (they share ~/.cursor/hooks.json). Changes: - New `--agent <name>` flag (claude|cursor) on `rtk init`, extensible for future agents. Default is claude (backward compatible). - Cursor hook script (hooks/cursor-rtk-rewrite.sh) outputs Cursor's JSON format: {permission, updated_input} vs Claude's hookSpecificOutput. - `rtk init --show` reports Cursor hook and hooks.json status. - `rtk init -g --uninstall` removes Cursor artifacts. - `rtk discover` notes that Cursor sessions are tracked via `rtk gain` (Cursor transcripts lack structured tool_use/tool_result blocks). - Unit tests for Cursor hooks.json patching, detection, and removal. Made-with: Cursor Signed-off-by: Patrick szymkowiak <[email protected]> Co-authored-by: Moisei <[email protected]> * feat: add Windsurf support via rtk init --agent windsurf (rtk-ai#695) (rtk-ai#697) Install RTK rules in .windsurfrules (project-scoped) so Cascade prefixes shell commands with rtk for token savings. Windsurf hooks don't support command rewriting (only blocking), so RTK uses the rules-based approach (like Codex with AGENTS.md). Tested: Windsurf Cascade correctly uses rtk git status after install. Signed-off-by: Patrick szymkowiak <[email protected]> * feat: add Cline/Roo Code support via rtk init --agent cline (rtk-ai#701) (rtk-ai#702) Install RTK rules in .clinerules (project-scoped) so Cline prefixes shell commands with rtk for token savings. Same rules-based approach as Windsurf and Codex. Signed-off-by: Patrick szymkowiak <[email protected]> * fix(skill/rtk-triage): increase PR/issue limit to 200 with pagination hint (rtk-ai#717) * fix(skill/rtk-triage): increase PR/issue limit to 200 with pagination hint Raise gh pr list limit from 60 to 200 to match gh's max per call. Add inline comment explaining how to paginate for repos with >200 open PRs. Update threshold warning from >60 to >200 PRs/issues. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> * docs(architecture): update module count to 67 (hook_cmd added in rtk-ai#573) hook_cmd.rs was added in feat: add Gemini CLI support (rtk-ai#573) but ARCHITECTURE.md was not updated. Fixes pre-push validation failure. Co-Authored-By: Claude Sonnet 4.6 <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> --------- Signed-off-by: Florian BRUNIAUX <[email protected]> Co-authored-by: Claude Sonnet 4.6 <[email protected]> --------- Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Patrick szymkowiak <[email protected]> Signed-off-by: Patrick Szymkowiak <[email protected]> Signed-off-by: Ousama Ben Younes <[email protected]> Signed-off-by: Zacaria <[email protected]> Signed-off-by: Florian BRUNIAUX <[email protected]> Co-authored-by: Alex <[email protected]> Co-authored-by: Ben Younes <[email protected]> Co-authored-by: Claude Opus 4.6 <[email protected]> Co-authored-by: Zacaria Chtatar <[email protected]> Co-authored-by: Jeziel Lopes <[email protected]> Co-authored-by: Moisei Rabinovich <[email protected]> Co-authored-by: Moisei <[email protected]> Co-authored-by: Florian BRUNIAUX <[email protected]>
5 tasks done
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.
Summary
Replaces #174 (too many conflicts after upstream restructuring). Clean implementation on latest
develop.rtk hook gemini: Native Rust hook processor for Gemini CLIBeforeToolhooks. Reads JSON from stdin, delegates torewrite_command()(single source of truth — no duplicate rewrite logic), outputs Gemini-format JSON response.rtk init -g --gemini: Installs hook wrapper (~/.gemini/hooks/rtk-hook-gemini.sh), GEMINI.md, and patches~/.gemini/settings.json.rtk init -g --gemini --uninstall: Clean removal of all Gemini artifacts.Key design decisions
rewrite_command()fromdiscover/registry.rsinstead of duplicating rewrite rules (unlike the old PR). One source of truth for all hook engines.exec rtk hook gemini) keeps the hook script minimal and testable — all logic is in Rust.--geminiis a new opt-in flag.Files changed
src/hook_cmd.rssrc/main.rs--geminiflag,Hooksubcommand routingsrc/init.rsrun_gemini(),patch_gemini_settings(),uninstall_gemini()README.mdTest plan
cargo fmt --all --check— OKcargo clippy --all-targets— 0 new warningscargo test— 905 passed, 3 ignoredhook_cmd.rscovering hook format, rewrite delegation, env prefix, exclusionsrtk init -g --geminion a machine with Gemini CLI installedgit statusis rewritten in Gemini CLI sessionCloses #174
🤖 Generated with Claude Code