rtk 自动代理命令清单
**说明:**以下基于 `rtk-ai/rtk` 当前 `develop` 分支的 rewrite 规则整理。这里的“代理”指 Agent hook 会把原始 shell 命令自动改写为对应的 `rtk xxx` 命令,再由 rtk 代理执行并压缩输出。一、Git / 代码托管
| 命令族 | 会被代理的子命令 | 改写目标 |
|---|---|---|
git / yadm | status、log、diff、show、add、commit、push、pull、branch、fetch、stash、worktree | rtk git |
gh | pr、issue、run、repo、api、release | rtk gh |
glab | mr、issue、ci、pipeline、api、release | rtk glab |
gt | Graphite 相关命令 | rtk gt |
二、文件 / 搜索
ls→rtk lstree→rtk treecat、head、tail→rtk readgrep、rg→rtk grepfind→rtk finddiff→rtk diffwc→rtk wc
三、JS / TS / 前端
| 原始命令 | 范围 | 改写目标 |
|---|---|---|
pnpm | exec、i、install、list、ls、outdated、run、run-script | rtk pnpm |
npm | exec、run、run-script、x,以及容错拼写 rum、urn | rtk npm |
npx | 所有 npx ... 入口 | rtk npx |
tsc | 直接执行或经 npm / pnpm / npx 前缀执行 | rtk tsc |
eslint / biome / lint | 直接执行或经包管理器前缀执行 | rtk lint |
prettier | 直接执行或经包管理器前缀执行 | rtk prettier |
next build | 直接执行或经包管理器前缀执行 | rtk next |
jest | 直接执行或经包管理器前缀执行 | rtk jest |
vitest | 直接执行或经包管理器前缀执行 | rtk vitest |
playwright | 直接执行或经包管理器前缀执行 | rtk playwright |
prisma | 直接执行或经包管理器前缀执行 | rtk prisma |
bash
pnpm run lint # -> rtk lint
npx tsc --noEmit # -> rtk tsc --noEmit
pnpm exec playwright test # -> rtk playwright test
四、语言生态
### Rust - `cargo build` - `cargo test` - `cargo clippy` - `cargo check` - `cargo fmt`,标记为 passthrough - `cargo install` ### Python - `pytest`、`python -m pytest`、`python3 -m pytest` - `ruff check`、`ruff format` - `mypy`、`python -m mypy`、`python3 -m mypy` - `pip` / `pip3` / `uv pip` 的 `list`、`outdated`、`install`、`show` - `uv sync`、`uv pip install` - `poetry install`、`poetry lock`、`poetry update` ### Go - `go test` - `go build` - `go vet` - `golangci-lint run`、`golangci run` ### Ruby - `bundle install`、`bundle update` - `rake test`、`rails test` - `bundle exec rake test`、`bundle exec rails test` - `rspec`、`bundle exec rspec` - `rubocop`、`bundle exec rubocop`五、.NET / JVM / 移动
dotnet buildgradle、gradlew、./gradlew的test、build、clean、assemble*、install*、check、lint*、dependenciesmvn/mvnw的compile、test、integration-test、package、install、verify、deployswift build、swift test
六、Infra / Cloud / 容器
| 命令族 | 会被代理的范围 |
|---|---|
docker | ps、images、logs、run、exec、build、compose ps、compose logs、compose build |
kubectl | get、logs、describe、apply |
oc | get、logs、describe、apply、status、adm |
aws | 所有 aws ... 入口 |
| 其他 | psql、gcloud、helm、terraform plan、tofu fmt/init/plan/validate、systemctl status、fail2ban-client、iptables、sops、liquibase |
七、网络 / 下载 / 其他构建工具
- 网络与下载:
curl、wget、ping、rsync - 构建与 lint:
make、pre-commit、shellcheck、hadolint、markdownlint、yamllint - 包管理:
composer install/update/require、brew install/upgrade - 其他:
mix compile/format、pio run、quarto render、trunk build、shopify theme push/pull、ansible-playbook