You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Documented -u (--ultra-compact) shorthand is not implemented — unknown global flags exec-fail with ENOENT / exit 127 instead of a parse error #2369
The README documents a -u shorthand for --ultra-compact (README.md, "Options" quick ref):
-u, --ultra-compact # ASCII icons, inline format (extra token savings)
But the CLI only defines the long flag. rtk --help shows:
--ultra-compact
Ultra-compact mode: ASCII icons, inline format (Level 2 optimizations)
Running rtk -u <cmd> fails with exit 127 and an ENOENT message.
This is not specific to -u: any unknown global flag (e.g. rtk -z grep ...) fails the same way. So unknown global args seem to fall through to the external-command exec path instead of being rejected by the argument parser.
Repro steps
printf'master\nfeat/x\n'> /tmp/branches.txt
rtk -u grep master /tmp/branches.txt
# [rtk: No such file or directory (os error 2)]# exit code: 127
rtk -u read /tmp/branches.txt
# [rtk: No such file or directory (os error 2)]# exit code: 127
rtk -z grep master /tmp/branches.txt # any unknown global flag, same failure# [rtk: No such file or directory (os error 2)]# exit code: 127# long form works fine:
rtk --ultra-compact grep master /tmp/branches.txt
rtk --ultra-compact read /tmp/branches.txt
Expected
Either:
rtk -u works as the README documents, or
if -u is not meant to exist, drop it from the README, and unknown flags should get a normal parse error (unexpected argument '-u') instead of ENOENT + exit 127.
Actual
[rtk: No such file or directory (os error 2)], exit 127. The message suggests rtk tried to exec -u as an external command.
No related fix in CHANGELOG up to 0.42.3, and -u is still absent from --help
Possibly related: #2095 reports the same os error 2 failure at startup for rtk json / rtk smart / rtk telemetry, which also looks like arguments falling into a wrong exec/file-lookup path.
Two related bugs: -u shorthand documented in README but missing from CLI parser, and unknown global flags fall through to the exec path (ENOENT/exit 127) instead of producing a parse error.
📁 Relevant files
src/cli.rs
src/main.rs
README.md
Triaged automatically by wshm · This is an automated analysis, not a human review.
I reproduced this on develop (0.42.2, macOS arm64) and looked into the fix. There's a non-obvious tradeoff worth flagging before someone implements it, because the obvious one-line fix introduces a regression.
Confirmed:rtk -u <cmd> falls through to the external-exec path; rtk --ultra-compact <cmd> works. The ultra_compact field in src/main.rs has long but no short.
The catch: the field is #[arg(long, global = true)]. Adding short = 'u' to a global flag makes -u shadow git's own -uafter the subcommand:
# with short='u' added (global):
$ rtk git log -u # git's -u = show patch -> swallowed by rtk, no patch
$ rtk git push -u ... # git's -u = --set-upstream -> silently dropped
I verified this with a parse-level test: rtk git log -u parses to ultra_compact=true with empty git args, instead of passing -u to git. So the naive fix trades a missing flag for silently breaking git log -u / git push -u / git stash -u.
The two clean options each have a cost:
Keep global = true, add short = 'u' — matches the existing doc caveat (what-rtk-covers.md: "use --ultra-compact rather than -u with Git"), but silently shadows git's -u, which violates the transparency principle for agents running git push -u.
Make the flag non-global, add short = 'u' (consistent with how verbose is "only recognized before the subcommand") — rtk -u <cmd> and rtk --ultra-compact <cmd> work, git's -u is untouched, but post-subcommand rtk gh pr list --ultra-compact would stop being captured. Since ultra_compact is only consumed by gh/glab (not git), the blast radius is small, and git log --ultra-compact is already a swallowed no-op today.
I'd lean toward option 2 (non-global, plus a doc tweak), but it's a behavior change that's really your call. Happy to send a PR for whichever you prefer.
Closing as a duplicate of #3426, which tracks the same problem with the more complete discussion. Please follow up there; if your case differs in a way that issue does not cover, comment here and it can be reopened.
Activity
pszymkowiak commentedon Jun 10, 2026
🔍 Automated Triage
bugmediumSummary
Two related bugs:
-ushorthand documented in README but missing from CLI parser, and unknown global flags fall through to the exec path (ENOENT/exit 127) instead of producing a parse error.📁 Relevant files
src/cli.rssrc/main.rsREADME.mdTriaged automatically by wshm · This is an automated analysis, not a human review.
hgunduzoglu commentedon Jun 17, 2026
I reproduced this on
develop(0.42.2, macOS arm64) and looked into the fix. There's a non-obvious tradeoff worth flagging before someone implements it, because the obvious one-line fix introduces a regression.Confirmed:
rtk -u <cmd>falls through to the external-exec path;rtk --ultra-compact <cmd>works. Theultra_compactfield insrc/main.rshaslongbut noshort.The catch: the field is
#[arg(long, global = true)]. Addingshort = 'u'to a global flag makes-ushadow git's own-uafter the subcommand:I verified this with a parse-level test:
rtk git log -uparses toultra_compact=truewith empty git args, instead of passing-uto git. So the naive fix trades a missing flag for silently breakinggit log -u/git push -u/git stash -u.The two clean options each have a cost:
global = true, addshort = 'u'— matches the existing doc caveat (what-rtk-covers.md: "use--ultra-compactrather than-uwith Git"), but silently shadows git's-u, which violates the transparency principle for agents runninggit push -u.short = 'u'(consistent with howverboseis "only recognized before the subcommand") —rtk -u <cmd>andrtk --ultra-compact <cmd>work, git's-uis untouched, but post-subcommandrtk gh pr list --ultra-compactwould stop being captured. Sinceultra_compactis only consumed bygh/glab(not git), the blast radius is small, andgit log --ultra-compactis already a swallowed no-op today.I'd lean toward option 2 (non-global, plus a doc tweak), but it's a behavior change that's really your call. Happy to send a PR for whichever you prefer.
KuSh commentedon Sep 13, 2026
Closing as a duplicate of #3426, which tracks the same problem with the more complete discussion. Please follow up there; if your case differs in a way that issue does not cover, comment here and it can be reopened.