Skip to content

[codex] fix cli argv parsing and sdk parity#229

Merged
MajorTal merged 1 commit into
mainfrom
codex/tdd-bug-batch
May 2, 2026
Merged

[codex] fix cli argv parsing and sdk parity#229
MajorTal merged 1 commit into
mainfrom
codex/tdd-bug-batch

Conversation

@MajorTal
Copy link
Copy Markdown
Collaborator

@MajorTal MajorTal commented May 2, 2026

Summary

Fixes the requested TDD bug batch:

  • Overhauls the affected per-command CLI flag handling for --flag=value, unknown flag rejection, numeric validation, and structured blob upload failures.
  • Tightens active-project fallback so mistyped project IDs no longer silently route selected commands to the active project, while preserving intentional active-project shorthand where it is useful.
  • Replaces misleading example project IDs with prj_... examples across CLI help/docs.
  • Adds SDK methods and CLI-style aliases for the missing parity gaps, including projects.sql, projects.rest, projects.applyExpose, projects.getExpose, auth.providers, scoped wrappers, and alias ergonomics.

Root Cause

Several CLI modules had local, permissive flag loops that silently ignored unknown options, did not normalize equals-form flags, and parsed numeric values with parseInt without range checks. Project command routing also relied on a broad active-project heuristic that treated non-prj_ first positionals as command arguments even when they were likely mistyped project IDs. The SDK sync map still marked some CLI capabilities as CLI-only even though they should be available through the SDK.

Validation

  • node --test cli-argv.test.mjs
  • npm run build && npm test && npm run test:docs
  • git diff --check

Comment thread cli-argv.test.mjs Fixed
@MajorTal MajorTal force-pushed the codex/tdd-bug-batch branch from 93a4199 to 7b7b91b Compare May 2, 2026 08:54
@MajorTal MajorTal marked this pull request as ready for review May 2, 2026 08:56
@MajorTal MajorTal merged commit e981c5d into main May 2, 2026
4 checks passed
@MajorTal MajorTal deleted the codex/tdd-bug-batch branch May 2, 2026 08:57
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.

2 participants