pp-cloud-run-admin

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Google Cloud Run — Printing Press CLI

Google Cloud Run — Printing Press CLI

Prerequisites: Install the CLI

前提条件:安装CLI

This skill drives the
cloud-run-admin-pp-cli
binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:
  1. Install via the Printing Press installer:
    bash
    npx -y @mvanhorn/printing-press install cloud-run-admin --cli-only
  2. Verify:
    cloud-run-admin-pp-cli --version
  3. Ensure
    $GOPATH/bin
    (or
    $HOME/go/bin
    ) is on
    $PATH
    .
If the
npx
install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.25+):
bash
go install github.com/mvanhorn/printing-press-library/library/cloud/cloud-run-admin/cmd/cloud-run-admin-pp-cli@latest
If
--version
reports "command not found" after install, the install step did not put the binary on
$PATH
. Do not proceed with skill commands until verification succeeds.
This 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.
本技能基于
cloud-run-admin-pp-cli
二进制文件运行。在调用本技能的任何命令之前,必须确认CLI已安装。 如果未安装,请先执行以下步骤:
  1. 通过Printing Press安装程序安装:
    bash
    npx -y @mvanhorn/printing-press install cloud-run-admin --cli-only
  2. 验证:
    cloud-run-admin-pp-cli --version
  3. 确保
    $GOPATH/bin
    (或
    $HOME/go/bin
    )已添加到
    $PATH
    环境变量中。
如果
npx
安装失败(无Node环境、离线等),可改用Go直接安装(需Go 1.25+版本):
bash
go install github.com/mvanhorn/printing-press-library/library/cloud/cloud-run-admin/cmd/cloud-run-admin-pp-cli@latest
如果安装后执行
--version
提示“command not found”,说明安装程序未将二进制文件添加到
$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操作

  • services list
    — Lists Cloud Run services through the Admin API with agent-friendly JSON, compact output, and field selection.
    Use this when an agent needs a compact inventory of Cloud Run services in a project and region.
    bash
    cloud-run-admin-pp-cli services list projects/PROJECT_ID/locations/REGION --agent --select services.name,services.uri,nextPageToken
  • services list
    — 通过Admin API列出Cloud Run服务,输出Agent友好的JSON格式、精简内容,并支持字段选择。
    当Agent需要获取某个项目和区域内Cloud Run服务的精简清单时,可使用此命令。
    bash
    cloud-run-admin-pp-cli services list projects/PROJECT_ID/locations/REGION --agent --select services.name,services.uri,nextPageToken

Local state and analysis

本地状态与分析

  • sync
    — 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.
    Use this before offline search, SQL inspection, or repeated multi-resource analysis.
    bash
    cloud-run-admin-pp-cli sync --json
  • search
    — Searches synced Cloud Run inventory locally or falls back to live API calls depending on the data-source mode.
    Use this when you need to locate Cloud Run resources by remembered fragments.
    bash
    cloud-run-admin-pp-cli search "api" --type services --json --select resource_type,title
  • analytics
    — Runs local analysis against synced Cloud Run data for inventory and status-oriented questions.
    Use this after sync when the question is about trends or inventory health rather than a single resource.
    bash
    cloud-run-admin-pp-cli analytics --json
  • sync
    — 将Cloud Run资源同步到本地SQLite存储中,这样无需重复调用API即可搜索服务、任务、版本、执行记录、作业和操作。
    在进行离线搜索、SQL检查或重复的多资源分析前,可使用此命令。
    bash
    cloud-run-admin-pp-cli sync --json
  • search
    — 搜索已同步的Cloud Run本地资源清单,或根据数据源模式回退到实时API调用。
    当你需要通过记忆片段定位Cloud Run资源时,可使用此命令。
    bash
    cloud-run-admin-pp-cli search "api" --type services --json --select resource_type,title
  • analytics
    — 针对已同步的Cloud Run数据执行本地分析,以回答资源清单和状态相关的问题。
    同步完成后,当问题涉及趋势或资源清单健康状况而非单个资源时,可使用此命令。
    bash
    cloud-run-admin-pp-cli analytics --json

Workflow status checks

工作流状态检查

  • workflow
    — Provides compound workflows that combine multiple Cloud Run Admin API operations into one operator-facing flow.
    Use this when the task spans more than one Cloud Run resource type.
    bash
    cloud-run-admin-pp-cli workflow --help
  • workflow
    — 提供复合工作流,将多个Cloud Run Admin API操作组合为面向操作者的单一流程。
    当任务涉及多种Cloud Run资源类型时,可使用此命令。
    bash
    cloud-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
  • cloud-run-admin-pp-cli cloud-run-admin-jobs create
    — Creates a Job.
  • cloud-run-admin-pp-cli cloud-run-admin-jobs list
    — Lists Jobs.
  • cloud-run-admin-pp-cli cloud-run-admin-jobs run
    — Triggers creation of a new Execution of this Job.
executions — Manage executions
operations — Manage operations
  • cloud-run-admin-pp-cli operations list
    — 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 wait
    — Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the...
services — Manage services
  • cloud-run-admin-pp-cli services create
    — Creates a new Service in a given project and location.
  • cloud-run-admin-pp-cli services get-iam-policy
    — 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 list
    — Lists Services.
  • cloud-run-admin-pp-cli services patch
    — Updates a Service.
  • cloud-run-admin-pp-cli services set-iam-policy
    — Sets the IAM Access control policy for the specified Service. Overwrites any existing policy.
  • cloud-run-admin-pp-cli services test-iam-permissions
    — Returns permissions that a caller has on the specified Project. There are no permissions required for making this...
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-admin-pp-cli services get-iam-policy
    — 获取当前对指定Cloud Run服务生效的IAM访问控制策略。此结果不包含...
  • cloud-run-admin-pp-cli services list
    — 列出服务。
  • cloud-run-admin-pp-cli services patch
    — 更新服务。
  • cloud-run-admin-pp-cli services set-iam-policy
    — 为指定服务设置IAM访问控制策略,覆盖现有策略。
  • 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>"
which
resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code
0
means at least one match; exit code
2
means no confident match — fall back to
--help
or use a narrower query.
当你知道要执行的操作但不确定对应命令时,可直接询问CLI:
bash
cloud-run-admin-pp-cli which "<用你自己的语言描述功能>"
which
命令会将自然语言的功能查询解析为该CLI精选功能索引中最匹配的命令。退出码
0
表示至少有一个匹配项;退出码
2
表示无匹配项,请回退到
--help
或使用更精确的查询。

Recipes

使用示例

Find the right Cloud Run command

查找合适的Cloud Run命令

bash
cloud-run-admin-pp-cli which "show service revisions" --json
Use 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,nextPageToken
Combines 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,title
Search 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
gcloud auth print-access-token
and export the value as
CLOUD_RUN_ADMIN_OAUTH2C
; do not commit the token or paste it into docs.
Run
cloud-run-admin-pp-cli doctor
to verify setup.
Cloud Run Admin使用带有cloud-platform作用域的Google OAuth承载令牌。本地使用时,执行
gcloud auth print-access-token
并将结果导出为
CLOUD_RUN_ADMIN_OAUTH2C
环境变量;请勿提交令牌或将其粘贴到文档中。
执行
cloud-run-admin-pp-cli doctor
验证设置是否正确。

Agent Mode

Agent模式

Add
--agent
to any command. Expands to:
--json --compact --no-input --no-color --yes
.
  • Pipeable — JSON on stdout, errors on stderr
  • Filterable
    --select
    keeps a subset of fields. Dotted paths descend into nested structures; arrays traverse element-wise. Critical for keeping context small on verbose APIs:
    bash
    cloud-run-admin-pp-cli cloud-run-admin-jobs list mock-value --agent --select id,name,status
  • Previewable
    --dry-run
    shows the request without sending
  • Offline-friendly — sync/search commands can use the local SQLite store when available
  • Non-interactive — never prompts, every input is a flag
  • Explicit retries — use
    --idempotent
    only when an already-existing create should count as success, and
    --ignore-missing
    only when a missing delete target should count as success
在任何命令后添加
--agent
参数,等效于:
--json --compact --no-input --no-color --yes
  • 可管道传输 — JSON输出到标准输出,错误信息输出到标准错误
  • 可筛选
    --select
    参数保留字段子集。点路径可深入嵌套结构;数组可遍历元素。这对于在冗长API中缩小上下文范围至关重要:
    bash
    cloud-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
.results
for data and
.meta.source
to know whether it's live or local. A human-readable
N results (live)
summary is printed to stderr only when stdout is a terminal — piped/agent consumers get pure JSON on stdout.
从本地存储或API读取数据的命令会将输出包装在来源信封中:
json
{
  "meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
  "results": <data>
}
解析
.results
获取数据,
.meta.source
可判断数据是实时还是本地来源。仅当标准输出为终端时,才会将人类可读的
N results (live)
摘要输出到标准错误;管道/Agent消费者仅会在标准输出获取纯JSON。

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 10
Entries are stored locally at
~/.cloud-run-admin-pp-cli/feedback.jsonl
. They are never POSTed unless
CLOUD_RUN_ADMIN_FEEDBACK_ENDPOINT
is set AND either
--send
is passed or
CLOUD_RUN_ADMIN_FEEDBACK_AUTO_SEND=true
. Default behavior is local-only.
Write 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.jsonl
文件中。仅当设置了
CLOUD_RUN_ADMIN_FEEDBACK_ENDPOINT
且传递了
--send
参数或设置
CLOUD_RUN_ADMIN_FEEDBACK_AUTO_SEND=true
时,才会发送反馈。默认行为仅存储在本地。
请记录让你感到意外的内容,而非正式的错误报告。简短、具体、单行描述:这才是有价值的部分。

Output Delivery

输出交付

Every command accepts
--deliver <sink>
. 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:
SinkEffect
stdout
Default; write to stdout only
file:<path>
Atomically write output to
<path>
(tmp + rename)
webhook:<url>
POST the output body to the URL (
application/json
or
application/x-ndjson
when
--compact
)
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.
每个命令都支持
--deliver <sink>
参数。输出会发送到指定目标,同时(或替代)输出到标准输出,这样Agent无需手动管道即可路由命令结果。支持三种目标:
目标效果
stdout
默认值;仅输出到标准输出
file:<path>
原子性地将输出写入
<path>
(先写入临时文件再重命名)
webhook:<url>
将输出体POST到指定URL(当使用
--compact
时为
application/json
application/x-ndjson
格式)
未知格式会被拒绝,并返回包含支持格式的结构化错误。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 --yes
Explicit flags always win over profile values; profile values win over defaults.
agent-context
lists all available profiles under
available_profiles
so introspecting agents discover them at runtime.
配置文件是一组保存的标志值,可在多次调用中复用。当定时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-context
会在
available_profiles
下列出所有可用配置文件,以便内省Agent在运行时发现它们。

Exit Codes

退出码

CodeMeaning
0Success
2Usage error (wrong arguments)
3Resource not found
4Authentication required
5API error (upstream issue)
7Rate limited (wait and retry)
10Config error
代码含义
0成功
2使用错误(参数错误)
3资源未找到
4需要认证
5API错误(上游问题)
7速率限制(等待后重试)
10配置错误

Argument Parsing

参数解析

Parse
$ARGUMENTS
:
  1. Empty,
    help
    , or
    --help
    → show
    cloud-run-admin-pp-cli --help
    output
  2. Starts with
    install
    → ends with
    mcp
    → MCP installation; otherwise → see Prerequisites above
  3. Anything else → Direct Use (execute as CLI command with
    --agent
    )
解析
$ARGUMENTS
的规则:
  1. 为空、
    help
    --help
    → 显示
    cloud-run-admin-pp-cli --help
    输出
  2. install
    开头
    → 结尾为
    mcp
    → MCP安装;否则 → 参见上方前提条件部分
  3. 其他情况 → 直接使用(以
    --agent
    标志执行CLI命令)

MCP Server Installation

MCP服务器安装

  1. 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
  2. Register with Claude Code:
    bash
    claude mcp add cloud-run-admin-pp-mcp -- cloud-run-admin-pp-mcp
  3. Verify:
    claude mcp list
  1. 安装MCP服务器:
    bash
    go install github.com/mvanhorn/printing-press-library/library/cloud/cloud-run-admin/cmd/cloud-run-admin-pp-mcp@latest
  2. 注册到Claude Code:
    bash
    claude mcp add cloud-run-admin-pp-mcp -- cloud-run-admin-pp-mcp
  3. 验证:
    claude mcp list

Direct Use

直接使用

  1. Check if installed:
    which cloud-run-admin-pp-cli
    If not found, offer to install (see Prerequisites at the top of this skill).
  2. Match the user query to the best command from the Unique Capabilities and Command Reference above.
  3. Execute with the
    --agent
    flag:
    bash
    cloud-run-admin-pp-cli <command> [subcommand] [args] --agent
  4. If ambiguous, drill into subcommand help:
    cloud-run-admin-pp-cli <command> --help
    .
  1. 检查是否已安装:
    which cloud-run-admin-pp-cli
    如果未找到,提供安装选项(参见顶部前提条件部分)。
  2. 将用户查询与上方独特功能和命令参考中的最佳命令匹配。
  3. 使用
    --agent
    标志执行:
    bash
    cloud-run-admin-pp-cli <command> [subcommand] [args] --agent
  4. 如果存在歧义,查看子命令帮助:
    cloud-run-admin-pp-cli <command> --help