@hasna/terminal 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/dist/cli.js +64 -16
  2. package/package.json +1 -1
  3. package/src/ai.ts +8 -0
  4. package/src/cli.tsx +57 -18
  5. package/src/output-processor.ts +6 -1
  6. package/src/output-store.ts +58 -12
  7. package/src/tool-profiles.ts +139 -0
  8. package/temp/rtk/.claude/agents/code-reviewer.md +0 -221
  9. package/temp/rtk/.claude/agents/debugger.md +0 -519
  10. package/temp/rtk/.claude/agents/rtk-testing-specialist.md +0 -461
  11. package/temp/rtk/.claude/agents/rust-rtk.md +0 -511
  12. package/temp/rtk/.claude/agents/technical-writer.md +0 -355
  13. package/temp/rtk/.claude/commands/diagnose.md +0 -352
  14. package/temp/rtk/.claude/commands/test-routing.md +0 -362
  15. package/temp/rtk/.claude/hooks/bash/pre-commit-format.sh +0 -16
  16. package/temp/rtk/.claude/hooks/rtk-rewrite.sh +0 -70
  17. package/temp/rtk/.claude/hooks/rtk-suggest.sh +0 -152
  18. package/temp/rtk/.claude/rules/cli-testing.md +0 -526
  19. package/temp/rtk/.claude/skills/issue-triage/SKILL.md +0 -348
  20. package/temp/rtk/.claude/skills/issue-triage/templates/issue-comment.md +0 -134
  21. package/temp/rtk/.claude/skills/performance.md +0 -435
  22. package/temp/rtk/.claude/skills/pr-triage/SKILL.md +0 -315
  23. package/temp/rtk/.claude/skills/pr-triage/templates/review-comment.md +0 -71
  24. package/temp/rtk/.claude/skills/repo-recap.md +0 -206
  25. package/temp/rtk/.claude/skills/rtk-tdd/SKILL.md +0 -78
  26. package/temp/rtk/.claude/skills/rtk-tdd/references/testing-patterns.md +0 -124
  27. package/temp/rtk/.claude/skills/security-guardian.md +0 -503
  28. package/temp/rtk/.claude/skills/ship.md +0 -404
  29. package/temp/rtk/.github/workflows/benchmark.yml +0 -34
  30. package/temp/rtk/.github/workflows/dco-check.yaml +0 -12
  31. package/temp/rtk/.github/workflows/release-please.yml +0 -51
  32. package/temp/rtk/.github/workflows/release.yml +0 -343
  33. package/temp/rtk/.github/workflows/security-check.yml +0 -135
  34. package/temp/rtk/.github/workflows/validate-docs.yml +0 -78
  35. package/temp/rtk/.release-please-manifest.json +0 -3
  36. package/temp/rtk/ARCHITECTURE.md +0 -1491
  37. package/temp/rtk/CHANGELOG.md +0 -640
  38. package/temp/rtk/CLAUDE.md +0 -605
  39. package/temp/rtk/CONTRIBUTING.md +0 -199
  40. package/temp/rtk/Cargo.lock +0 -1668
  41. package/temp/rtk/Cargo.toml +0 -64
  42. package/temp/rtk/Formula/rtk.rb +0 -43
  43. package/temp/rtk/INSTALL.md +0 -390
  44. package/temp/rtk/LICENSE +0 -21
  45. package/temp/rtk/README.md +0 -386
  46. package/temp/rtk/README_es.md +0 -159
  47. package/temp/rtk/README_fr.md +0 -197
  48. package/temp/rtk/README_ja.md +0 -159
  49. package/temp/rtk/README_ko.md +0 -159
  50. package/temp/rtk/README_zh.md +0 -167
  51. package/temp/rtk/ROADMAP.md +0 -15
  52. package/temp/rtk/SECURITY.md +0 -217
  53. package/temp/rtk/TEST_EXEC_TIME.md +0 -102
  54. package/temp/rtk/build.rs +0 -57
  55. package/temp/rtk/docs/AUDIT_GUIDE.md +0 -432
  56. package/temp/rtk/docs/FEATURES.md +0 -1410
  57. package/temp/rtk/docs/TROUBLESHOOTING.md +0 -309
  58. package/temp/rtk/docs/filter-workflow.md +0 -102
  59. package/temp/rtk/docs/images/gain-dashboard.jpg +0 -0
  60. package/temp/rtk/docs/tracking.md +0 -583
  61. package/temp/rtk/hooks/opencode-rtk.ts +0 -39
  62. package/temp/rtk/hooks/rtk-awareness.md +0 -29
  63. package/temp/rtk/hooks/rtk-rewrite.sh +0 -61
  64. package/temp/rtk/hooks/test-rtk-rewrite.sh +0 -442
  65. package/temp/rtk/install.sh +0 -124
  66. package/temp/rtk/release-please-config.json +0 -10
  67. package/temp/rtk/scripts/benchmark.sh +0 -592
  68. package/temp/rtk/scripts/check-installation.sh +0 -162
  69. package/temp/rtk/scripts/install-local.sh +0 -37
  70. package/temp/rtk/scripts/rtk-economics.sh +0 -137
  71. package/temp/rtk/scripts/test-all.sh +0 -561
  72. package/temp/rtk/scripts/test-aristote.sh +0 -227
  73. package/temp/rtk/scripts/test-tracking.sh +0 -79
  74. package/temp/rtk/scripts/update-readme-metrics.sh +0 -32
  75. package/temp/rtk/scripts/validate-docs.sh +0 -73
  76. package/temp/rtk/src/aws_cmd.rs +0 -880
  77. package/temp/rtk/src/binlog.rs +0 -1645
  78. package/temp/rtk/src/cargo_cmd.rs +0 -1727
  79. package/temp/rtk/src/cc_economics.rs +0 -1157
  80. package/temp/rtk/src/ccusage.rs +0 -340
  81. package/temp/rtk/src/config.rs +0 -187
  82. package/temp/rtk/src/container.rs +0 -855
  83. package/temp/rtk/src/curl_cmd.rs +0 -134
  84. package/temp/rtk/src/deps.rs +0 -268
  85. package/temp/rtk/src/diff_cmd.rs +0 -367
  86. package/temp/rtk/src/discover/mod.rs +0 -274
  87. package/temp/rtk/src/discover/provider.rs +0 -388
  88. package/temp/rtk/src/discover/registry.rs +0 -2022
  89. package/temp/rtk/src/discover/report.rs +0 -202
  90. package/temp/rtk/src/discover/rules.rs +0 -667
  91. package/temp/rtk/src/display_helpers.rs +0 -402
  92. package/temp/rtk/src/dotnet_cmd.rs +0 -1771
  93. package/temp/rtk/src/dotnet_format_report.rs +0 -133
  94. package/temp/rtk/src/dotnet_trx.rs +0 -593
  95. package/temp/rtk/src/env_cmd.rs +0 -204
  96. package/temp/rtk/src/filter.rs +0 -462
  97. package/temp/rtk/src/filters/README.md +0 -52
  98. package/temp/rtk/src/filters/ansible-playbook.toml +0 -34
  99. package/temp/rtk/src/filters/basedpyright.toml +0 -47
  100. package/temp/rtk/src/filters/biome.toml +0 -45
  101. package/temp/rtk/src/filters/brew-install.toml +0 -37
  102. package/temp/rtk/src/filters/composer-install.toml +0 -40
  103. package/temp/rtk/src/filters/df.toml +0 -16
  104. package/temp/rtk/src/filters/dotnet-build.toml +0 -64
  105. package/temp/rtk/src/filters/du.toml +0 -16
  106. package/temp/rtk/src/filters/fail2ban-client.toml +0 -15
  107. package/temp/rtk/src/filters/gcc.toml +0 -49
  108. package/temp/rtk/src/filters/gcloud.toml +0 -22
  109. package/temp/rtk/src/filters/hadolint.toml +0 -24
  110. package/temp/rtk/src/filters/helm.toml +0 -29
  111. package/temp/rtk/src/filters/iptables.toml +0 -27
  112. package/temp/rtk/src/filters/jj.toml +0 -28
  113. package/temp/rtk/src/filters/jq.toml +0 -24
  114. package/temp/rtk/src/filters/make.toml +0 -41
  115. package/temp/rtk/src/filters/markdownlint.toml +0 -24
  116. package/temp/rtk/src/filters/mix-compile.toml +0 -27
  117. package/temp/rtk/src/filters/mix-format.toml +0 -15
  118. package/temp/rtk/src/filters/mvn-build.toml +0 -44
  119. package/temp/rtk/src/filters/oxlint.toml +0 -43
  120. package/temp/rtk/src/filters/ping.toml +0 -63
  121. package/temp/rtk/src/filters/pio-run.toml +0 -40
  122. package/temp/rtk/src/filters/poetry-install.toml +0 -50
  123. package/temp/rtk/src/filters/pre-commit.toml +0 -35
  124. package/temp/rtk/src/filters/ps.toml +0 -16
  125. package/temp/rtk/src/filters/quarto-render.toml +0 -41
  126. package/temp/rtk/src/filters/rsync.toml +0 -48
  127. package/temp/rtk/src/filters/shellcheck.toml +0 -27
  128. package/temp/rtk/src/filters/shopify-theme.toml +0 -29
  129. package/temp/rtk/src/filters/skopeo.toml +0 -45
  130. package/temp/rtk/src/filters/sops.toml +0 -16
  131. package/temp/rtk/src/filters/ssh.toml +0 -44
  132. package/temp/rtk/src/filters/stat.toml +0 -34
  133. package/temp/rtk/src/filters/swift-build.toml +0 -41
  134. package/temp/rtk/src/filters/systemctl-status.toml +0 -33
  135. package/temp/rtk/src/filters/terraform-plan.toml +0 -35
  136. package/temp/rtk/src/filters/tofu-fmt.toml +0 -16
  137. package/temp/rtk/src/filters/tofu-init.toml +0 -38
  138. package/temp/rtk/src/filters/tofu-plan.toml +0 -35
  139. package/temp/rtk/src/filters/tofu-validate.toml +0 -17
  140. package/temp/rtk/src/filters/trunk-build.toml +0 -39
  141. package/temp/rtk/src/filters/ty.toml +0 -50
  142. package/temp/rtk/src/filters/uv-sync.toml +0 -37
  143. package/temp/rtk/src/filters/xcodebuild.toml +0 -99
  144. package/temp/rtk/src/filters/yamllint.toml +0 -25
  145. package/temp/rtk/src/find_cmd.rs +0 -598
  146. package/temp/rtk/src/format_cmd.rs +0 -386
  147. package/temp/rtk/src/gain.rs +0 -723
  148. package/temp/rtk/src/gh_cmd.rs +0 -1651
  149. package/temp/rtk/src/git.rs +0 -2012
  150. package/temp/rtk/src/go_cmd.rs +0 -592
  151. package/temp/rtk/src/golangci_cmd.rs +0 -254
  152. package/temp/rtk/src/grep_cmd.rs +0 -288
  153. package/temp/rtk/src/gt_cmd.rs +0 -810
  154. package/temp/rtk/src/hook_audit_cmd.rs +0 -283
  155. package/temp/rtk/src/hook_check.rs +0 -171
  156. package/temp/rtk/src/init.rs +0 -1859
  157. package/temp/rtk/src/integrity.rs +0 -537
  158. package/temp/rtk/src/json_cmd.rs +0 -231
  159. package/temp/rtk/src/learn/detector.rs +0 -628
  160. package/temp/rtk/src/learn/mod.rs +0 -119
  161. package/temp/rtk/src/learn/report.rs +0 -184
  162. package/temp/rtk/src/lint_cmd.rs +0 -694
  163. package/temp/rtk/src/local_llm.rs +0 -316
  164. package/temp/rtk/src/log_cmd.rs +0 -248
  165. package/temp/rtk/src/ls.rs +0 -324
  166. package/temp/rtk/src/main.rs +0 -2482
  167. package/temp/rtk/src/mypy_cmd.rs +0 -389
  168. package/temp/rtk/src/next_cmd.rs +0 -241
  169. package/temp/rtk/src/npm_cmd.rs +0 -236
  170. package/temp/rtk/src/parser/README.md +0 -267
  171. package/temp/rtk/src/parser/error.rs +0 -46
  172. package/temp/rtk/src/parser/formatter.rs +0 -336
  173. package/temp/rtk/src/parser/mod.rs +0 -311
  174. package/temp/rtk/src/parser/types.rs +0 -119
  175. package/temp/rtk/src/pip_cmd.rs +0 -302
  176. package/temp/rtk/src/playwright_cmd.rs +0 -479
  177. package/temp/rtk/src/pnpm_cmd.rs +0 -573
  178. package/temp/rtk/src/prettier_cmd.rs +0 -221
  179. package/temp/rtk/src/prisma_cmd.rs +0 -482
  180. package/temp/rtk/src/psql_cmd.rs +0 -382
  181. package/temp/rtk/src/pytest_cmd.rs +0 -384
  182. package/temp/rtk/src/read.rs +0 -217
  183. package/temp/rtk/src/rewrite_cmd.rs +0 -50
  184. package/temp/rtk/src/ruff_cmd.rs +0 -402
  185. package/temp/rtk/src/runner.rs +0 -271
  186. package/temp/rtk/src/summary.rs +0 -297
  187. package/temp/rtk/src/tee.rs +0 -405
  188. package/temp/rtk/src/telemetry.rs +0 -248
  189. package/temp/rtk/src/toml_filter.rs +0 -1655
  190. package/temp/rtk/src/tracking.rs +0 -1416
  191. package/temp/rtk/src/tree.rs +0 -209
  192. package/temp/rtk/src/tsc_cmd.rs +0 -259
  193. package/temp/rtk/src/utils.rs +0 -432
  194. package/temp/rtk/src/verify_cmd.rs +0 -47
  195. package/temp/rtk/src/vitest_cmd.rs +0 -385
  196. package/temp/rtk/src/wc_cmd.rs +0 -401
  197. package/temp/rtk/src/wget_cmd.rs +0 -260
  198. package/temp/rtk/tests/fixtures/dotnet/build_failed.txt +0 -11
  199. package/temp/rtk/tests/fixtures/dotnet/format_changes.json +0 -31
  200. package/temp/rtk/tests/fixtures/dotnet/format_empty.json +0 -1
  201. package/temp/rtk/tests/fixtures/dotnet/format_success.json +0 -12
  202. package/temp/rtk/tests/fixtures/dotnet/test_failed.txt +0 -18
@@ -1,667 +0,0 @@
1
- use super::report::RtkStatus;
2
-
3
- /// A rule mapping a shell command pattern to its RTK equivalent.
4
- pub struct RtkRule {
5
- pub rtk_cmd: &'static str,
6
- /// Original command prefixes to replace with rtk_cmd (longest first for correct matching).
7
- pub rewrite_prefixes: &'static [&'static str],
8
- pub category: &'static str,
9
- pub savings_pct: f64,
10
- pub subcmd_savings: &'static [(&'static str, f64)],
11
- pub subcmd_status: &'static [(&'static str, RtkStatus)],
12
- }
13
-
14
- // Patterns ordered to match RULES indices exactly.
15
- pub const PATTERNS: &[&str] = &[
16
- r"^git\s+(status|log|diff|show|add|commit|push|pull|branch|fetch|stash|worktree)",
17
- r"^gh\s+(pr|issue|run|repo|api|release)",
18
- r"^cargo\s+(build|test|clippy|check|fmt|install)",
19
- r"^pnpm\s+(list|ls|outdated|install)",
20
- r"^npm\s+(run|exec)",
21
- r"^npx\s+",
22
- r"^(cat|head|tail)\s+",
23
- r"^(rg|grep)\s+",
24
- r"^ls(\s|$)",
25
- r"^find\s+",
26
- r"^(npx\s+|pnpm\s+)?tsc(\s|$)",
27
- r"^(npx\s+|pnpm\s+)?(eslint|biome|lint)(\s|$)",
28
- r"^(npx\s+|pnpm\s+)?prettier",
29
- r"^(npx\s+|pnpm\s+)?next\s+build",
30
- r"^(pnpm\s+|npx\s+)?(vitest|jest|test)(\s|$)",
31
- r"^(npx\s+|pnpm\s+)?playwright",
32
- r"^(npx\s+|pnpm\s+)?prisma",
33
- r"^docker\s+(ps|images|logs|run|exec|build|compose\s+(ps|logs|build))",
34
- r"^kubectl\s+(get|logs|describe|apply)",
35
- r"^tree(\s|$)",
36
- r"^diff\s+",
37
- r"^curl\s+",
38
- r"^wget\s+",
39
- r"^(python3?\s+-m\s+)?mypy(\s|$)",
40
- // Python tooling
41
- r"^ruff\s+(check|format)",
42
- r"^(python\s+-m\s+)?pytest(\s|$)",
43
- r"^(pip3?|uv\s+pip)\s+(list|outdated|install)",
44
- // Go tooling
45
- r"^go\s+(test|build|vet)",
46
- r"^golangci-lint(\s|$)",
47
- // AWS CLI
48
- r"^aws\s+",
49
- // PostgreSQL
50
- r"^psql(\s|$)",
51
- // TOML-filtered commands
52
- r"^ansible-playbook\b",
53
- r"^brew\s+(install|upgrade)\b",
54
- r"^composer\s+(install|update|require)\b",
55
- r"^df(\s|$)",
56
- r"^dotnet\s+build\b",
57
- r"^du\b",
58
- r"^fail2ban-client\b",
59
- r"^gcloud\b",
60
- r"^hadolint\b",
61
- r"^helm\b",
62
- r"^iptables\b",
63
- r"^make\b",
64
- r"^markdownlint\b",
65
- r"^mix\s+(compile|format)(\s|$)",
66
- r"^mvn\s+(compile|package|clean|install)\b",
67
- r"^ping\b",
68
- r"^pio\s+run",
69
- r"^poetry\s+(install|lock|update)\b",
70
- r"^pre-commit\b",
71
- r"^ps(\s|$)",
72
- r"^quarto\s+render",
73
- r"^rsync\b",
74
- r"^shellcheck\b",
75
- r"^shopify\s+theme\s+(push|pull)",
76
- r"^sops\b",
77
- r"^swift\s+build\b",
78
- r"^systemctl\s+status\b",
79
- r"^terraform\s+plan",
80
- r"^tofu\s+(fmt|init|plan|validate)(\s|$)",
81
- r"^trunk\s+build",
82
- r"^uv\s+(sync|pip\s+install)\b",
83
- r"^yamllint\b",
84
- ];
85
-
86
- pub const RULES: &[RtkRule] = &[
87
- RtkRule {
88
- rtk_cmd: "rtk git",
89
- rewrite_prefixes: &["git"],
90
- category: "Git",
91
- savings_pct: 70.0,
92
- subcmd_savings: &[
93
- ("diff", 80.0),
94
- ("show", 80.0),
95
- ("add", 59.0),
96
- ("commit", 59.0),
97
- ],
98
- subcmd_status: &[],
99
- },
100
- RtkRule {
101
- rtk_cmd: "rtk gh",
102
- rewrite_prefixes: &["gh"],
103
- category: "GitHub",
104
- savings_pct: 82.0,
105
- subcmd_savings: &[("pr", 87.0), ("run", 82.0), ("issue", 80.0)],
106
- subcmd_status: &[],
107
- },
108
- RtkRule {
109
- rtk_cmd: "rtk cargo",
110
- rewrite_prefixes: &["cargo"],
111
- category: "Cargo",
112
- savings_pct: 80.0,
113
- subcmd_savings: &[("test", 90.0), ("check", 80.0)],
114
- subcmd_status: &[("fmt", RtkStatus::Passthrough)],
115
- },
116
- RtkRule {
117
- rtk_cmd: "rtk pnpm",
118
- rewrite_prefixes: &["pnpm"],
119
- category: "PackageManager",
120
- savings_pct: 80.0,
121
- subcmd_savings: &[],
122
- subcmd_status: &[],
123
- },
124
- RtkRule {
125
- rtk_cmd: "rtk npm",
126
- rewrite_prefixes: &["npm"],
127
- category: "PackageManager",
128
- savings_pct: 70.0,
129
- subcmd_savings: &[],
130
- subcmd_status: &[],
131
- },
132
- RtkRule {
133
- rtk_cmd: "rtk npx",
134
- rewrite_prefixes: &["npx"],
135
- category: "PackageManager",
136
- savings_pct: 70.0,
137
- subcmd_savings: &[],
138
- subcmd_status: &[],
139
- },
140
- RtkRule {
141
- rtk_cmd: "rtk read",
142
- rewrite_prefixes: &["cat", "head", "tail"],
143
- category: "Files",
144
- savings_pct: 60.0,
145
- subcmd_savings: &[],
146
- subcmd_status: &[],
147
- },
148
- RtkRule {
149
- rtk_cmd: "rtk grep",
150
- rewrite_prefixes: &["rg", "grep"],
151
- category: "Files",
152
- savings_pct: 75.0,
153
- subcmd_savings: &[],
154
- subcmd_status: &[],
155
- },
156
- RtkRule {
157
- rtk_cmd: "rtk ls",
158
- rewrite_prefixes: &["ls"],
159
- category: "Files",
160
- savings_pct: 65.0,
161
- subcmd_savings: &[],
162
- subcmd_status: &[],
163
- },
164
- RtkRule {
165
- rtk_cmd: "rtk find",
166
- rewrite_prefixes: &["find"],
167
- category: "Files",
168
- savings_pct: 70.0,
169
- subcmd_savings: &[],
170
- subcmd_status: &[],
171
- },
172
- RtkRule {
173
- // Longest prefixes first for correct matching
174
- rtk_cmd: "rtk tsc",
175
- rewrite_prefixes: &["pnpm tsc", "npx tsc", "tsc"],
176
- category: "Build",
177
- savings_pct: 83.0,
178
- subcmd_savings: &[],
179
- subcmd_status: &[],
180
- },
181
- RtkRule {
182
- rtk_cmd: "rtk lint",
183
- rewrite_prefixes: &[
184
- "npx eslint",
185
- "pnpm lint",
186
- "npx biome",
187
- "eslint",
188
- "biome",
189
- "lint",
190
- ],
191
- category: "Build",
192
- savings_pct: 84.0,
193
- subcmd_savings: &[],
194
- subcmd_status: &[],
195
- },
196
- RtkRule {
197
- rtk_cmd: "rtk prettier",
198
- rewrite_prefixes: &["npx prettier", "pnpm prettier", "prettier"],
199
- category: "Build",
200
- savings_pct: 70.0,
201
- subcmd_savings: &[],
202
- subcmd_status: &[],
203
- },
204
- RtkRule {
205
- // "next build" is stripped to "rtk next" — the build subcommand is internal
206
- rtk_cmd: "rtk next",
207
- rewrite_prefixes: &["npx next build", "pnpm next build", "next build"],
208
- category: "Build",
209
- savings_pct: 87.0,
210
- subcmd_savings: &[],
211
- subcmd_status: &[],
212
- },
213
- RtkRule {
214
- rtk_cmd: "rtk vitest",
215
- rewrite_prefixes: &["pnpm vitest", "npx vitest", "vitest", "jest"],
216
- category: "Tests",
217
- savings_pct: 99.0,
218
- subcmd_savings: &[],
219
- subcmd_status: &[],
220
- },
221
- RtkRule {
222
- rtk_cmd: "rtk playwright",
223
- rewrite_prefixes: &["npx playwright", "pnpm playwright", "playwright"],
224
- category: "Tests",
225
- savings_pct: 94.0,
226
- subcmd_savings: &[],
227
- subcmd_status: &[],
228
- },
229
- RtkRule {
230
- rtk_cmd: "rtk prisma",
231
- rewrite_prefixes: &["npx prisma", "pnpm prisma", "prisma"],
232
- category: "Build",
233
- savings_pct: 88.0,
234
- subcmd_savings: &[],
235
- subcmd_status: &[],
236
- },
237
- RtkRule {
238
- rtk_cmd: "rtk docker",
239
- rewrite_prefixes: &["docker"],
240
- category: "Infra",
241
- savings_pct: 85.0,
242
- subcmd_savings: &[],
243
- subcmd_status: &[],
244
- },
245
- RtkRule {
246
- rtk_cmd: "rtk kubectl",
247
- rewrite_prefixes: &["kubectl"],
248
- category: "Infra",
249
- savings_pct: 85.0,
250
- subcmd_savings: &[],
251
- subcmd_status: &[],
252
- },
253
- RtkRule {
254
- rtk_cmd: "rtk tree",
255
- rewrite_prefixes: &["tree"],
256
- category: "Files",
257
- savings_pct: 70.0,
258
- subcmd_savings: &[],
259
- subcmd_status: &[],
260
- },
261
- RtkRule {
262
- rtk_cmd: "rtk diff",
263
- rewrite_prefixes: &["diff"],
264
- category: "Files",
265
- savings_pct: 60.0,
266
- subcmd_savings: &[],
267
- subcmd_status: &[],
268
- },
269
- RtkRule {
270
- rtk_cmd: "rtk curl",
271
- rewrite_prefixes: &["curl"],
272
- category: "Network",
273
- savings_pct: 70.0,
274
- subcmd_savings: &[],
275
- subcmd_status: &[],
276
- },
277
- RtkRule {
278
- rtk_cmd: "rtk wget",
279
- rewrite_prefixes: &["wget"],
280
- category: "Network",
281
- savings_pct: 65.0,
282
- subcmd_savings: &[],
283
- subcmd_status: &[],
284
- },
285
- RtkRule {
286
- rtk_cmd: "rtk mypy",
287
- rewrite_prefixes: &["python3 -m mypy", "python -m mypy", "mypy"],
288
- category: "Build",
289
- savings_pct: 80.0,
290
- subcmd_savings: &[],
291
- subcmd_status: &[],
292
- },
293
- // Python tooling
294
- RtkRule {
295
- rtk_cmd: "rtk ruff",
296
- rewrite_prefixes: &["ruff"],
297
- category: "Python",
298
- savings_pct: 80.0,
299
- subcmd_savings: &[("check", 80.0), ("format", 75.0)],
300
- subcmd_status: &[],
301
- },
302
- RtkRule {
303
- rtk_cmd: "rtk pytest",
304
- rewrite_prefixes: &["python -m pytest", "pytest"],
305
- category: "Python",
306
- savings_pct: 90.0,
307
- subcmd_savings: &[],
308
- subcmd_status: &[],
309
- },
310
- RtkRule {
311
- rtk_cmd: "rtk pip",
312
- rewrite_prefixes: &["pip3", "pip", "uv pip"],
313
- category: "Python",
314
- savings_pct: 75.0,
315
- subcmd_savings: &[("list", 75.0), ("outdated", 80.0)],
316
- subcmd_status: &[],
317
- },
318
- // Go tooling
319
- RtkRule {
320
- rtk_cmd: "rtk go",
321
- rewrite_prefixes: &["go"],
322
- category: "Go",
323
- savings_pct: 85.0,
324
- subcmd_savings: &[("test", 90.0), ("build", 80.0), ("vet", 75.0)],
325
- subcmd_status: &[],
326
- },
327
- RtkRule {
328
- rtk_cmd: "rtk golangci-lint",
329
- rewrite_prefixes: &["golangci-lint", "golangci"],
330
- category: "Go",
331
- savings_pct: 85.0,
332
- subcmd_savings: &[],
333
- subcmd_status: &[],
334
- },
335
- // AWS CLI
336
- RtkRule {
337
- rtk_cmd: "rtk aws",
338
- rewrite_prefixes: &["aws"],
339
- category: "Infra",
340
- savings_pct: 80.0,
341
- subcmd_savings: &[],
342
- subcmd_status: &[],
343
- },
344
- // PostgreSQL
345
- RtkRule {
346
- rtk_cmd: "rtk psql",
347
- rewrite_prefixes: &["psql"],
348
- category: "Infra",
349
- savings_pct: 75.0,
350
- subcmd_savings: &[],
351
- subcmd_status: &[],
352
- },
353
- // TOML-filtered commands
354
- RtkRule {
355
- rtk_cmd: "rtk ansible-playbook",
356
- rewrite_prefixes: &["ansible-playbook"],
357
- category: "Infra",
358
- savings_pct: 70.0,
359
- subcmd_savings: &[],
360
- subcmd_status: &[],
361
- },
362
- RtkRule {
363
- rtk_cmd: "rtk brew",
364
- rewrite_prefixes: &["brew"],
365
- category: "PackageManager",
366
- savings_pct: 65.0,
367
- subcmd_savings: &[],
368
- subcmd_status: &[],
369
- },
370
- RtkRule {
371
- rtk_cmd: "rtk composer",
372
- rewrite_prefixes: &["composer"],
373
- category: "PackageManager",
374
- savings_pct: 65.0,
375
- subcmd_savings: &[],
376
- subcmd_status: &[],
377
- },
378
- RtkRule {
379
- rtk_cmd: "rtk df",
380
- rewrite_prefixes: &["df"],
381
- category: "System",
382
- savings_pct: 60.0,
383
- subcmd_savings: &[],
384
- subcmd_status: &[],
385
- },
386
- RtkRule {
387
- rtk_cmd: "rtk dotnet",
388
- rewrite_prefixes: &["dotnet"],
389
- category: "Build",
390
- savings_pct: 70.0,
391
- subcmd_savings: &[],
392
- subcmd_status: &[],
393
- },
394
- RtkRule {
395
- rtk_cmd: "rtk du",
396
- rewrite_prefixes: &["du"],
397
- category: "System",
398
- savings_pct: 60.0,
399
- subcmd_savings: &[],
400
- subcmd_status: &[],
401
- },
402
- RtkRule {
403
- rtk_cmd: "rtk fail2ban-client",
404
- rewrite_prefixes: &["fail2ban-client"],
405
- category: "Infra",
406
- savings_pct: 60.0,
407
- subcmd_savings: &[],
408
- subcmd_status: &[],
409
- },
410
- RtkRule {
411
- rtk_cmd: "rtk gcloud",
412
- rewrite_prefixes: &["gcloud"],
413
- category: "Infra",
414
- savings_pct: 65.0,
415
- subcmd_savings: &[],
416
- subcmd_status: &[],
417
- },
418
- RtkRule {
419
- rtk_cmd: "rtk hadolint",
420
- rewrite_prefixes: &["hadolint"],
421
- category: "Build",
422
- savings_pct: 65.0,
423
- subcmd_savings: &[],
424
- subcmd_status: &[],
425
- },
426
- RtkRule {
427
- rtk_cmd: "rtk helm",
428
- rewrite_prefixes: &["helm"],
429
- category: "Infra",
430
- savings_pct: 65.0,
431
- subcmd_savings: &[],
432
- subcmd_status: &[],
433
- },
434
- RtkRule {
435
- rtk_cmd: "rtk iptables",
436
- rewrite_prefixes: &["iptables"],
437
- category: "Infra",
438
- savings_pct: 60.0,
439
- subcmd_savings: &[],
440
- subcmd_status: &[],
441
- },
442
- RtkRule {
443
- rtk_cmd: "rtk make",
444
- rewrite_prefixes: &["make"],
445
- category: "Build",
446
- savings_pct: 65.0,
447
- subcmd_savings: &[],
448
- subcmd_status: &[],
449
- },
450
- RtkRule {
451
- rtk_cmd: "rtk markdownlint",
452
- rewrite_prefixes: &["markdownlint"],
453
- category: "Build",
454
- savings_pct: 65.0,
455
- subcmd_savings: &[],
456
- subcmd_status: &[],
457
- },
458
- RtkRule {
459
- rtk_cmd: "rtk mix",
460
- rewrite_prefixes: &["mix"],
461
- category: "Build",
462
- savings_pct: 65.0,
463
- subcmd_savings: &[],
464
- subcmd_status: &[],
465
- },
466
- RtkRule {
467
- rtk_cmd: "rtk mvn",
468
- rewrite_prefixes: &["mvn"],
469
- category: "Build",
470
- savings_pct: 70.0,
471
- subcmd_savings: &[],
472
- subcmd_status: &[],
473
- },
474
- RtkRule {
475
- rtk_cmd: "rtk ping",
476
- rewrite_prefixes: &["ping"],
477
- category: "Network",
478
- savings_pct: 60.0,
479
- subcmd_savings: &[],
480
- subcmd_status: &[],
481
- },
482
- RtkRule {
483
- rtk_cmd: "rtk pio",
484
- rewrite_prefixes: &["pio"],
485
- category: "Build",
486
- savings_pct: 65.0,
487
- subcmd_savings: &[],
488
- subcmd_status: &[],
489
- },
490
- RtkRule {
491
- rtk_cmd: "rtk poetry",
492
- rewrite_prefixes: &["poetry"],
493
- category: "Python",
494
- savings_pct: 65.0,
495
- subcmd_savings: &[],
496
- subcmd_status: &[],
497
- },
498
- RtkRule {
499
- rtk_cmd: "rtk pre-commit",
500
- rewrite_prefixes: &["pre-commit"],
501
- category: "Build",
502
- savings_pct: 65.0,
503
- subcmd_savings: &[],
504
- subcmd_status: &[],
505
- },
506
- RtkRule {
507
- rtk_cmd: "rtk ps",
508
- rewrite_prefixes: &["ps"],
509
- category: "System",
510
- savings_pct: 60.0,
511
- subcmd_savings: &[],
512
- subcmd_status: &[],
513
- },
514
- RtkRule {
515
- rtk_cmd: "rtk quarto",
516
- rewrite_prefixes: &["quarto"],
517
- category: "Build",
518
- savings_pct: 65.0,
519
- subcmd_savings: &[],
520
- subcmd_status: &[],
521
- },
522
- RtkRule {
523
- rtk_cmd: "rtk rsync",
524
- rewrite_prefixes: &["rsync"],
525
- category: "Network",
526
- savings_pct: 65.0,
527
- subcmd_savings: &[],
528
- subcmd_status: &[],
529
- },
530
- RtkRule {
531
- rtk_cmd: "rtk shellcheck",
532
- rewrite_prefixes: &["shellcheck"],
533
- category: "Build",
534
- savings_pct: 65.0,
535
- subcmd_savings: &[],
536
- subcmd_status: &[],
537
- },
538
- RtkRule {
539
- rtk_cmd: "rtk shopify",
540
- rewrite_prefixes: &["shopify"],
541
- category: "Build",
542
- savings_pct: 65.0,
543
- subcmd_savings: &[],
544
- subcmd_status: &[],
545
- },
546
- RtkRule {
547
- rtk_cmd: "rtk sops",
548
- rewrite_prefixes: &["sops"],
549
- category: "Infra",
550
- savings_pct: 60.0,
551
- subcmd_savings: &[],
552
- subcmd_status: &[],
553
- },
554
- RtkRule {
555
- rtk_cmd: "rtk swift",
556
- rewrite_prefixes: &["swift"],
557
- category: "Build",
558
- savings_pct: 65.0,
559
- subcmd_savings: &[],
560
- subcmd_status: &[],
561
- },
562
- RtkRule {
563
- rtk_cmd: "rtk systemctl",
564
- rewrite_prefixes: &["systemctl"],
565
- category: "System",
566
- savings_pct: 65.0,
567
- subcmd_savings: &[],
568
- subcmd_status: &[],
569
- },
570
- RtkRule {
571
- rtk_cmd: "rtk terraform",
572
- rewrite_prefixes: &["terraform"],
573
- category: "Infra",
574
- savings_pct: 70.0,
575
- subcmd_savings: &[],
576
- subcmd_status: &[],
577
- },
578
- RtkRule {
579
- rtk_cmd: "rtk tofu",
580
- rewrite_prefixes: &["tofu"],
581
- category: "Infra",
582
- savings_pct: 70.0,
583
- subcmd_savings: &[],
584
- subcmd_status: &[],
585
- },
586
- RtkRule {
587
- rtk_cmd: "rtk trunk",
588
- rewrite_prefixes: &["trunk"],
589
- category: "Build",
590
- savings_pct: 65.0,
591
- subcmd_savings: &[],
592
- subcmd_status: &[],
593
- },
594
- RtkRule {
595
- rtk_cmd: "rtk uv",
596
- rewrite_prefixes: &["uv"],
597
- category: "Python",
598
- savings_pct: 65.0,
599
- subcmd_savings: &[],
600
- subcmd_status: &[],
601
- },
602
- RtkRule {
603
- rtk_cmd: "rtk yamllint",
604
- rewrite_prefixes: &["yamllint"],
605
- category: "Build",
606
- savings_pct: 65.0,
607
- subcmd_savings: &[],
608
- subcmd_status: &[],
609
- },
610
- ];
611
-
612
- /// Commands to ignore (shell builtins, trivial, already rtk).
613
- pub const IGNORED_PREFIXES: &[&str] = &[
614
- "cd ",
615
- "cd\t",
616
- "echo ",
617
- "printf ",
618
- "export ",
619
- "source ",
620
- "mkdir ",
621
- "rm ",
622
- "mv ",
623
- "cp ",
624
- "chmod ",
625
- "chown ",
626
- "touch ",
627
- "which ",
628
- "type ",
629
- "command ",
630
- "test ",
631
- "true",
632
- "false",
633
- "sleep ",
634
- "wait",
635
- "kill ",
636
- "set ",
637
- "unset ",
638
- "wc ",
639
- "sort ",
640
- "uniq ",
641
- "tr ",
642
- "cut ",
643
- "awk ",
644
- "sed ",
645
- "python3 -c",
646
- "python -c",
647
- "node -e",
648
- "ruby -e",
649
- "rtk ",
650
- "pwd",
651
- "bash ",
652
- "sh ",
653
- "then\n",
654
- "then ",
655
- "else\n",
656
- "else ",
657
- "do\n",
658
- "do ",
659
- "for ",
660
- "while ",
661
- "if ",
662
- "case ",
663
- ];
664
-
665
- pub const IGNORED_EXACT: &[&str] = &[
666
- "cd", "echo", "true", "false", "wait", "pwd", "bash", "sh", "fi", "done",
667
- ];