Skip to content

[WIP] Replace yargs with native util.parseArgs for argument parsing#2530

Draft
Copilot wants to merge 1 commit intomainfrom
copilot/replace-yargs-with-util-parseargs
Draft

[WIP] Replace yargs with native util.parseArgs for argument parsing#2530
Copilot wants to merge 1 commit intomainfrom
copilot/replace-yargs-with-util-parseargs

Conversation

Copy link
Contributor

Copilot AI commented Mar 5, 2026

  • Analyze the current yargs usage in lib/cli.js
  • Rewrite lib/cli.js to use Node.js native util.parseArgs instead of yargs
    • Implement command routing with alias support
    • Implement global and per-command option parsing
    • Implement --no-X boolean negation pre-processing
    • Implement multi-character alias expansion (e.g. --sv--skipValidation)
    • Implement help text output (--help)
    • Implement --version support
    • Preserve all existing command handlers and validation
    • Coerce commitHistory string → number after parsing (util.parseArgs only supports 'string'/'boolean' types)
  • Remove yargs from dependencies and @types/yargs from devDependencies in package.json
  • Remove yargs JSDoc reference from lib/index.js
  • Fix typos from code review: continouslycontinuously, environmetnsenvironments, don notdo not
  • Fix grammar from code review: Interactive questionsSkip interactive questions
  • All 302 tests pass, linter shows no new errors, CodeQL shows 0 alerts
Original prompt

This section details on the original issue you should resolve

<issue_title>[TASK] replace yargs with native util.parseArgs([config])</issue_title>
<issue_description>Docs: https://nodejs.org/api/util.html#utilparseargsconfig

We should check if this has any drawbacks because yargs is quite heavy</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@JoernBerkefeld
Copy link
Contributor

@copilot try again

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.

[TASK] replace yargs with native util.parseArgs([config])

2 participants