rtk-ai/rtk

Support exclude_commands config for auto-rewrite hook

Open

#243 opened on Feb 21, 2026

View on GitHub
 (2 comments) (6 reactions) (0 assignees)Rust (2,914 forks)batch import
area:cliarea:configeffort-mediumenhancementhelp wantedpriority:medium

Repository metrics

Stars
 (48,085 stars)
PR merge metrics
 (Avg merge 11d 1h) (45 merged PRs in 30d)

Description

Problem

The auto-rewrite hook (rtk-rewrite.sh) rewrites all supported commands unconditionally. There's no way to exclude specific commands from being rewritten without manually editing the hook script — which gets overwritten on the next rtk init -g.

Proposal

Add an exclude_commands option to config.toml that the hook script reads at runtime:

[hooks]
exclude_commands = ["playwright", "curl"]

The hook script would check this list before rewriting and skip excluded commands.

Alternative approaches

  • Environment variable: RTK_EXCLUDE="playwright,curl" — simpler but less discoverable
  • Per-command disable in config: [commands.playwright] enabled = false
  • Hook flag: rtk init -g --exclude playwright that generates the hook without those patterns

Any of these would work. The key requirement is that the exclusion survives rtk init -g re-runs.

Contributor guide