@hasna/terminal 2.3.0 → 2.3.2

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 (267) hide show
  1. package/dist/App.js +404 -0
  2. package/dist/Browse.js +79 -0
  3. package/dist/FuzzyPicker.js +47 -0
  4. package/dist/Onboarding.js +51 -0
  5. package/dist/Spinner.js +12 -0
  6. package/dist/StatusBar.js +49 -0
  7. package/dist/ai.js +322 -0
  8. package/dist/cache.js +41 -0
  9. package/dist/cli.js +64 -16
  10. package/dist/command-rewriter.js +64 -0
  11. package/dist/command-validator.js +86 -0
  12. package/dist/compression.js +107 -0
  13. package/dist/context-hints.js +275 -0
  14. package/dist/diff-cache.js +107 -0
  15. package/dist/discover.js +212 -0
  16. package/dist/economy.js +123 -0
  17. package/dist/expand-store.js +38 -0
  18. package/dist/file-cache.js +72 -0
  19. package/dist/file-index.js +62 -0
  20. package/dist/history.js +62 -0
  21. package/dist/lazy-executor.js +54 -0
  22. package/dist/line-dedup.js +59 -0
  23. package/dist/loop-detector.js +75 -0
  24. package/dist/mcp/install.js +98 -0
  25. package/dist/mcp/server.js +569 -0
  26. package/dist/noise-filter.js +86 -0
  27. package/dist/output-processor.js +129 -0
  28. package/dist/output-router.js +41 -0
  29. package/dist/output-store.js +111 -0
  30. package/dist/parsers/base.js +2 -0
  31. package/dist/parsers/build.js +64 -0
  32. package/dist/parsers/errors.js +101 -0
  33. package/dist/parsers/files.js +78 -0
  34. package/dist/parsers/git.js +99 -0
  35. package/dist/parsers/index.js +48 -0
  36. package/dist/parsers/tests.js +89 -0
  37. package/dist/providers/anthropic.js +39 -0
  38. package/dist/providers/base.js +4 -0
  39. package/dist/providers/cerebras.js +95 -0
  40. package/dist/providers/groq.js +95 -0
  41. package/dist/providers/index.js +73 -0
  42. package/dist/providers/xai.js +95 -0
  43. package/dist/recipes/model.js +20 -0
  44. package/dist/recipes/storage.js +136 -0
  45. package/dist/search/content-search.js +68 -0
  46. package/dist/search/file-search.js +61 -0
  47. package/dist/search/filters.js +34 -0
  48. package/dist/search/index.js +5 -0
  49. package/dist/search/semantic.js +320 -0
  50. package/dist/session-boot.js +59 -0
  51. package/dist/session-context.js +55 -0
  52. package/dist/sessions-db.js +173 -0
  53. package/dist/smart-display.js +286 -0
  54. package/dist/snapshots.js +51 -0
  55. package/dist/supervisor.js +112 -0
  56. package/dist/test-watchlist.js +131 -0
  57. package/dist/tool-profiles.js +122 -0
  58. package/dist/tree.js +94 -0
  59. package/dist/usage-cache.js +65 -0
  60. package/package.json +8 -1
  61. package/src/ai.ts +8 -0
  62. package/src/cli.tsx +57 -18
  63. package/src/output-processor.ts +6 -1
  64. package/src/output-store.ts +58 -12
  65. package/src/tool-profiles.ts +139 -0
  66. package/.claude/scheduled_tasks.lock +0 -1
  67. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -20
  68. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -14
  69. package/CONTRIBUTING.md +0 -80
  70. package/benchmarks/benchmark.mjs +0 -115
  71. package/imported_modules.txt +0 -0
  72. package/temp/rtk/.claude/agents/code-reviewer.md +0 -221
  73. package/temp/rtk/.claude/agents/debugger.md +0 -519
  74. package/temp/rtk/.claude/agents/rtk-testing-specialist.md +0 -461
  75. package/temp/rtk/.claude/agents/rust-rtk.md +0 -511
  76. package/temp/rtk/.claude/agents/technical-writer.md +0 -355
  77. package/temp/rtk/.claude/commands/diagnose.md +0 -352
  78. package/temp/rtk/.claude/commands/test-routing.md +0 -362
  79. package/temp/rtk/.claude/hooks/bash/pre-commit-format.sh +0 -16
  80. package/temp/rtk/.claude/hooks/rtk-rewrite.sh +0 -70
  81. package/temp/rtk/.claude/hooks/rtk-suggest.sh +0 -152
  82. package/temp/rtk/.claude/rules/cli-testing.md +0 -526
  83. package/temp/rtk/.claude/skills/issue-triage/SKILL.md +0 -348
  84. package/temp/rtk/.claude/skills/issue-triage/templates/issue-comment.md +0 -134
  85. package/temp/rtk/.claude/skills/performance.md +0 -435
  86. package/temp/rtk/.claude/skills/pr-triage/SKILL.md +0 -315
  87. package/temp/rtk/.claude/skills/pr-triage/templates/review-comment.md +0 -71
  88. package/temp/rtk/.claude/skills/repo-recap.md +0 -206
  89. package/temp/rtk/.claude/skills/rtk-tdd/SKILL.md +0 -78
  90. package/temp/rtk/.claude/skills/rtk-tdd/references/testing-patterns.md +0 -124
  91. package/temp/rtk/.claude/skills/security-guardian.md +0 -503
  92. package/temp/rtk/.claude/skills/ship.md +0 -404
  93. package/temp/rtk/.github/workflows/benchmark.yml +0 -34
  94. package/temp/rtk/.github/workflows/dco-check.yaml +0 -12
  95. package/temp/rtk/.github/workflows/release-please.yml +0 -51
  96. package/temp/rtk/.github/workflows/release.yml +0 -343
  97. package/temp/rtk/.github/workflows/security-check.yml +0 -135
  98. package/temp/rtk/.github/workflows/validate-docs.yml +0 -78
  99. package/temp/rtk/.release-please-manifest.json +0 -3
  100. package/temp/rtk/ARCHITECTURE.md +0 -1491
  101. package/temp/rtk/CHANGELOG.md +0 -640
  102. package/temp/rtk/CLAUDE.md +0 -605
  103. package/temp/rtk/CONTRIBUTING.md +0 -199
  104. package/temp/rtk/Cargo.lock +0 -1668
  105. package/temp/rtk/Cargo.toml +0 -64
  106. package/temp/rtk/Formula/rtk.rb +0 -43
  107. package/temp/rtk/INSTALL.md +0 -390
  108. package/temp/rtk/LICENSE +0 -21
  109. package/temp/rtk/README.md +0 -386
  110. package/temp/rtk/README_es.md +0 -159
  111. package/temp/rtk/README_fr.md +0 -197
  112. package/temp/rtk/README_ja.md +0 -159
  113. package/temp/rtk/README_ko.md +0 -159
  114. package/temp/rtk/README_zh.md +0 -167
  115. package/temp/rtk/ROADMAP.md +0 -15
  116. package/temp/rtk/SECURITY.md +0 -217
  117. package/temp/rtk/TEST_EXEC_TIME.md +0 -102
  118. package/temp/rtk/build.rs +0 -57
  119. package/temp/rtk/docs/AUDIT_GUIDE.md +0 -432
  120. package/temp/rtk/docs/FEATURES.md +0 -1410
  121. package/temp/rtk/docs/TROUBLESHOOTING.md +0 -309
  122. package/temp/rtk/docs/filter-workflow.md +0 -102
  123. package/temp/rtk/docs/images/gain-dashboard.jpg +0 -0
  124. package/temp/rtk/docs/tracking.md +0 -583
  125. package/temp/rtk/hooks/opencode-rtk.ts +0 -39
  126. package/temp/rtk/hooks/rtk-awareness.md +0 -29
  127. package/temp/rtk/hooks/rtk-rewrite.sh +0 -61
  128. package/temp/rtk/hooks/test-rtk-rewrite.sh +0 -442
  129. package/temp/rtk/install.sh +0 -124
  130. package/temp/rtk/release-please-config.json +0 -10
  131. package/temp/rtk/scripts/benchmark.sh +0 -592
  132. package/temp/rtk/scripts/check-installation.sh +0 -162
  133. package/temp/rtk/scripts/install-local.sh +0 -37
  134. package/temp/rtk/scripts/rtk-economics.sh +0 -137
  135. package/temp/rtk/scripts/test-all.sh +0 -561
  136. package/temp/rtk/scripts/test-aristote.sh +0 -227
  137. package/temp/rtk/scripts/test-tracking.sh +0 -79
  138. package/temp/rtk/scripts/update-readme-metrics.sh +0 -32
  139. package/temp/rtk/scripts/validate-docs.sh +0 -73
  140. package/temp/rtk/src/aws_cmd.rs +0 -880
  141. package/temp/rtk/src/binlog.rs +0 -1645
  142. package/temp/rtk/src/cargo_cmd.rs +0 -1727
  143. package/temp/rtk/src/cc_economics.rs +0 -1157
  144. package/temp/rtk/src/ccusage.rs +0 -340
  145. package/temp/rtk/src/config.rs +0 -187
  146. package/temp/rtk/src/container.rs +0 -855
  147. package/temp/rtk/src/curl_cmd.rs +0 -134
  148. package/temp/rtk/src/deps.rs +0 -268
  149. package/temp/rtk/src/diff_cmd.rs +0 -367
  150. package/temp/rtk/src/discover/mod.rs +0 -274
  151. package/temp/rtk/src/discover/provider.rs +0 -388
  152. package/temp/rtk/src/discover/registry.rs +0 -2022
  153. package/temp/rtk/src/discover/report.rs +0 -202
  154. package/temp/rtk/src/discover/rules.rs +0 -667
  155. package/temp/rtk/src/display_helpers.rs +0 -402
  156. package/temp/rtk/src/dotnet_cmd.rs +0 -1771
  157. package/temp/rtk/src/dotnet_format_report.rs +0 -133
  158. package/temp/rtk/src/dotnet_trx.rs +0 -593
  159. package/temp/rtk/src/env_cmd.rs +0 -204
  160. package/temp/rtk/src/filter.rs +0 -462
  161. package/temp/rtk/src/filters/README.md +0 -52
  162. package/temp/rtk/src/filters/ansible-playbook.toml +0 -34
  163. package/temp/rtk/src/filters/basedpyright.toml +0 -47
  164. package/temp/rtk/src/filters/biome.toml +0 -45
  165. package/temp/rtk/src/filters/brew-install.toml +0 -37
  166. package/temp/rtk/src/filters/composer-install.toml +0 -40
  167. package/temp/rtk/src/filters/df.toml +0 -16
  168. package/temp/rtk/src/filters/dotnet-build.toml +0 -64
  169. package/temp/rtk/src/filters/du.toml +0 -16
  170. package/temp/rtk/src/filters/fail2ban-client.toml +0 -15
  171. package/temp/rtk/src/filters/gcc.toml +0 -49
  172. package/temp/rtk/src/filters/gcloud.toml +0 -22
  173. package/temp/rtk/src/filters/hadolint.toml +0 -24
  174. package/temp/rtk/src/filters/helm.toml +0 -29
  175. package/temp/rtk/src/filters/iptables.toml +0 -27
  176. package/temp/rtk/src/filters/jj.toml +0 -28
  177. package/temp/rtk/src/filters/jq.toml +0 -24
  178. package/temp/rtk/src/filters/make.toml +0 -41
  179. package/temp/rtk/src/filters/markdownlint.toml +0 -24
  180. package/temp/rtk/src/filters/mix-compile.toml +0 -27
  181. package/temp/rtk/src/filters/mix-format.toml +0 -15
  182. package/temp/rtk/src/filters/mvn-build.toml +0 -44
  183. package/temp/rtk/src/filters/oxlint.toml +0 -43
  184. package/temp/rtk/src/filters/ping.toml +0 -63
  185. package/temp/rtk/src/filters/pio-run.toml +0 -40
  186. package/temp/rtk/src/filters/poetry-install.toml +0 -50
  187. package/temp/rtk/src/filters/pre-commit.toml +0 -35
  188. package/temp/rtk/src/filters/ps.toml +0 -16
  189. package/temp/rtk/src/filters/quarto-render.toml +0 -41
  190. package/temp/rtk/src/filters/rsync.toml +0 -48
  191. package/temp/rtk/src/filters/shellcheck.toml +0 -27
  192. package/temp/rtk/src/filters/shopify-theme.toml +0 -29
  193. package/temp/rtk/src/filters/skopeo.toml +0 -45
  194. package/temp/rtk/src/filters/sops.toml +0 -16
  195. package/temp/rtk/src/filters/ssh.toml +0 -44
  196. package/temp/rtk/src/filters/stat.toml +0 -34
  197. package/temp/rtk/src/filters/swift-build.toml +0 -41
  198. package/temp/rtk/src/filters/systemctl-status.toml +0 -33
  199. package/temp/rtk/src/filters/terraform-plan.toml +0 -35
  200. package/temp/rtk/src/filters/tofu-fmt.toml +0 -16
  201. package/temp/rtk/src/filters/tofu-init.toml +0 -38
  202. package/temp/rtk/src/filters/tofu-plan.toml +0 -35
  203. package/temp/rtk/src/filters/tofu-validate.toml +0 -17
  204. package/temp/rtk/src/filters/trunk-build.toml +0 -39
  205. package/temp/rtk/src/filters/ty.toml +0 -50
  206. package/temp/rtk/src/filters/uv-sync.toml +0 -37
  207. package/temp/rtk/src/filters/xcodebuild.toml +0 -99
  208. package/temp/rtk/src/filters/yamllint.toml +0 -25
  209. package/temp/rtk/src/find_cmd.rs +0 -598
  210. package/temp/rtk/src/format_cmd.rs +0 -386
  211. package/temp/rtk/src/gain.rs +0 -723
  212. package/temp/rtk/src/gh_cmd.rs +0 -1651
  213. package/temp/rtk/src/git.rs +0 -2012
  214. package/temp/rtk/src/go_cmd.rs +0 -592
  215. package/temp/rtk/src/golangci_cmd.rs +0 -254
  216. package/temp/rtk/src/grep_cmd.rs +0 -288
  217. package/temp/rtk/src/gt_cmd.rs +0 -810
  218. package/temp/rtk/src/hook_audit_cmd.rs +0 -283
  219. package/temp/rtk/src/hook_check.rs +0 -171
  220. package/temp/rtk/src/init.rs +0 -1859
  221. package/temp/rtk/src/integrity.rs +0 -537
  222. package/temp/rtk/src/json_cmd.rs +0 -231
  223. package/temp/rtk/src/learn/detector.rs +0 -628
  224. package/temp/rtk/src/learn/mod.rs +0 -119
  225. package/temp/rtk/src/learn/report.rs +0 -184
  226. package/temp/rtk/src/lint_cmd.rs +0 -694
  227. package/temp/rtk/src/local_llm.rs +0 -316
  228. package/temp/rtk/src/log_cmd.rs +0 -248
  229. package/temp/rtk/src/ls.rs +0 -324
  230. package/temp/rtk/src/main.rs +0 -2482
  231. package/temp/rtk/src/mypy_cmd.rs +0 -389
  232. package/temp/rtk/src/next_cmd.rs +0 -241
  233. package/temp/rtk/src/npm_cmd.rs +0 -236
  234. package/temp/rtk/src/parser/README.md +0 -267
  235. package/temp/rtk/src/parser/error.rs +0 -46
  236. package/temp/rtk/src/parser/formatter.rs +0 -336
  237. package/temp/rtk/src/parser/mod.rs +0 -311
  238. package/temp/rtk/src/parser/types.rs +0 -119
  239. package/temp/rtk/src/pip_cmd.rs +0 -302
  240. package/temp/rtk/src/playwright_cmd.rs +0 -479
  241. package/temp/rtk/src/pnpm_cmd.rs +0 -573
  242. package/temp/rtk/src/prettier_cmd.rs +0 -221
  243. package/temp/rtk/src/prisma_cmd.rs +0 -482
  244. package/temp/rtk/src/psql_cmd.rs +0 -382
  245. package/temp/rtk/src/pytest_cmd.rs +0 -384
  246. package/temp/rtk/src/read.rs +0 -217
  247. package/temp/rtk/src/rewrite_cmd.rs +0 -50
  248. package/temp/rtk/src/ruff_cmd.rs +0 -402
  249. package/temp/rtk/src/runner.rs +0 -271
  250. package/temp/rtk/src/summary.rs +0 -297
  251. package/temp/rtk/src/tee.rs +0 -405
  252. package/temp/rtk/src/telemetry.rs +0 -248
  253. package/temp/rtk/src/toml_filter.rs +0 -1655
  254. package/temp/rtk/src/tracking.rs +0 -1416
  255. package/temp/rtk/src/tree.rs +0 -209
  256. package/temp/rtk/src/tsc_cmd.rs +0 -259
  257. package/temp/rtk/src/utils.rs +0 -432
  258. package/temp/rtk/src/verify_cmd.rs +0 -47
  259. package/temp/rtk/src/vitest_cmd.rs +0 -385
  260. package/temp/rtk/src/wc_cmd.rs +0 -401
  261. package/temp/rtk/src/wget_cmd.rs +0 -260
  262. package/temp/rtk/tests/fixtures/dotnet/build_failed.txt +0 -11
  263. package/temp/rtk/tests/fixtures/dotnet/format_changes.json +0 -31
  264. package/temp/rtk/tests/fixtures/dotnet/format_empty.json +0 -1
  265. package/temp/rtk/tests/fixtures/dotnet/format_success.json +0 -12
  266. package/temp/rtk/tests/fixtures/dotnet/test_failed.txt +0 -18
  267. package/tsconfig.json +0 -15
@@ -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
- ];