关于 gpc-cli-usage
gpc-cli-usage 是面向 Google Play Console 工作流的命令行使用技能,帮助 Agent 安全地发现命令、配置认证并处理输出。它强调先查帮助、预览破坏性操作并显式确认。
主要功能
- 01命令与标志查阅
- 02认证配置和配置档切换
- 03多种输出格式
- 04干运行与显式确认
- 05认证诊断
适用场景
- 01检查应用列表并输出 JSON
- 02配置服务账号和默认应用包名
- 03排查认证或 API 访问问题
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ androidpoet/ playconsole-cli-skills --skill gpc-cli-usage安装后在 Claude Code 中输入/gpc-cli-usage确认已加载。
详细介绍
GPC CLI 用法
在需要为 Google Play Console 工作流运行或设计 gpc 命令时使用此技能。
命令查询
运行前始终确认命令和标志:
gpc --help
gpc tracks --help
gpc bundles upload --help
标志约定
- 使用明确的长标志:
--package、--track、--output。 - 不使用交互式提示;破坏性操作必须使用
--confirm。 - 短别名:
-p(package)、-o(output)、-q(quiet)。
输出格式
默认输出为压缩 JSON。可用格式:
gpc apps list -o json # Default, machine-readable
gpc apps list -o table # Human-readable columns
gpc apps list -o yaml # YAML format
gpc apps list -o csv # CSV for spreadsheets
gpc apps list -o tsv # Tab-separated
gpc apps list -o minimal # Compact output
gpc apps list --pretty # Pretty-print JSON
调试时使用 --pretty。自动化和通过管道传递给 jq 时使用 -o json(默认值)。
身份验证
配置配置文件
gpc auth login --credentials /path/to/service-account.json --name myprofile --default-package com.example.app
切换配置文件
gpc auth list
gpc auth current
gpc auth switch --name otherprofile
CI 环境变量
| 变量 | 用途 |
|---|---|
GPC_CREDENTIALS_PATH | 服务账号 JSON 的路径 |
GPC_CREDENTIALS_B64 | Base64 编码的凭据 |
GPC_PACKAGE | 默认包名 |
GPC_PROFILE | 默认身份验证配置文件 |
GPC_OUTPUT | 默认输出格式 |
诊断
gpc doctor # Check config, credentials, API access
gpc doctor --verbose # Detailed diagnostic output
全局标志
| 标志 | 短标志 | 描述 |
|---|---|---|
--package | -p | 应用包名(或 GPC_PACKAGE) |
--output | -o | 输出格式(json、table、yaml、csv、tsv、minimal) |
--pretty | 美化打印 JSON | |
--quiet | -q | 抑制非必要输出 |
--debug | 显示 API 请求/响应 | |
--dry-run | 预览但不应用更改 | |
--timeout | 请求超时时间(默认 60s) | |
--profile | 身份验证配置文件名称 |
安全性
- 执行破坏性操作前使用
--dry-run。 - 明确使用
--confirm标志;绝不要将yes通过管道传递给命令。 - 排查身份验证问题前,先检查
gpc doctor。
Agent 行为
- 除非确认已设置
GPC_PACKAGE,否则始终显式传入--package。 - 解析输出时优先使用
--output json;向用户展示结果时使用--output table。 - 出现身份验证错误时,先运行
gpc doctor。
评论
支持 Markdown