rtk-ai/rtk

Support exclude_commands config for auto-rewrite hook

Open

#243 aperta il 21 feb 2026

Vedi su GitHub
 (2 commenti) (6 reazioni) (0 assegnatari)Rust (2914 fork)batch import
area:cliarea:configeffort-mediumenhancementhelp wantedpriority:medium

Metriche repository

Star
 (48.085 star)
Metriche merge PR
 (Merge medio 11g 1h) (45 PR mergiate in 30 g)

Descrizione

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.

Guida contributor