rtk-ai/rtk

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

Open

#1.344 aberto em 16 de abr. de 2026

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)Rust (2.914 forks)batch import
area:configeffort-smallenhancementgood first issuehelp wantedpriority:medium

Métricas do repositório

Stars
 (48.085 stars)
Métricas de merge de PR
 (Mesclagem média 11d 1h) (45 fundiu PRs em 30d)

Description

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

Guia do colaborador