rtk-ai/rtk

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

Open

#1,759 创建于 2026年5月7日

在 GitHub 查看
 (1 评论) (2 反应) (0 负责人)Rust (2,914 fork)batch import
area:clienhancementhelp wantedpriority:medium

仓库指标

Star
 (48,085 star)
PR 合并指标
 (平均合并 11天 1小时) (30 天内合并 45 个 PR)

描述

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.

贡献者指南