Skip to content

-u is documented in three places but is not a flag (it is passed through as a command name); --ultra-compact is documented as global but only affects gh/glab #3426

Open

Description

@HetCreep

Two flags the docs present as global. One does not exist; the other exists but is wired to two commands.

Provenance: AI-assisted source audit, human-directed, at v0.44.2 (700bdde). Reproduced with the shipped binary; outputs verbatim.

1. -u does not exist

README.md:293 lists -u, --ultra-compact. docs/contributing/ARCHITECTURE.md:772 has a section "Ultra-Compact Mode (-u)", and :1031/:1055 say "Global Flags: -v and -u work across all commands".

$ rtk -u git log
rtk: Failed to resolve '-u' via PATH, falling back to direct exec: Binary '-u' not found on PATH
[rtk: program not found]

rtk --help lists no -u in its Options. The long form --ultra-compact does parse — there is even a test named test_ultra_compact_long_form_still_works (main.rs:3558), which reads like the short form was removed deliberately and the docs were not updated.

Worth noting the failure mode: an unknown leading flag is treated as a program name and passed to the resolver, so rtk -u <anything> reports "program not found" rather than "unknown flag". That is a confusing error for a typo'd flag generally, not just this one.

2. --ultra-compact is documented as applying to everything, but only gh/glab read it

docs/guide/resources/what-rtk-covers.md:134 says these flags "apply to all RTK commands and can push the bash output reduction even higher", with the example rtk git log --ultra-compact at :143.

$ rtk git log > plain.txt
$ rtk git log --ultra-compact > uc.txt
$ diff plain.txt uc.txt
$                                    # no output — identical

grep -rln ultra_compact src/ returns main.rs, cmds/git/gh_cmd.rs, cmds/git/glab_cmd.rs — and in main.rs the value is only forwarded at :1788 (gh_cmd::run), :1807 (glab_cmd::run) and :3442. For every other command the flag is accepted and ignored.

The documented example is git log, which is one of the commands it does nothing for.

A note on how I checked

My first measurement compared byte counts and showed a 3-byte difference, which looked like the flag was doing something small. It was not — the two runs had different commit hashes. diff shows the outputs are identical. Byte-count comparison is not sufficient here; I mention it in case anyone else measures it the same way.

Suggested fix (untested)

Either drop -u from README.md:293 and ARCHITECTURE.md:772,1031,1055, or restore the short form. For --ultra-compact, either scope the documentation to gh/glab or wire it through the other filters.

Separately, an unknown leading flag being routed to the binary resolver produces a misleading message; rejecting arguments that start with - before the PATH lookup would give "unknown flag" instead.

Related, same sweep

  • docs/guide/resources/what-rtk-covers.md:139,146 documents -v/-vv/-vvv as showing "filtering details on stderr", with the example rtk git status -vvv. That placement is silently ignored (help says verbosity is only recognised before the subcommand), and even correctly placed, rtk -vvv git status 2>err produced 0 bytes on stderr; rtk -vvv git log produced 16 bytes (Git log output:). Nothing prints the "raw output before filtering" that ARCHITECTURE.md:752-760 describes.
  • docs/guide/getting-started/configuration.md:12-15 lists config-file locations for Linux and macOS only, while README.md:346 claims rtk "works fully on native Windows". On Windows the path is %APPDATA%\rtk\config.toml (dirs::config_dir()), which no doc gives.
  • docs/guide/resources/troubleshooting.md:49 shows rtk init --global --cursor; rtk init --help has no --cursor flag (Cursor is reachable as --agent cursor).

Activity

  1. added
    documentation
    good first issue
    on Aug 4, 2026
  2. pszymkowiak commented on Aug 4, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    📋 Category docs
    🟢 Priority low
    🎯 Confidence 88%

    Summary

    Multiple docs describe a nonexistent -u short flag and overstate --ultra-compact as global when it only affects gh/glab; recommend correcting README.md, ARCHITECTURE.md, and what-rtk-covers.md accordingly.

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.

    📁 Relevant files
    • README.md
    • docs/contributing/ARCHITECTURE.md
    • docs/guide/resources/what-rtk-covers.md
    • docs/guide/getting-started/configuration.md
    • docs/guide/resources/troubleshooting.md
    • src/main.rs

    Triaged automatically by wshm · This is an automated analysis, not a human review.

  3. KuSh commented on Sep 26, 2026

    @KuSh
    Collaborator

    The behavioural half of the note in section 1 — "an unknown leading flag is treated as a program name … a confusing error for a typo'd flag generally" — is broader than unknown flags: a known global flag in front of a subcommand also defeats run_fallback, because it decides from args[0] and args is env::args().skip(1).

    Two checks in src/main.rs::run_fallback read args[0] as the subcommand:

    • core::constants::RTK_META_COMMANDS.contains(&args[0].as_str()) — the guard that keeps meta-commands from falling through to raw execution
    • args[0] == "test" && args.iter().any(|a| a == "--shell" || a.starts_with("--shell=")) — added by fix(cli)!: preserve argv boundaries in generic runners #4125 so a misused --shell on rtk test reports itself

    Measured on develop (first pair) and on #4125's head (second):

    $ rtk gain --badtypo
    error: unexpected argument '--badtypo' found                            exit 2
    $ rtk -v gain --badtypo
    [rtk: No such file or directory (os error 2)]                           exit 127   ← execs `-v`
    
    $ rtk test --shell
    error: a value is required for '--shell <SHELL>' but none was supplied  exit 2
    $ rtk -v test --shell
    [rtk: No such file or directory (os error 2)]                           exit 127   ← execs `-v`
    

    So the shape is not only "a flag rtk does not know becomes a program name" but "any flag before the subcommand hides the subcommand from the fallback's own checks", and the user gets exit 127 claiming command not found about a flag they typed, instead of clap's usage error.

    Found while reviewing #4125, which inherits the assumption at the second site. It is not caused by that PR and did not hold it up — recording here since this issue already owns the root.

    Fix shape: skip leading --prefixed arguments before reading the subcommand, or key off the subcommand clap already identified in the error run_fallback is about to re-raise. The second cannot drift from clap's own idea of where the subcommand starts. Note this is the same args[0]-is-positional assumption in both places, so whichever way it is fixed, both sites want it.

  4. HetCreep commented on Oct 14, 2026

    @HetCreep
    Author

    Re-checked on v1.0.0 (stable, 2026-10-13): the official release binary plus the v1.0.0 source. Provenance: AI-assisted check, human-directed. "ran" = executed against rtk 1.0.0 with a control; "read" = verified from source only.

    Changed (ran): --ultra-compact was removed in 1.0 (5d8102ab, 0 hits in src/), and README.md / what-rtk-covers.md no longer mention -u. -v ls . now prints stats.

    Still live at v1.0.0:

    • ARCHITECTURE.md:959 still says "-v and -u work across all commands"; rtk -u git --version exits 127 Failed to resolve '-u' via PATH.
    • A leading unknown flag is still routed to the PATH resolver: control rtk gain --badtypo -> exit 2 (clap error), but rtk -v gain --badtypo, rtk --ultra-compact gain --badtypo and rtk -vvv git --version -> exit 127.
    • rtk -vvv git status prints nothing to stderr while what-rtk-covers.md:137-141 documents verbose detail.
    • configuration.md:14-15 still lists Linux and macOS only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:docsdocumentationgood first issuepriority:low

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions