Repository navigation
Description
Summary
Three subcommands fail identically with [rtk: No such file or directory (os error 2)] immediately upon invocation. The symptom is the same; the root cause is almost certainly a shared argument-parsing/file-lookup defect.
Environment
- rtk 0.42.0 (Homebrew, installed 2026-05-24)
- macOS Darwin 24.6.0 (x86_64)
- zsh 5.9
rtk verifyreports 145/145 inline tests passed and hook integrity OK
Bug A: rtk json rejects stdin input
$ echo '{"a":1,"b":2}' | rtk json
[rtk: No such file or directory (os error 2)]
Expected: Compact-format the JSON read from stdin (per rtk help json).
Actual: ENOENT, apparently because the wrapper requires a file argument and never falls back to stdin.
Workaround: pass a file path arg (rtk json file.json). Loses the pipe use case (e.g., kubectl get -o json | rtk json).
Bug B: rtk smart <cmd> errors with ENOENT
$ rtk smart cat /Users/master/.claude/RTK.md
[rtk: No such file or directory (os error 2)]
Expected: Run the inner command and emit a 2-line heuristic summary (per rtk help smart).
Actual: ENOENT before the inner command runs. Looks like the wrapper resolves cat as a file path rather than as a command to wrap.
Workaround: use rtk summary <cmd> — that wrapper works as expected.
Bug C: rtk telemetry returns ENOENT
$ rtk telemetry
[rtk: No such file or directory (os error 2)]
Expected: Show telemetry consent state, allow opt-in/opt-out (per rtk help telemetry: "Manage telemetry consent and data (RGPD/GDPR)").
Actual: ENOENT immediately.
Note: the [telemetry] section IS readable via rtk config (default enabled=false, consent_given=false), so the underlying state mechanism works — only the dedicated subcommand is broken.
Workaround: edit ~/Library/Application Support/rtk/config.toml under [telemetry] directly.
Hypothesis: shared root cause
All three commands fail with the same errno-2 message at the exact same point (before any subcommand-specific logic runs). Suggests a shared arg-parsing/file-lookup helper that's mistakenly treating the first positional argument (or implied input source) as a file path. Fixing one will likely fix all three.
Validation status
rtk help json, rtk help smart, rtk help telemetry all return successfully — the subcommands ARE registered in the help system. Only the runtime path fails. Other subcommands (rtk ls, rtk wc, rtk grep, rtk find, rtk git, rtk env, rtk read, rtk diff, rtk gh, rtk docker, rtk kubectl, rtk go, rtk gain, rtk session, rtk learn, rtk discover, rtk verify, rtk rewrite, rtk hook-audit, rtk config) all work correctly on this same setup.
Activity
pszymkowiak commentedon May 27, 2026
🔍 Automated Triage
bughighSummary
Three subcommands (json stdin, smart, telemetry) fail with ENOENT before executing; reporter hypothesizes a shared arg-parsing bug — investigate and fix the shared file-lookup path.
Triaged automatically by wshm · This is an automated analysis, not a human review.
KuSh commentedon Aug 30, 2026
Re-ran all three reproductions on 0.46.0 (
develop@cf6d99d). The shared ENOENT has largely gone, but one case survives — and it is a command not listed here.rtk json(stdin)exit 2, clap: the following required arguments were not provided:<FILE>rtk smart <cmd>exit 2, clap: unexpected argument 'f.md' foundrtk telemetryexit 2, prints its own helprtk read(no args)exit 127,[rtk: No such file or directory (os error 2)]D — the one still reproducing
This is the exact symptom the issue is named after, and it is the last instance of it.
filesis declared#[arg(required = true, num_args = 1..)], so clap rejects the no-argument form andrun_fallback(src/main.rs:1293) takes over and tries to executereadas a raw command. There is noreadbinary — it is a shell builtin — hence ENOENT and the shell's 127 "command not found" convention.rtk logshows what the working shape looks like: itsfileisOption<PathBuf>, soprintf 'ERROR x\n' | rtk logreads stdin and exits 0.Worth noting
rtk read -andrtk json -both work correctly today, so the explicit-dash form is a usable workaround for A and D.B is not a bug
rtk smarttakes a file, not a command to wrap:rtk smart cat /path/filewas therefore two positionals where one was expected.rtk summary <cmd>— the workaround in the original report — is the command wrapper. Errors are also clean now:rtk smart nosuchfile.mdexits 1 withrtk: Failed to read file: nosuchfile.md: No such file or directory, naming the file.If
rtk help smartimplied command-wrapping at 0.42.0, that wording is gone; the current help is unambiguous.C is correct clap behaviour
rtk telemetryrequires one ofstatus/enable/disable/forget. Printing the subcommand help and exiting 2 is what clap should do for a missing required subcommand.Suggestion
Narrow this issue to D (
rtk readwith no arguments falls through to raw execution) plus, if still wanted, the A feature gap (accept stdin when no file is given, asrtk logdoes). B and C look resolved and could be struck from the description so the remaining work is visible.Happy to be corrected if any of these still reproduce on macOS — everything above was measured on Linux.