Skip to content

packages/cli: register.ts/whoami.ts/logout.ts examples say os auth ... — that topic does not resolve (Command auth:whoami not found.) #11221

Description

@os-elon

Found while implementing #10967 (environments/*.tsos projectsos environments) — same defect class, different files, unrelated topic history, so filing separately rather than folding in.

What's wrong

Three commands live at the root of packages/cli/src/commands/ (no topic directory), so oclif's pattern-strategy loader (processCommandIds in @oclif/core) registers them under their bare file name — register, whoami, logout. But their static override examples (live, user-facing --help output) and exported class names both spell a os auth <cmd> shape that has never resolved:

FileRegistered id (real)examples claimClass name
register.ts:66-68registeros auth register (×3)AuthRegister
whoami.ts:12-14whoamios auth whoami (×3)AuthWhoami
logout.ts:12logoutos auth logout (×1)AuthLogout

Verified against the built CLI at this tree's HEAD:

$ node packages/cli/bin/run.js auth whoami --help
› Error: Command auth:whoami not found.
$ node packages/cli/bin/run.js auth register --help
› Error: Command auth:register not found.
$ node packages/cli/bin/run.js whoami --help
Show current session information
USAGE
$ os whoami [-u <value>] [-t <value>] [-f json|table|yaml]

A user who copy-pastes os auth whoami (or register/logout) straight out of --help hits a dead command — the same shape #10927 and #10967 both fixed for other topics, sourced from the CLI binary itself.

What's actually fine

The class name has no effect on the registered id (file-path-derived, confirmed via --help above and by reading processCommandIds in the installed @oclif/core's lib/config/plugin.js) — so AuthRegister/AuthWhoami/AuthLogout are internally-consistent stale naming, not a functional bug on their own. login.ts is clean — its examples already say $ os login (no stale auth prefix), so it is not part of this card.

Suggested fix

Same three-part shape as #10967:

Not fixed here: out of scope for #10967's dispatched file surface (packages/cli/src/commands/environments/* only). No assignee.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions