fix(cli): normalize boolean arg aliases in commander adapter#585
Merged
jackwener merged 1 commit intojackwener:mainfrom Mar 29, 2026
Merged
fix(cli): normalize boolean arg aliases in commander adapter#585jackwener merged 1 commit intojackwener:mainfrom
jackwener merged 1 commit intojackwener:mainfrom
Conversation
Owner
|
Thanks for the fix. I reviewed it locally, confirmed the boolean alias regression is covered by tests, and merged it after typecheck/build passed. |
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.
Summary
This PR fixes boolean argument normalization in the Commander adapter by treating
type: 'boolean'as an alias oftype: 'bool'.Why
The registry currently uses both
boolandbooleanin command definitions.However,
normalizeArgValue()only recognizedbool, so commands usingtype: 'boolean'could receive string values like"false"instead of the real booleanfalse.Because
"false"is truthy in JavaScript, this could flip command behavior in subtle but real ways.Impact
This affects commands that define boolean flags with
type: 'boolean', especially when the default isfalseor when the user explicitly passes--flag false.Examples in the current tree include:
reddit save --undoboss mark --removetwitter reply-dm --skip-repliedChanges
normalizeArgValue()to accept bothboolandbooleantype: 'boolean'falseand explicit--undo falseare normalized to real booleansVerification
npx vitest run src/commanderAdapter.test.tsnpm run typecheckBoth passed locally.
Scope
This PR intentionally keeps the fix minimal and does not add new metadata validation rules for argument types.