refactor: decouple flag parsing, extract status-bar, cleanup dead code#12
Merged
RyanLee-Dev merged 1 commit intomainfrom Apr 1, 2026
Merged
refactor: decouple flag parsing, extract status-bar, cleanup dead code#12RyanLee-Dev merged 1 commit intomainfrom
RyanLee-Dev merged 1 commit intomainfrom
Conversation
- args.ts: replace hardcoded boolean/number/array lists with schema-driven parseFlags(argv, OptionDef[]) + scanCommandPath(); adding a new flag no longer requires touching the parser - command.ts: add GLOBAL_OPTIONS as the single source of truth for global flag types; main.ts merges with command options for two-pass parsing - output/status-bar.ts: extract status-bar rendering out of http.ts; HTTP client is now pure transport with no UI concerns - registry.ts: remove commented-out File API dead code - package.json: add build:dev for single-platform Bun standalone binary - commands: annotate numeric (type:'number') and array (type:'array') flags in text/chat, speech/synthesize, music/generate, video/generate, image/generate Co-Authored-By: Claude Sonnet 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.
Summary
scanCommandPath快速扫位置参数,parseFlags(argv, OptionDef[])从 schema 推导 flag 类型(boolean/number/array),消除原有硬编码列表——加新 flag 不再需要改解析器GLOBAL_OPTIONS作为全局 flag 类型的唯一来源,main.ts合并命令 options 后一起传入解析器http.ts中剥离,HTTP client 不再含任何 UI 代码build:dev脚本,用bun build --compile --minify产出当前平台独立二进制type字段Test plan
bun run typecheck通过minimax --help正常输出minimax text chat --helpflag 列表正确bun run build:dev产出dist/minimax可执行文件🤖 Generated with Claude Code