Skip to content

chore: refactor --help and remove deprecated add alias#32

Merged
Loongphy merged 2 commits intomainfrom
codex/cli-surface-cleanup
Mar 26, 2026
Merged

chore: refactor --help and remove deprecated add alias#32
Loongphy merged 2 commits intomainfrom
codex/cli-surface-cleanup

Conversation

@Loongphy
Copy link
Copy Markdown
Owner

@Loongphy Loongphy commented Mar 26, 2026

What changed

  • Usage errors now produce actionable messages instead of silently showing help.
    Invalid invocations (unknown commands, missing values, duplicate flags) return exit code 2 with a specific error message pointing at the problem, rather than silently falling back to top-level help.

  • Every command supports --help / -h with command-specific output.
    codex-auth list --help, codex-auth import --help, etc. now show focused Usage and Examples sections for that command. codex-auth help works too.

  • add alias is gone.
    codex-auth add no longer works as a deprecated alias for codex-auth login. Use codex-auth login.

Note

Remove deprecated add alias for login and add command-specific --help support

  • Removes the deprecated codex-auth add alias for codex-auth login from the CLI, docs, and all deprecation warning code paths.
  • Refactors parseArgs in cli.zig to return a ParseResult union (either a parsed Command or a UsageError) instead of always defaulting to help on bad input.
  • Adds command-scoped help pages: help <command> and <command> --help now render targeted usage and examples for each subcommand.
  • Invalid CLI usage now prints a descriptive error with a usage hint to stderr and exits with code 2 (previously exited with code 1).
  • Removes non-table output formats (json, csv, compact) from format.printAccounts in format.zig, which now always renders the table view.
  • Behavioral Change: codex-auth add is no longer recognized as a valid command; callers using it will now receive a usage error instead of a deprecation warning.

Macroscope summarized 63ef466.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 26, 2026

Open in StackBlitz

@loongphy/codex-auth-darwin-arm64

npx https://pkg.pr.new/@loongphy/codex-auth-darwin-arm64@32

@loongphy/codex-auth-darwin-x64

npx https://pkg.pr.new/@loongphy/codex-auth-darwin-x64@32

@loongphy/codex-auth-linux-x64

npx https://pkg.pr.new/@loongphy/codex-auth-linux-x64@32

@loongphy/codex-auth-win32-x64

npx https://pkg.pr.new/@loongphy/codex-auth-win32-x64@32

@loongphy/codex-auth

npx https://pkg.pr.new/@loongphy/codex-auth@32

commit: 63ef466

@Loongphy Loongphy marked this pull request as ready for review March 26, 2026 07:11
@Loongphy Loongphy changed the title Clean up CLI surface and remove deprecated add alias chore: refactor --help and remove deprecated add alias Mar 26, 2026
@Loongphy
Copy link
Copy Markdown
Owner Author

Loongphy commented Mar 26, 2026

@macroscope review

@macroscopeapp
Copy link
Copy Markdown

macroscopeapp bot commented Mar 26, 2026

Just FYI for future @mentions, I'm Macroscope-App, not Macroscope.

I've triggered the review, but all code reviews were skipped. You can view the details here:

@macroscopeapp
Copy link
Copy Markdown

macroscopeapp bot commented Mar 26, 2026

Approvability

Verdict: Would Approve

This is a CLI refactoring that removes a previously-deprecated command alias (add), restructures help output to support per-command help topics, and improves error messages. The changes are mechanical refactoring by the repository owner with no impact on core runtime behavior beyond CLI UX.

Macroscope would have approved this PR. Enable approvability here.

@Loongphy Loongphy merged commit ee4110a into main Mar 26, 2026
11 checks passed
@Loongphy Loongphy deleted the codex/cli-surface-cleanup branch March 26, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant