rtk-ai/rtk

rewrite: add fd (find) and sd (sed) to rewrite registry

オープン

#1,759 opened on 2026/05/07

 (1 件のコメント) (2 件のリアクション) (0 人の担当者)Rust (2,914 件のフォーク)batch import
area:clienhancementhelp wantedpriority:medium

Repository metrics

Stars
 (48,085 個のスター)
PR merge metrics
 (PR metrics pending)

説明

Summary

fd and sd are vastly superior alternatives to find and sed for AI agents:

  • Agents frequently write broken find commands (complex flag escaping, -not -path vs ! -path portability)
  • Agents frequently write broken sed commands (POSIX regex escaping, -i portability between GNU/BSD)
  • fd has simpler syntax, respects .gitignore by default, parallel traversal
  • sd uses standard regex (no POSIX escape hell), simpler syntax

Proposed rewrite rules

find . -name "*.ts"                          → fd -e ts
find . -name "*.ts" -not -path "*/node_modules/*"  → fd -e ts --exclude node_modules
sed -i "s/foo/bar/g" file.txt               → sd foo bar file.txt
sed "s/foo/bar/g" file.txt                  → sd foo bar file.txt

Notes

  • rtk find already exists as a compact-output wrapper for native find — this would be a separate rewrite rule (like how rtk git wraps git but rg rewrites grep)
  • Both tools are widely available: brew install fd sd / apt install fd-find sd
  • Guards needed: only rewrite when fd/sd are in PATH

Context

Discovered while setting up RTK across Claude Code, Codex, Gemini CLI, and opencode. The find and sed rewrite gap is the most common agent error class not currently covered by RTK.

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