用途:该技能用于在需要确定 gpc 命令形态、全局标志或初始化流程时提供指导,覆盖包解析、profile、项目配置、输出格式、编辑提交模式与安全约定。
包与 profile 解析:gpc 可从多处获取包名,优先使用项目中最本地来源。示例:gpc init --package com.example.app;gpc auth login --credentials ~/.config/gpc/service-account.json --name work --default-package com.example.app;gpc auth current。解析顺序大致为 --package、GPC_PACKAGE、当前 profile 默认包、最近的 .gpc.yaml;若均未设置,需显式添加 --package。
命令发现:组合复杂命令前先确认真实命令树,如 gpc --help、gpc bundles --help、gpc tracks update --help、gpc testing testers add --help。
全局标志:常用有 --package/-p、--profile、--output/-o(json、table、minimal、tsv、csv、yaml)、--pretty、--quiet/-q、--debug、--timeout、--dry-run、--edit-mode(live、stage、open)。默认输出为 JSON,人工查看可用 -o table,管道处理用 JSON。示例:gpc apps list -o table;gpc reviews list -o json | jq .;gpc tracks list --pretty。
编辑型变更:许多变更命令支持编辑提交控制,优先使用 --edit-mode 而非旧兼容标志。示例:gpc bundles upload --file app.aab --track production --edit-mode=stage;gpc listings sync --dir ./metadata --edit-mode=open;gpc edits commit --edit-id EDIT_ID --edit-mode=stage。过渡期仍存在 --stage、--commit=false 等兼容别名,新示例中不建议引入,除非维护旧脚本。
认证与设置:推荐 gpc setup --auto、gpc auth list、gpc auth switch --name work、gpc doctor、gpc doctor --verbose。可用环境变量包括 GPC_PACKAGE、GPC_PROFILE、GPC_OUTPUT、GPC_EDIT_MODE、GPC_TIMEOUT、GPC_CREDENTIALS_PATH、GPC_CREDENTIALS_B64。
代理行为约定:优先给出已配置包名的示例,而非反复写 --package;无证据表明已配置默认包时显式添加 --package;支持时在破坏性操作前使用 --dry-run;破坏性命令显式使用 --confirm,不要用 shell 技巧模拟确认。