Commit Graph

481 Commits

Author SHA1 Message Date
Patrick szymkowiak 7f670d4329 chore: bump version to 0.33.0
Sync manifest and Cargo.toml with released v0.33.0.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-25 08:59:23 +01:00
patrick szymkowiak edd9c02e89 Merge pull request #797 from rtk-ai/fix/strip-stderr-redirects
fix: strip trailing stderr redirects before rewrite matching (#530)
2026-03-24 16:01:50 +01:00
Patrick szymkowiak 36a6f48229 fix: strip trailing stderr redirects before rewrite matching (#530)
Commands like `git status 2>&1` or `cargo test 2>/dev/null` were not
rewritten because the redirect suffix prevented pattern matching.

Now strips redirects (2>&1, 2>/dev/null, etc.) before matching,
then re-appends them to the rewritten command.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-24 12:35:26 +01:00
patrick szymkowiak a051a6f5e5 Merge pull request #576 from rtk-ai/fix/hook-bypass-permission
fix(hook): respect Claude Code deny/ask permission rules on rewrite
2026-03-24 10:45:00 +01:00
patrick szymkowiak 976077c8a6 Merge pull request #790 from rtk-ai/feat/readme-agent-docs
docs: add all 9 AI tool integrations to README
2026-03-23 17:09:11 +01:00
Patrick szymkowiak e666d3ebd1 docs: add all 9 AI tool integrations to README
Document Copilot, Cursor, Codex, Windsurf, Cline, OpenClaw setup.
Unified table with install commands for each tool.
Updated Quick Start with all agent options.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-23 16:36:34 +01:00
patrick szymkowiak 0eecee5bf3 fix: add telemetry documentation and init notice (#640) (#788)
- Add "Privacy & Telemetry" section to README explaining what is
  collected, what is NOT, and how to opt-out
- Show telemetry notice during rtk init so users are informed

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-23 11:52:26 +01:00
patrick szymkowiak af56573ae2 fix: update Discord invite link (#711) (#786)
Replace expired invite links across all README translations.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-23 10:13:44 +01:00
aesoft c57624931a Merge pull request #773 from mvanhorn/osc/730-pr-diff-name-only-empty
fix(gh): skip compact_diff for --name-only/--stat in pr diff
2026-03-22 12:28:18 +01:00
aesoft 0bb3eaff02 Merge branch 'master' into develop 2026-03-22 11:20:53 +01:00
Matt Van Horn 2ef0690767 fix(gh): skip compact_diff for --name-only/--stat flags in pr diff
When `gh pr diff` is called with output-format-changing flags like
--name-only, --stat, --name-status, --numstat, or --shortstat, the
output is a plain filename/stat list rather than a unified diff.
compact_diff() expects diff headers and hunks, so it produces empty
output from these formats.

Skip filtering and passthrough directly when any of these flags are
present. The output is already compact and doesn't benefit from diff
compaction.

Fixes #730

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-03-21 19:12:50 -07:00
aesoft 4b52bfeaf2 Merge pull request #778 from rtk-ai/cicd-wrong-prerelease-tag
Cicd wrong prerelease tag
2026-03-22 00:37:28 +01:00
aesoft 3b94b602ed fix(cicd): explicit fetch tag 2026-03-22 00:30:37 +01:00
aesoft 15366678ad fix(cicd): pre-release correct tag
Was using develop ancestor -> wrong behavior because version happen on master branch
2026-03-22 00:29:53 +01:00
aesoft 75cd2232e2 Merge pull request #775 from mvanhorn/osc/720-issue-pr-view-comments-passthrough
fix(gh): passthrough --comments flag in issue/pr view
2026-03-22 00:08:15 +01:00
aesoft dc6b0260ab Merge pull request #729 from ousamabenyounes/fix/test-failure-error-message-truncation
fix(formatter): show full error message for test failures (#690)
2026-03-21 22:47:18 +01:00
Matt Van Horn fdeb09fb93 fix(gh): passthrough --comments flag in issue/pr view
Add --comments to the passthrough trigger list in should_passthrough_pr_view().
The --comments flag changes gh output to include comments, but the rtk
filter hardcodes a JSON field list without 'comments', silently
discarding all comment data. This misleads AI agents into concluding
issues have no responses.

Add should_passthrough_issue_view() for view_issue(), which previously
had no passthrough check at all. Both functions now passthrough on
--comments, --json, --jq, and --web.

Fixes #720

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-03-21 13:54:17 -07:00
aesoft dff0d5acb5 Merge pull request #768 from rtk-ai/license-to-apache-2-0
License to Apache 2.0
2026-03-21 19:33:29 +01:00
aesoft 8eefef1b49 Merge pull request #746 from danielmarbach/dotnet-test
fix(dotnet): TRX injection for Microsoft.Testing.Platform projects
2026-03-21 17:22:23 +01:00
aesoft 4b2179e587 Update CONTRIBUTING.md 2026-03-21 17:17:55 +01:00
aesoft da999c8364 Update ci.yml 2026-03-21 17:16:33 +01:00
aesoft 4a79e48ee5 Add files via upload 2026-03-21 17:12:49 +01:00
Ousama Ben Younes b4ccf046f5 fix(playwright): add tee_and_hint pass-through on failure (#690)
Add crate::tee::tee_and_hint call to playwright_cmd::run(), matching
the pattern used by all other test runners (vitest, pytest, cargo,
go, rspec, rake). When playwright fails, the full raw output is saved
to ~/.local/share/rtk/tee/ and a one-line hint is appended so the
LLM can read the complete output without re-running.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
2026-03-21 15:58:32 +00:00
Ousama Ben Younes f7b09fc86a fix(formatter): show full error message for test failures (#690)
format_compact() was truncating error messages to 2 lines via .take(2).
Playwright (and vitest, pytest, cargo test) errors contain the critical
expected/received diff and call log starting at line 3+, so agents saw
only the error type with no actionable debug information.

Fix: iterate all lines of error_message for each failure instead of
taking the first 2. Summary line stays compact; only the per-failure
detail is preserved in full.

Affects all test runners using TestResult (playwright, vitest, cargo,
pytest, dotnet) — any test failure is now fully visible.

Closes #690

Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
2026-03-21 15:51:55 +00:00
Daniel Marbach cadbb231af Fix trx injection for dotnet tests running with various Microsoft Testing Platfform modes
Signed-off-by: Daniel Marbach <danielmarbach@users.noreply.github.com>
2026-03-20 20:27:34 +01:00
aesoft 200af436d4 Merge pull request #736 from rtk-ai/fix/issue-668/pre-release-tag
fix(cicd): issue 668 - pre release tag
2026-03-20 17:01:52 +01:00
aesoft 95a4961e4a Merge pull request #722 from apowis/fix/golangci-lint-v2-compatibility
fix(golangci-lint): add v2 compatibility with runtime version detection
2026-03-20 16:41:44 +01:00
Adam Powis 6aa5e90dc4 fix(golangci): use resolved_command for version detection, move test fixture to file
Signed-off-by: Adam Powis <apowis@vulncheck.com>
2026-03-20 15:06:23 +00:00
Florian BRUNIAUX 466aa780c5 docs(changelog): add entries for hook permission fix and git status format
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-03-20 14:10:16 +01:00
Florian BRUNIAUX 49fac625f4 fix(permissions): support *:* and leading/middle wildcards
Bug 2 (Critical): *:* catch-all matched nothing. strip_suffix('*') left
"*:" which after trim became "*" (non-empty), so the branch returned
false instead of true. Fix: detect empty-or-star prefix after stripping.

Bug 3 (Medium): leading wildcards ("* --force"), middle wildcards
("git * main"), and multi-wildcard patterns ("git * --force *") fell
through to exact match, silently failing. Add glob_matches() with
character-level segment anchoring: first segment must be prefix, last
must be suffix, middle segments found via str::find in order.

Colon normalization in glob_matches(): "sudo:*" -> "sudo *" so both
fast path and glob path interpret colon syntax consistently.

New tests: test_star_colon_star_matches_everything,
test_leading_wildcard, test_leading_wildcard_no_partial,
test_middle_wildcard, test_middle_wildcard_no_match,
test_multiple_wildcards, test_deny_with_leading_wildcard,
test_deny_star_colon_star.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-03-20 14:09:29 +01:00
Florian BRUNIAUX e303fe1b63 fix(permissions): check deny rules before rewrite + flush stdout
Bug 1 (Critical): check_command() was called inside Some(rewritten),
so non-RTK commands (rm, kill, python3 -c) bypassed deny rules entirely.
Move verdict check before registry::rewrite_command() so all commands
are evaluated regardless of whether RTK has an equivalent.

Bug 4 (Medium): print!() before process::exit() could leave stdout
unflushed. Add explicit std::io::stdout().flush() after each print!().

Add Eq derive to PermissionVerdict (required for == comparison).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-03-20 14:09:29 +01:00
Florian BRUNIAUX a9c610a9af fix(hook): respect Claude Code deny/ask permission rules on rewrite
The PreToolUse hook was emitting `permissionDecision: "allow"` on every
rewritten command, bypassing deny and ask rules in .claude/settings.json.

- Add `src/permissions.rs`: loads Bash deny/ask rules from all 4 Claude
  Code settings files (project + global, settings.json + settings.local.json),
  checks commands (including compound && / || / | / ;) and returns
  Allow / Deny / Ask verdict. 16 unit tests.
- Modify `src/rewrite_cmd.rs`: after finding a rewrite, check the original
  command against permissions. Exit 0 = allow (auto-approve rewrite),
  exit 2 = deny (passthrough, let CC native deny handle it),
  exit 3 = ask (print rewrite but no permissionDecision, CC prompts user).
- Update both hook files to handle exit codes 2 and 3. Version bumped 2→3.
- Bump `CURRENT_HOOK_VERSION` 2→3 in `hook_check.rs` so users with the old
  hook get the upgrade prompt.
- Fix set -euo pipefail bug in .claude/hooks/rtk-rewrite.sh: capture exit
  code with `|| EXIT_CODE=$?` instead of bare assignment.

Fixes #260

Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-03-20 14:09:29 +01:00
aesoft 97b68783f5 Merge pull request #738 from youbamj/fix/cargo-test-compile-diagnostics
fix(cargo): preserve test compile diagnostics
2026-03-20 11:54:02 +01:00
aesoft ec92c43f23 Merge pull request #741 from Maimer/pim_fix_rake_multiple_test_files
fix(ruby): use rails test for positional file args in rtk rake
2026-03-20 11:25:07 +01:00
aesoft 865749438e fix(cicd): missing doc
Signed-off-by: aesoft <43991222+aeppling@users.noreply.github.com>
2026-03-20 08:29:58 +01:00
aesoft 53bc81e9e6 fix(cicd): gete release like tag for pre-release
added script to act like release please (release please flag was unclear)
added workflow dispatch event + dev like for prelease debug
guards for workflow_dispatch (limit to push master for release events)

Signed-off-by: aesoft <43991222+aeppling@users.noreply.github.com>
2026-03-20 08:26:58 +01:00
Nicholas Lee 138e91411b fix(ruby): use rails test for positional file args in rtk rake
rake test ignores positional file arguments and only supports TEST=path
for single-file runs. When users pass positional test files (e.g.,
`rtk rake test file1.rb file2.rb` or `rtk rake test file.rb:15`),
select_runner() now switches to `rails test` which handles single files,
multiple files, and line-number syntax natively.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Nicholas Lee <nicholas.lee@appfolio.com>
2026-03-19 16:50:29 -07:00
YoubAmj 15d5beb9f7 fix: preserve cargo test compile diagnostics
Signed-off-by: YoubAmj <11021965+youbamj@users.noreply.github.com>
2026-03-19 22:55:52 +00:00
patrick szymkowiak 4edc3fc083 fix: increase signal in git diff, git log, and json filters (#621) (#708)
- git diff: raise max_hunk_lines from 30 to 100 (LLMs need full hunks)
- git log: show 3 body lines instead of 1 (preserves BREAKING CHANGE, migration notes)
- json: show values by default (LLMs need values for config debugging), add --schema for types-only

Tested with phi4:14b on local LLM — all 3 fixes improve comprehension.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-19 15:15:35 +01:00
Navid EMAD 15bc0f8d6e feat(ruby): add Ruby on Rails support (rspec, rubocop, rake, bundle) (#724)
* feat(ruby): add Ruby on Rails support (rspec, rubocop, rake, bundle)

Unifies 5 competing PRs (#198, #292, #379, #534, #643) into a single
coherent implementation.

New commands:
- rtk rspec: JSON parsing with text fallback (60%+ savings)
- rtk rubocop: JSON parsing, group by cop/severity (60%+ savings)
- rtk rake test: Minitest state machine parser (85-90% savings)
- rtk bundle install: TOML filter, strip Using lines (90%+ savings)

Shared infrastructure: ruby_exec(), fallback_tail(),
exit_code_from_output(), count_tokens() in utils.rs.

Discover/rewrite rules for rspec, rubocop, rake, rails, bundle
including bundle exec and bin/ variants.

E2E smoke tests (scripts/test-ruby.sh) covering all 4 commands.
56 new unit tests + 4 inline TOML tests. All 1035 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Navid EMAD <navid.emad@yespark.fr>

* fix(ruby): use TEST= env var for rake single-file test in smoke tests

Rails' `rake test` ignores positional file args; use `TEST=path` syntax.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Navid EMAD <navid.emad@yespark.fr>

* docs(ruby): add Ruby module architecture and update attribution

Integrate ARCHITECTURE.md Ruby Module Architecture section and CLAUDE.md
module table/fork-features from PR #643. Update PR description attribution.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Navid EMAD <navid.emad@yespark.fr>

* chore: remove PULL_REQUEST_DESCRIPTION.md from repo

PR description lives on GitHub, no need to track in the codebase.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Navid EMAD <navid.emad@yespark.fr>

---------

Signed-off-by: Navid EMAD <navid.emad@yespark.fr>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 15:04:59 +01:00
github-actions[bot] c85e348a91 chore(master): release 0.31.0 (#719)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
v0.30.1-rc.43 v0.31.0
2026-03-19 12:14:19 +01:00
Adam Powis 3480ce5e4e fix(golangci-lint): add v2 compatibility with runtime version detection
golangci-lint v2 removed --out-format=json in favour of --output.json.path stdout.
Detect the installed major version at runtime via golangci-lint --version and branch
on the correct flag and JSON extraction strategy.

- Use --output.json.path stdout for v2, --out-format=json for v1
- Extract JSON from first line only on v2 (v2 appends trailing metadata after JSON line)
- Deserialise new v2 fields: SourceLines, Severity, Offset (serde default for v1 compat)
- Show first source line per linter-file group on v2 for richer context
- Always forward stderr to caller (was silently dropped unless --verbose)
- Falls back to v1 behaviour on any version detection failure

Signed-off-by: Adam Powis <a.powis.91@gmail.com>
2026-03-19 10:53:25 +00:00
patrick szymkowiak 737dada4a5 feat: 9-tool AI agent support + emoji removal (#704)
* 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 <patrick@rtk.ai>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* 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 <patrick.szymkowiak@innovtech.eu>

* 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 <patrick@rtk-ai.app>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* fix: remove last decorative emoji from next_cmd.rs

Remove ⚡ from Next.js Build header, missed in previous passes.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* 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 <patrick.szymkowiak@innovtech.eu>

* 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 <patrick.szymkowiak@innovtech.eu>

---------

Signed-off-by: Patrick Szymkowiak <patrick@rtk.ai>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Signed-off-by: Patrick Szymkowiak <patrick@rtk-ai.app>

* 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 <patrick.szymkowiak@innovtech.eu>

* feat: add package.json for npm publishing

Enables `openclaw plugins install @rtk-ai/rtk-rewrite` for OpenClaw users.

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

---------

Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Co-authored-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* 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 <benyounes.ousama@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* 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 <havesomecode@gmail.com>

* docs: fix validation metadata

Signed-off-by: Zacaria <havesomecode@gmail.com>

---------

Signed-off-by: Zacaria <havesomecode@gmail.com>

* 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 <patrick.szymkowiak@innovtech.eu>
Co-authored-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>

* 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 <patrick.szymkowiak@innovtech.eu>
Co-authored-by: Moisei <1199723+moisei@users.noreply.github.com>

* 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 <patrick.szymkowiak@innovtech.eu>

* 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 <patrick.szymkowiak@innovtech.eu>

* 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 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>

* 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 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>

---------

Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Signed-off-by: Patrick Szymkowiak <patrick@rtk.ai>
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
Signed-off-by: Patrick Szymkowiak <patrick@rtk-ai.app>
Signed-off-by: Ousama Ben Younes <benyounes.ousama@gmail.com>
Signed-off-by: Zacaria <havesomecode@gmail.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
Co-authored-by: Alex <a.neyman17@gmail.com>
Co-authored-by: Ben Younes <benyounes.ousama@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Zacaria Chtatar <Zacaria@users.noreply.github.com>
Co-authored-by: Jeziel Lopes <jeziellcarvalho@gmail.com>
Co-authored-by: Moisei Rabinovich <moisei@users.noreply.github.com>
Co-authored-by: Moisei <1199723+moisei@users.noreply.github.com>
Co-authored-by: Florian BRUNIAUX <florian@bruniaux.com>
2026-03-19 11:33:45 +01:00
Florian BRUNIAUX 5e1fc20cb0 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 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>

* 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 <noreply@anthropic.com>
Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>

---------

Signed-off-by: Florian BRUNIAUX <florian@bruniaux.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-19 10:11:36 +01:00
Patrick szymkowiak 4020aa039a chore: merge master into develop (resolve emoji conflicts in Cursor show_config)
Signed-off-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-18 19:02:19 +01:00
patrick szymkowiak d921cc4fa0 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 <patrick.szymkowiak@innovtech.eu>
2026-03-18 18:58:43 +01:00
patrick szymkowiak 86d50698c1 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 <patrick.szymkowiak@innovtech.eu>
2026-03-18 18:34:56 +01:00
Moisei Rabinovich c3917e4de2 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 <patrick.szymkowiak@innovtech.eu>
Co-authored-by: Moisei <1199723+moisei@users.noreply.github.com>
2026-03-18 16:39:03 +01:00
Jeziel Lopes 0800bbecef 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 <patrick.szymkowiak@innovtech.eu>
Co-authored-by: Patrick szymkowiak <patrick.szymkowiak@innovtech.eu>
2026-03-18 16:21:07 +01:00
Zacaria Chtatar 7d04b485a7 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 <havesomecode@gmail.com>

* docs: fix validation metadata

Signed-off-by: Zacaria <havesomecode@gmail.com>

---------

Signed-off-by: Zacaria <havesomecode@gmail.com>
2026-03-18 15:54:53 +01:00