rtk-ai/rtk

Registry gap: `wc` not auto-rewritten despite `rtk wc` existing

Open

#1,682 opened on 2026年5月3日

GitHub で見る
 (2 comments) (0 reactions) (0 assignees)Rust (2,914 forks)batch import
area:clibuggood first issueplatform:macospriority:low

Repository metrics

Stars
 (48,085 stars)
PR merge metrics
 (平均マージ 11d 1h) (30d で 45 merged PRs)

説明

Summary

rtk rewrite returns exit code 1 ("no RTK equivalent") for wc invocations, even though rtk wc is implemented and listed in rtk --help.

Reproduction

rtk 0.34.1, Apple Silicon:

$ rtk wc --help
Word/line/byte count with compact output (strips paths and padding)

$ rtk rewrite "wc -l file.txt"
$ echo $?
1

$ rtk rewrite "wc -lwc *.md"
$ echo $?
1

Compare to other built-ins, all of which auto-rewrite correctly:

$ rtk rewrite "ls -la"      ; echo $?  # → "rtk ls -la", EC=0
$ rtk rewrite "grep -r foo ."; echo $?  # → "rtk grep -r foo .", EC=0
$ rtk rewrite "tail -100 log"; echo $?  # → "rtk read log --tail-lines 100", EC=0

Why this matters

wc is a high-frequency read-only command (counting lines in logs, source files, output piping) and produces 100% replaceable output — rtk wc strips the path-padding noise that wastes tokens on every call.

Likely fix

Add the rewrite rule in src/discover/registry.rs alongside the existing ls/grep/find/tail entries. Should be EC=0 (auto-allow) per the precedent in #1232.

Marking as good first issue / effort-small.

コントリビューターガイド