feat(MaaPiCli): 重构为基于子命令的 CLI,新增任务配置文件支持与运行进度输出#1346
Open
srdr0p wants to merge 1 commit into
Open
Conversation
- 用子命令(run / list / generate-config pi|task)替换原有的 -d 标志,提升可用性 - `run`:运行任务,支持通过 --task-config 指定 TOML/JSON 配置文件覆盖任务列表与选项 - `list`:列出所有可用控制器、任务和选项 - `generate-config pi`:非交互式生成 maa_pi_config.json,支持指定控制器/资源/ADB设备过滤 - `generate-config task`:生成含默认选项值的示例任务配置文件(TOML) - 新增 TaskConfig 模块:支持解析 TOML/JSON 格式的任务配置文件,并将其 override 到运行时配置 - 新增 ProgressSink 模块:在 Runner 中集成可配置进度输出(0=静默,1=任务级,2=任务+节点) - 修复 reconfig_adb 返回 std::optional,ADB 设备未找到时提前报错返回而非静默使用原参数 - load() 新增 interactive 参数,非交互模式下跳过 mpause() 阻塞,支持脚本/CI 调用 - 引入 CLI11 和 tomlplusplus 第三方库
Contributor
There was a problem hiding this comment.
Sorry @srdr0p, your pull request is larger than the review limit of 150000 diff characters
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.
feat(MaaPiCli): 重构 CLI 接口,支持非交互式/脚本化运行
原版 MaaPiCli 只能通过交互式菜单逐步操作,无法用于 CI/CD、
定时任务或脚本自动化场景。本次重构将其改造为标准子命令式 CLI。
新增子命令:
generate-config pi:非交互式生成 maa_pi_config.json,run [--task-config <file>]:运行任务,可通过 TOML/JSON配置文件指定本次运行的任务列表与选项覆盖,无需重走交互流程
不带参数时与原来的
-d等价。--task-config用于临时指定任务,比如临时跑单个任务。此时会复用maa_pi_config.json中的选项list:列出所有可用控制器、任务和选项支持 --controller / --resource / --adb-controller 参数
generate-config task:生成含默认值的示例任务配置文件(TOML)其他改进: