Skip to content

refactor: infer flags type from options definition in defineCommand#60

Closed
lishengzxc wants to merge 1 commit into
feat/console-gateway-region-sitefrom
refactor/infer-flags-from-options
Closed

refactor: infer flags type from options definition in defineCommand#60
lishengzxc wants to merge 1 commit into
feat/console-gateway-region-sitefrom
refactor/infer-flags-from-options

Conversation

@lishengzxc

Copy link
Copy Markdown
Contributor

Generify CommandSpec and defineCommand so the run callback's flags parameter is typed as GlobalFlags & InferFlags<Options>, where InferFlags derives typed properties from the command's options array.

This removes ~150 manual as string / as number / as string[] type assertions across 46 command files.

Generify CommandSpec and defineCommand so the `run` callback's `flags`
parameter is typed as `GlobalFlags & InferFlags<Options>`, where
InferFlags derives typed properties from the command's `options` array.

This removes ~150 manual `as string` / `as number` / `as string[]`
type assertions across 46 command files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@XXPermanentXX

Copy link
Copy Markdown
Collaborator

This issue will be resolved through overall structural adjustments in the future.

@XXPermanentXX XXPermanentXX deleted the refactor/infer-flags-from-options branch June 17, 2026 08:04
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