rtk-ai/rtk

Config key to auto-allow specific ask-level commands ([hooks] allow_ask_commands)

Open

#1344 aperta il 16 apr 2026

Vedi su GitHub
 (1 commento) (0 reazioni) (0 assegnatari)Rust (2914 fork)batch import
area:configeffort-smallenhancementgood first issuehelp wantedpriority:medium

Metriche repository

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

Descrizione

Summary

Some registry entries (e.g. jest, vitest) return exit code 3 from rtk rewrite, surfacing a permission prompt on every invocation. Users in long agentic sessions (Claude Code, Cursor) get prompted repeatedly for commands they have already decided to trust. The ask/auto-allow decision is currently hardcoded in src/discover/rules.rs — there is no config escape hatch.

The existing [hooks] exclude_commands does the opposite (skip rewrite entirely). Missing: an allowlist for ask-level rules.

Proposed shape

[hooks]
allow_ask_commands = ["jest", "vitest"]

When the rewrite lookup lands on an ask-level rule, check if the command name is in this list and emit permissionDecision: "allow" if so.

Why config vs. per-command PR

Trust levels vary. Putting ask → auto-allow in user config lets individuals opt in without forking or pushing per-command changes upstream. Also scales to future additions without repo churn.

Environment

  • rtk v0.36.0 (Homebrew, macOS)
  • Consumer: Claude Code PreToolUse(Bash) hook installed via rtk init -g

Guida contributor