pp-cloud-run-admin
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGoogle Cloud Run — Printing Press CLI
Google Cloud Run — Printing Press CLI
Prerequisites: Install the CLI
前提条件:安装CLI
This skill drives the binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:
cloud-run-admin-pp-cli- Install via the Printing Press installer:
bash
npx -y @mvanhorn/printing-press install cloud-run-admin --cli-only - Verify:
cloud-run-admin-pp-cli --version - Ensure (or
$GOPATH/bin) is on$HOME/go/bin.$PATH
If the install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.25+):
npxbash
go install github.com/mvanhorn/printing-press-library/library/cloud/cloud-run-admin/cmd/cloud-run-admin-pp-cli@latestIf reports "command not found" after install, the install step did not put the binary on . Do not proceed with skill commands until verification succeeds.
--version$PATHThis CLI wraps the Cloud Run Admin API directly for services, jobs, executions, tasks, operations, revisions, and IAM helpers. It complements gcloud by giving agents a smaller API-shaped surface with JSON-first output, field selection, local sync, search, analytics, and workflow commands.
本技能基于二进制文件运行。在调用本技能的任何命令之前,必须确认CLI已安装。 如果未安装,请先执行以下步骤:
cloud-run-admin-pp-cli- 通过Printing Press安装程序安装:
bash
npx -y @mvanhorn/printing-press install cloud-run-admin --cli-only - 验证:
cloud-run-admin-pp-cli --version - 确保(或
$GOPATH/bin)已添加到$HOME/go/bin环境变量中。$PATH
如果安装失败(无Node环境、离线等),可改用Go直接安装(需Go 1.25+版本):
npxbash
go install github.com/mvanhorn/printing-press-library/library/cloud/cloud-run-admin/cmd/cloud-run-admin-pp-cli@latest如果安装后执行提示“command not found”,说明安装程序未将二进制文件添加到中。请在验证成功前不要执行技能命令。
--version$PATH该CLI直接封装了Cloud Run Admin API,可用于管理服务、任务、执行记录、作业、操作、版本以及IAM辅助功能。它作为gcloud的补充,为Agent提供了更精简的API操作界面,支持优先输出JSON、字段选择、本地同步、搜索、分析和工作流命令。
When to Use This CLI
何时使用该CLI
Use this CLI when an agent or script needs focused Cloud Run Admin API access without navigating the full gcloud surface. It is strongest for read-heavy inspection, local inventory sync, search, field-selected JSON, and workflows that correlate services, jobs, executions, revisions, tasks, and operations.
当Agent或脚本需要专注访问Cloud Run Admin API,而无需使用完整的gcloud工具时,可使用该CLI。它在以下场景中表现出色:以读取为主的检查操作、本地资源清单同步、搜索、字段筛选JSON输出,以及关联服务、任务、执行记录、版本、作业和操作的工作流。
Unique Capabilities
独特功能
These capabilities aren't available in any other tool for this API.
这些功能是其他同类型API工具所不具备的。
Agent-native Cloud Run operations
Agent原生Cloud Run操作
-
— Lists Cloud Run services through the Admin API with agent-friendly JSON, compact output, and field selection.
services listUse this when an agent needs a compact inventory of Cloud Run services in a project and region.bashcloud-run-admin-pp-cli services list projects/PROJECT_ID/locations/REGION --agent --select services.name,services.uri,nextPageToken
-
— 通过Admin API列出Cloud Run服务,输出Agent友好的JSON格式、精简内容,并支持字段选择。
services list当Agent需要获取某个项目和区域内Cloud Run服务的精简清单时,可使用此命令。bashcloud-run-admin-pp-cli services list projects/PROJECT_ID/locations/REGION --agent --select services.name,services.uri,nextPageToken
Local state and analysis
本地状态与分析
-
— Syncs Cloud Run resources into a local SQLite store so services, jobs, revisions, executions, tasks, and operations can be searched without repeating every API call.
syncUse this before offline search, SQL inspection, or repeated multi-resource analysis.bashcloud-run-admin-pp-cli sync --json -
— Searches synced Cloud Run inventory locally or falls back to live API calls depending on the data-source mode.
searchUse this when you need to locate Cloud Run resources by remembered fragments.bashcloud-run-admin-pp-cli search "api" --type services --json --select resource_type,title -
— Runs local analysis against synced Cloud Run data for inventory and status-oriented questions.
analyticsUse this after sync when the question is about trends or inventory health rather than a single resource.bashcloud-run-admin-pp-cli analytics --json
-
— 将Cloud Run资源同步到本地SQLite存储中,这样无需重复调用API即可搜索服务、任务、版本、执行记录、作业和操作。
sync在进行离线搜索、SQL检查或重复的多资源分析前,可使用此命令。bashcloud-run-admin-pp-cli sync --json -
— 搜索已同步的Cloud Run本地资源清单,或根据数据源模式回退到实时API调用。
search当你需要通过记忆片段定位Cloud Run资源时,可使用此命令。bashcloud-run-admin-pp-cli search "api" --type services --json --select resource_type,title -
— 针对已同步的Cloud Run数据执行本地分析,以回答资源清单和状态相关的问题。
analytics同步完成后,当问题涉及趋势或资源清单健康状况而非单个资源时,可使用此命令。bashcloud-run-admin-pp-cli analytics --json
Workflow status checks
工作流状态检查
-
— Provides compound workflows that combine multiple Cloud Run Admin API operations into one operator-facing flow.
workflowUse this when the task spans more than one Cloud Run resource type.bashcloud-run-admin-pp-cli workflow --help
-
— 提供复合工作流,将多个Cloud Run Admin API操作组合为面向操作者的单一流程。
workflow当任务涉及多种Cloud Run资源类型时,可使用此命令。bashcloud-run-admin-pp-cli workflow --help
HTTP Transport
HTTP传输
This CLI uses Chrome-compatible HTTP transport for browser-facing endpoints. It does not require a resident browser process for normal API calls.
该CLI使用兼容Chrome的HTTP传输协议处理浏览器端端点。正常API调用无需常驻浏览器进程。
Command Reference
命令参考
cloud-run-admin-jobs — Manage cloud run admin jobs
- — Creates a Job.
cloud-run-admin-pp-cli cloud-run-admin-jobs create - — Lists Jobs.
cloud-run-admin-pp-cli cloud-run-admin-jobs list - — Triggers creation of a new Execution of this Job.
cloud-run-admin-pp-cli cloud-run-admin-jobs run
executions — Manage executions
operations — Manage operations
- — Lists operations that match the specified filter in the request. If the server doesn't support this method, it...
cloud-run-admin-pp-cli operations list - — Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the...
cloud-run-admin-pp-cli operations wait
services — Manage services
- — Creates a new Service in a given project and location.
cloud-run-admin-pp-cli services create - — Gets the IAM Access Control policy currently in effect for the given Cloud Run Service. This result does not include...
cloud-run-admin-pp-cli services get-iam-policy - — Lists Services.
cloud-run-admin-pp-cli services list - — Updates a Service.
cloud-run-admin-pp-cli services patch - — Sets the IAM Access control policy for the specified Service. Overwrites any existing policy.
cloud-run-admin-pp-cli services set-iam-policy - — Returns permissions that a caller has on the specified Project. There are no permissions required for making this...
cloud-run-admin-pp-cli services test-iam-permissions
cloud-run-admin-jobs — 管理Cloud Run Admin任务
- — 创建任务。
cloud-run-admin-pp-cli cloud-run-admin-jobs create - — 列出任务。
cloud-run-admin-pp-cli cloud-run-admin-jobs list - — 触发任务的新执行记录创建。
cloud-run-admin-pp-cli cloud-run-admin-jobs run
executions — 管理执行记录
operations — 管理操作
- — 列出与请求中指定筛选条件匹配的操作。如果服务器不支持此方法,则...
cloud-run-admin-pp-cli operations list - — 等待指定的长时间运行操作完成或达到指定超时时间,返回...
cloud-run-admin-pp-cli operations wait
services — 管理服务
- — 在指定项目和位置创建新服务。
cloud-run-admin-pp-cli services create - — 获取当前对指定Cloud Run服务生效的IAM访问控制策略。此结果不包含...
cloud-run-admin-pp-cli services get-iam-policy - — 列出服务。
cloud-run-admin-pp-cli services list - — 更新服务。
cloud-run-admin-pp-cli services patch - — 为指定服务设置IAM访问控制策略,覆盖现有策略。
cloud-run-admin-pp-cli services set-iam-policy - — 返回调用者在指定项目上拥有的权限。执行此操作无需任何权限...
cloud-run-admin-pp-cli services test-iam-permissions
Finding the right command
查找合适的命令
When you know what you want to do but not which command does it, ask the CLI directly:
bash
cloud-run-admin-pp-cli which "<capability in your own words>"which02--help当你知道要执行的操作但不确定对应命令时,可直接询问CLI:
bash
cloud-run-admin-pp-cli which "<用你自己的语言描述功能>"which02--helpRecipes
使用示例
Find the right Cloud Run command
查找合适的Cloud Run命令
bash
cloud-run-admin-pp-cli which "show service revisions" --jsonUse intent search before calling a specific Cloud Run Admin command.
bash
cloud-run-admin-pp-cli which "show service revisions" --json在调用特定Cloud Run Admin命令前,先使用意图搜索。
List services with compact agent output
以精简Agent输出格式列出服务
bash
cloud-run-admin-pp-cli services list projects/PROJECT_ID/locations/REGION --agent --select services.name,services.uri,nextPageTokenCombines agent defaults with field selection so agents avoid parsing large service payloads.
bash
cloud-run-admin-pp-cli services list projects/PROJECT_ID/locations/REGION --agent --select services.name,services.uri,nextPageToken结合Agent默认设置与字段选择,避免Agent解析庞大的服务负载。
Search synced inventory
搜索已同步的资源清单
bash
cloud-run-admin-pp-cli search "api" --type services --json --select resource_type,titleSearch local Cloud Run inventory after a sync.
bash
cloud-run-admin-pp-cli search "api" --type services --json --select resource_type,title同步完成后搜索本地Cloud Run资源清单。
Auth Setup
认证设置
Cloud Run Admin uses Google OAuth bearer tokens with the cloud-platform scope. For local use, run and export the value as ; do not commit the token or paste it into docs.
gcloud auth print-access-tokenCLOUD_RUN_ADMIN_OAUTH2CRun to verify setup.
cloud-run-admin-pp-cli doctorCloud Run Admin使用带有cloud-platform作用域的Google OAuth承载令牌。本地使用时,执行并将结果导出为环境变量;请勿提交令牌或将其粘贴到文档中。
gcloud auth print-access-tokenCLOUD_RUN_ADMIN_OAUTH2C执行验证设置是否正确。
cloud-run-admin-pp-cli doctorAgent Mode
Agent模式
Add to any command. Expands to: .
--agent--json --compact --no-input --no-color --yes-
Pipeable — JSON on stdout, errors on stderr
-
Filterable —keeps a subset of fields. Dotted paths descend into nested structures; arrays traverse element-wise. Critical for keeping context small on verbose APIs:
--selectbashcloud-run-admin-pp-cli cloud-run-admin-jobs list mock-value --agent --select id,name,status -
Previewable —shows the request without sending
--dry-run -
Offline-friendly — sync/search commands can use the local SQLite store when available
-
Non-interactive — never prompts, every input is a flag
-
Explicit retries — useonly when an already-existing create should count as success, and
--idempotentonly when a missing delete target should count as success--ignore-missing
在任何命令后添加参数,等效于:。
--agent--json --compact --no-input --no-color --yes-
可管道传输 — JSON输出到标准输出,错误信息输出到标准错误
-
可筛选 —参数保留字段子集。点路径可深入嵌套结构;数组可遍历元素。这对于在冗长API中缩小上下文范围至关重要:
--selectbashcloud-run-admin-pp-cli cloud-run-admin-jobs list mock-value --agent --select id,name,status -
可预览 —参数显示请求内容但不发送
--dry-run -
离线友好 — 同步/搜索命令在可用时可使用本地SQLite存储
-
非交互式 — 从不提示,所有输入均通过标志参数提供
-
显式重试 — 仅当已存在的创建操作应视为成功时使用;仅当缺失的删除目标应视为成功时使用
--idempotent--ignore-missing
Response envelope
响应信封
Commands that read from the local store or the API wrap output in a provenance envelope:
json
{
"meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
"results": <data>
}Parse for data and to know whether it's live or local. A human-readable summary is printed to stderr only when stdout is a terminal — piped/agent consumers get pure JSON on stdout.
.results.meta.sourceN results (live)从本地存储或API读取数据的命令会将输出包装在来源信封中:
json
{
"meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
"results": <data>
}解析获取数据,可判断数据是实时还是本地来源。仅当标准输出为终端时,才会将人类可读的摘要输出到标准错误;管道/Agent消费者仅会在标准输出获取纯JSON。
.results.meta.sourceN results (live)Agent Feedback
Agent反馈
When you (or the agent) notice something off about this CLI, record it:
cloud-run-admin-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
cloud-run-admin-pp-cli feedback --stdin < notes.txt
cloud-run-admin-pp-cli feedback list --json --limit 10Entries are stored locally at . They are never POSTed unless is set AND either is passed or . Default behavior is local-only.
~/.cloud-run-admin-pp-cli/feedback.jsonlCLOUD_RUN_ADMIN_FEEDBACK_ENDPOINT--sendCLOUD_RUN_ADMIN_FEEDBACK_AUTO_SEND=trueWrite what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.
当你(或Agent)发现该CLI存在问题时,可记录反馈:
cloud-run-admin-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
cloud-run-admin-pp-cli feedback --stdin < notes.txt
cloud-run-admin-pp-cli feedback list --json --limit 10反馈条目存储在本地文件中。仅当设置了且传递了参数或设置时,才会发送反馈。默认行为仅存储在本地。
~/.cloud-run-admin-pp-cli/feedback.jsonlCLOUD_RUN_ADMIN_FEEDBACK_ENDPOINT--sendCLOUD_RUN_ADMIN_FEEDBACK_AUTO_SEND=true请记录让你感到意外的内容,而非正式的错误报告。简短、具体、单行描述:这才是有价值的部分。
Output Delivery
输出交付
Every command accepts . The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:
--deliver <sink>| Sink | Effect |
|---|---|
| Default; write to stdout only |
| Atomically write output to |
| POST the output body to the URL ( |
Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.
每个命令都支持参数。输出会发送到指定目标,同时(或替代)输出到标准输出,这样Agent无需手动管道即可路由命令结果。支持三种目标:
--deliver <sink>| 目标 | 效果 |
|---|---|
| 默认值;仅输出到标准输出 |
| 原子性地将输出写入 |
| 将输出体POST到指定URL(当使用 |
未知格式会被拒绝,并返回包含支持格式的结构化错误。Webhook失败时返回非零退出码,并在标准错误中记录URL和HTTP状态码。
Named Profiles
命名配置文件
A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.
cloud-run-admin-pp-cli profile save briefing --json
cloud-run-admin-pp-cli --profile briefing cloud-run-admin-jobs list mock-value
cloud-run-admin-pp-cli profile list --json
cloud-run-admin-pp-cli profile show briefing
cloud-run-admin-pp-cli profile delete briefing --yesExplicit flags always win over profile values; profile values win over defaults. lists all available profiles under so introspecting agents discover them at runtime.
agent-contextavailable_profiles配置文件是一组保存的标志值,可在多次调用中复用。当定时Agent每次运行都使用相同配置调用同一命令时,可使用此功能(HeyGen的"Beacon"模式)。
cloud-run-admin-pp-cli profile save briefing --json
cloud-run-admin-pp-cli --profile briefing cloud-run-admin-jobs list mock-value
cloud-run-admin-pp-cli profile list --json
cloud-run-admin-pp-cli profile show briefing
cloud-run-admin-pp-cli profile delete briefing --yes显式标志始终优先于配置文件值;配置文件值优先于默认值。会在下列出所有可用配置文件,以便内省Agent在运行时发现它们。
agent-contextavailable_profilesExit Codes
退出码
| Code | Meaning |
|---|---|
| 0 | Success |
| 2 | Usage error (wrong arguments) |
| 3 | Resource not found |
| 4 | Authentication required |
| 5 | API error (upstream issue) |
| 7 | Rate limited (wait and retry) |
| 10 | Config error |
| 代码 | 含义 |
|---|---|
| 0 | 成功 |
| 2 | 使用错误(参数错误) |
| 3 | 资源未找到 |
| 4 | 需要认证 |
| 5 | API错误(上游问题) |
| 7 | 速率限制(等待后重试) |
| 10 | 配置错误 |
Argument Parsing
参数解析
Parse :
$ARGUMENTS- Empty, , or
help→ show--helpoutputcloud-run-admin-pp-cli --help - Starts with → ends with
install→ MCP installation; otherwise → see Prerequisites abovemcp - Anything else → Direct Use (execute as CLI command with )
--agent
解析的规则:
$ARGUMENTS- 为空、或
help→ 显示--help输出cloud-run-admin-pp-cli --help - 以开头 → 结尾为
install→ MCP安装;否则 → 参见上方前提条件部分mcp - 其他情况 → 直接使用(以标志执行CLI命令)
--agent
MCP Server Installation
MCP服务器安装
- Install the MCP server:
bash
go install github.com/mvanhorn/printing-press-library/library/cloud/cloud-run-admin/cmd/cloud-run-admin-pp-mcp@latest - Register with Claude Code:
bash
claude mcp add cloud-run-admin-pp-mcp -- cloud-run-admin-pp-mcp - Verify:
claude mcp list
- 安装MCP服务器:
bash
go install github.com/mvanhorn/printing-press-library/library/cloud/cloud-run-admin/cmd/cloud-run-admin-pp-mcp@latest - 注册到Claude Code:
bash
claude mcp add cloud-run-admin-pp-mcp -- cloud-run-admin-pp-mcp - 验证:
claude mcp list
Direct Use
直接使用
- Check if installed: If not found, offer to install (see Prerequisites at the top of this skill).
which cloud-run-admin-pp-cli - Match the user query to the best command from the Unique Capabilities and Command Reference above.
- Execute with the flag:
--agentbashcloud-run-admin-pp-cli <command> [subcommand] [args] --agent - If ambiguous, drill into subcommand help: .
cloud-run-admin-pp-cli <command> --help
- 检查是否已安装:如果未找到,提供安装选项(参见顶部前提条件部分)。
which cloud-run-admin-pp-cli - 将用户查询与上方独特功能和命令参考中的最佳命令匹配。
- 使用标志执行:
--agentbashcloud-run-admin-pp-cli <command> [subcommand] [args] --agent - 如果存在歧义,查看子命令帮助:。
cloud-run-admin-pp-cli <command> --help