Plan + first step: migrate CLI option parsing from yargs-parser to commander@14#1303
Draft
ecraig12345 with Copilot wants to merge 6 commits into
Draft
Plan + first step: migrate CLI option parsing from yargs-parser to commander@14#1303ecraig12345 with Copilot wants to merge 6 commits into
ecraig12345 with Copilot wants to merge 6 commits into
Conversation
Copilot created this pull request from a session on behalf of
ecraig12345
July 3, 2026 08:03
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Groundwork for replacing
yargs-parserwithcommander@14ingetCliOptions.ts. For now all options live on a single command and commander is used only for parsing, not dispatch. This PR delivers the migration plan plus the first implementation step; the permissive-syntax gaps are deferred to follow-up steps.commander-migration-plan.md(temporary planning doc):getCliOptions.test.ts→ commander support (native / needs workaround / infeasible).=values),argParserrepeat-detection for non-array options, an argv normalization pass (camelCase flags, extra long aliases like--config/--force/--since, boolean values via token/=), and a leftover mini-parser to restore arbitrary unknown-option type inference.-?, which commander can't accept as a short flag).yargs-parser, add change file, delete this doc).getCliOptions.ts: rewritten to build a single commanderCommandwith each option declared in its canonical dashed form only (string, numeric-with-validation, boolean +--no-negation, array variadic + collector), short aliases, and[command]/[extraArgs...]positionals. Post-parse logic (branch resolution, canary tag,NPM_TOKEN,_extraPositionalArgs, project-root lookup) is preserved.exitOverride()+ silenced output make it throw rather than exit.commander@^14.0.3.Not included by design: the remaining permissive yargs syntaxes (camelCase flags, long aliases, boolean values as tokens, unknown-option inference) still fail their tests and are addressed in later steps. No change file yet.
Open question for reviewers: drop
-?as a help alias, or normalize-?→--help?