rtk-ai/rtk

Support exclude_commands config for auto-rewrite hook

Open

#243 geöffnet am 21. Feb. 2026

Auf GitHub ansehen
 (2 Kommentare) (6 Reaktionen) (0 zugewiesene Personen)Rust (2.914 Forks)batch import
area:cliarea:configeffort-mediumenhancementhelp wantedpriority:medium

Repository-Metriken

Stars
 (48.085 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 11T 1h) (45 gemergte PRs in 30 T)

Beschreibung

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