[Ubuntu 24.04][CLI&UX] nemoclaw <name> sessions export treats a session key starting with '-' as an unknown flag with no actionable guidance
Description
When a user accidentally types a session key with a leading dash (e.g. nemoclaw <name> sessions export -mytypo), the command reports Nonexistent flag: -mytypo and exits 2. The error correctly names the offending argument but does not tell the user that session keys cannot start with -, nor does it suggest the fix (remove the leading dash). A user unfamiliar with CLI flag conventions will not understand from this message that they passed a session key in flag format.
Environment
Device: NVIDIA 2u2g-gen-0642 (RTX PRO 6000 Blackwell Server Edition)
OS: Ubuntu 24.04.4 LTS
Architecture: x86_64
Node.js: v22.22.3
npm: 10.9.8
Docker: 29.4.3, build 055a478
OpenShell CLI: 0.0.44
NemoClaw: v0.0.65
OpenClaw: v2026.5.27
Steps to Reproduce
-
Install NemoClaw v0.0.65:
curl -fsSL https://www.nvidia.com/nemoclaw.sh | NEMOCLAW_INSTALL_TAG=v0.0.65 bash -
Onboard a sandbox with at least one recorded session:
nemoclaw onboard -
Run sessions export with a session key that has an accidental leading dash:
nemoclaw <name> sessions export -mytypo -
Observe the error message and exit code.
-
Re-run without the leading dash:
nemoclaw <name> sessions export mytypo
Expected Result
Steps 3–4: Command exits non-zero with a message that:
- names the offending argument (
-mytypo) - explains that session keys cannot start with
- - suggests the fix, e.g.: "Did you mean:
nemoclaw <name> sessions export mytypo?"
No export folder is created.
Step 5: Command goes through the normal session-key path (either exports the session if found, or returns "not found" — not an unknown-flag error).
Actual Result
Steps 3–4:
Nonexistent flag: -mytypo
See more help with --help
exit: 2
The message only says the flag does not exist. It does not hint that the user may have intended a session key, nor does it suggest removing the leading dash. No export folder is created (correct).
Step 5: Correct — without the dash, the command treats the argument as a session key and returns:
Refusing to export: no entries found in agent 'main' for key(s): mytypo.
exit: 1
Logs
$ nemoclaw file-share-test sessions export -mytypo; echo "exit: $?"
Nonexistent flag: -mytypo
See more help with --help
exit: 2
$ nemoclaw file-share-test sessions export mytypo; echo "exit: $?"
Refusing to export: no entries found in agent 'main' for key(s): mytypo.
exit: 1
Working on this on branch fix/sessions-export-leading-dash-5510 (based on current main). #5510
Root cause: sessions export called this.parse() before inspecting positional keys, so oclif treated -mytypo as an unknown flag (Nonexistent flag: -mytypo) instead of a mistyped session key.
Fix: detect single-dash positional tokens in raw argv before parse(), then fail with actionable guidance naming the token, explaining session keys cannot start with -, and suggesting e.g. nemoclaw <name> sessions export mytypo. Regression tests in test/sandbox-sessions-export-cli.test.ts and src/lib/actions/sandbox/sessions/paths.test.ts.
Deferring to assignee PR #5514 (@TonyLuo-NV) — same fix path ( + dash-key guidance). No competing PR from me; will review/help there instead.
Thanks @Thabhelo — appreciate you flagging early and deferring rather than opening a duplicate. The fix is up in #5514 (CI green, CodeRabbit-clean); it uses the same static "--" = false root-cause fix plus de-dashed "Did you mean" guidance. Review and any test/wording tweaks are very welcome over there.