fix: resolve duplicate option registration in export and import commands#54
Open
tianhaocui wants to merge 1 commit intoopen-gitagent:mainfrom
Open
fix: resolve duplicate option registration in export and import commands#54tianhaocui wants to merge 1 commit intoopen-gitagent:mainfrom
tianhaocui wants to merge 1 commit intoopen-gitagent:mainfrom
Conversation
The `export` and `import` commands each registered the same required option twice (once for gemini, once for codex), causing commander to throw on startup and making the entire CLI unusable. Additionally, `case 'codex'` was placed inside the `default` branch in both switch statements, so it could never be matched correctly. Changes: - Merge duplicate `.requiredOption()` calls into a single call listing all supported formats - Move `case 'codex'` out of `default` as an independent case with its own `break` Fixes open-gitagent#53 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
What
Fix duplicate
.requiredOption()registration inexportandimportcommands that crashes the entire CLI on startup.Why
After installing v0.1.0 via
npm i -g @open-gitagent/gitagent, every CLI command fails — not justexport/import, but evengitagent initandgitagent info— because commander throws during module loading.Two bugs in both
export.tsandimport.ts:.requiredOption()called twice with the same flag (once for gemini, once for codex)case 'codex'placed insidedefaultbranch, unreachableCloses #53
How Tested
npm run buildpassesgitagent validatepasses on example agentsAfter patching:
gitagent --version→0.1.0(no crash)gitagent info→ displays agent summarygitagent validate→ validation passedgitagent export --format claude-code→ correct outputChecklist