pp-shopify
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseShopify — Printing Press CLI
Shopify — 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:
shopify-pp-cli- Install via the Printing Press installer:
bash
npx -y @mvanhorn/printing-press install shopify --cli-only - Verify:
shopify-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.23+):
npxbash
go install github.com/mvanhorn/printing-press-library/library/commerce/shopify/cmd/shopify-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$PATH本技能基于二进制文件运行。调用本技能的任何命令前,必须先确认CLI已安装。若未安装,请按以下步骤进行安装:
shopify-pp-cli- 通过Printing Press安装器安装:
bash
npx -y @mvanhorn/printing-press install shopify --cli-only - 验证安装:
shopify-pp-cli --version - 确保(或
$GOPATH/bin)已添加到$HOME/go/bin环境变量中。$PATH
若安装失败(如无Node环境、离线等),可回退到直接通过Go安装(要求Go 1.23+版本):
npxbash
go install github.com/mvanhorn/printing-press-library/library/commerce/shopify/cmd/shopify-pp-cli@latest若安装后执行提示“command not found”,说明安装程序未将二进制文件添加到中。请在验证成功前不要执行本技能的命令。
--version$PATHWhen Not to Use This CLI
本CLI的禁用场景
Do not use resource commands for requests that require creating, updating, deleting, publishing, commenting, upvoting, inviting, ordering, sending messages, booking, purchasing, or changing remote state. The exception is , which intentionally starts a Shopify bulk export job when the user explicitly asks for it.
bulk-operations run-query请勿使用资源命令执行以下操作:创建、更新、删除、发布、评论、点赞、邀请、下单、发送消息、预订、购买或修改远程状态。唯一例外是,当用户明确要求时,该命令会启动Shopify批量导出任务。
bulk-operations run-queryCommand Reference
命令参考
customers — Shopify customers with lifetime order count, lifetime spend, and contact fields.
- — Get one Shopify customer by GraphQL ID.
shopify-pp-cli customers get - — List customers from the Shopify Admin GraphQL API.
shopify-pp-cli customers list
fulfillment-orders — Shopify fulfillment orders for lag, routing, and fulfillment-state analysis.
- — Get one Shopify fulfillment order by GraphQL ID.
shopify-pp-cli fulfillment-orders get - — List fulfillment orders from the Shopify Admin GraphQL API.
shopify-pp-cli fulfillment-orders list
inventory-items — Shopify inventory items with tracked status and available quantities by location.
- — Get one Shopify inventory item by GraphQL ID.
shopify-pp-cli inventory-items get - — List inventory items from the Shopify Admin GraphQL API.
shopify-pp-cli inventory-items list
orders — Shopify orders with money totals, financial state, and fulfillment state.
- — Get one Shopify order by GraphQL ID.
shopify-pp-cli orders get - — List orders from the Shopify Admin GraphQL API.
shopify-pp-cli orders list
products — Shopify products with product status, catalog metadata, and a compact variant inventory projection.
- — Get one Shopify product by GraphQL ID.
shopify-pp-cli products get - — List products from the Shopify Admin GraphQL API.
shopify-pp-cli products list
Hand-written commands
- — Show the current or most recent Shopify bulk operation.
shopify-pp-cli bulk-operations current - — Start a Shopify bulk GraphQL export job from a query file.
shopify-pp-cli bulk-operations run-query --query-file <path>
customers — 包含终身订单数、终身消费金额及联系字段的Shopify客户信息。
- — 通过GraphQL ID获取单个Shopify客户信息。
shopify-pp-cli customers get - — 从Shopify Admin GraphQL API列出客户信息。
shopify-pp-cli customers list
fulfillment-orders — 用于延迟分析、路由分析及履约状态分析的Shopify履约订单。
- — 通过GraphQL ID获取单个Shopify履约订单信息。
shopify-pp-cli fulfillment-orders get - — 从Shopify Admin GraphQL API列出履约订单信息。
shopify-pp-cli fulfillment-orders list
inventory-items — 包含追踪状态及各位置可用数量的Shopify库存商品。
- — 通过GraphQL ID获取单个Shopify库存商品信息。
shopify-pp-cli inventory-items get - — 从Shopify Admin GraphQL API列出库存商品信息。
shopify-pp-cli inventory-items list
orders — 包含金额总计、财务状态及履约状态的Shopify订单。
- — 通过GraphQL ID获取单个Shopify订单信息。
shopify-pp-cli orders get - — 从Shopify Admin GraphQL API列出订单信息。
shopify-pp-cli orders list
products — 包含商品状态、目录元数据及精简变体库存投影的Shopify商品。
- — 通过GraphQL ID获取单个Shopify商品信息。
shopify-pp-cli products get - — 从Shopify Admin GraphQL API列出商品信息。
shopify-pp-cli products list
手动编写的命令
- — 显示当前或最近的Shopify批量操作。
shopify-pp-cli bulk-operations current - — 通过查询文件启动Shopify批量GraphQL导出任务。
shopify-pp-cli bulk-operations run-query --query-file <path>
Freshness Contract
数据新鲜度约定
This printed CLI owns bounded freshness only for registered store-backed read command paths. In mode, those paths check and may run a bounded refresh before reading local data. never refreshes. reads the API and does not mutate the local store. Set to skip the freshness hook without changing source selection.
--data-source autosync_state--data-source local--data-source liveSHOPIFY_NO_AUTO_REFRESH=1Covered paths:
shopify-pp-cli customersshopify-pp-cli customers getshopify-pp-cli customers listshopify-pp-cli fulfillment-ordersshopify-pp-cli fulfillment-orders getshopify-pp-cli fulfillment-orders listshopify-pp-cli inventory-itemsshopify-pp-cli inventory-items getshopify-pp-cli inventory-items listshopify-pp-cli ordersshopify-pp-cli orders getshopify-pp-cli orders listshopify-pp-cli productsshopify-pp-cli products getshopify-pp-cli products list
When JSON output uses the generated provenance envelope, freshness metadata appears at . Treat it as current-cache freshness for the covered command path, not a guarantee of complete historical backfill or API-specific enrichment.
meta.freshness本CLI仅对已注册的商店支持的读取命令路径提供有限的新鲜度保证。在模式下,这些路径会检查,并可能在读取本地数据前执行有限的刷新操作。模式从不刷新数据。模式直接读取API且不修改本地存储。设置可跳过新鲜度检查,无需更改数据源选择。
--data-source autosync_state--data-source local--data-source liveSHOPIFY_NO_AUTO_REFRESH=1覆盖的命令路径:
shopify-pp-cli customersshopify-pp-cli customers getshopify-pp-cli customers listshopify-pp-cli fulfillment-ordersshopify-pp-cli fulfillment-orders getshopify-pp-cli fulfillment-orders listshopify-pp-cli inventory-itemsshopify-pp-cli inventory-items getshopify-pp-cli inventory-items listshopify-pp-cli ordersshopify-pp-cli orders getshopify-pp-cli orders listshopify-pp-cli productsshopify-pp-cli products getshopify-pp-cli products list
当JSON输出使用生成的来源信封时,新鲜度元数据会显示在字段中。该字段表示对应命令路径的当前缓存新鲜度,不保证完整的历史回填或特定API的增强数据。
meta.freshnessFinding the right command
查找合适的命令
When you know what you want to do but not which command does it, ask the CLI directly:
bash
shopify-pp-cli which "<capability in your own words>"which02--help当你知道要执行的操作但不确定对应的命令时,可直接询问CLI:
bash
shopify-pp-cli which "<用你自己的语言描述功能>"which02--helpAuth Setup
认证设置
Set the store host, Admin API version, and access token via environment variables:
bash
export SHOPIFY_SHOP="<your-store>.myshopify.com"
export SHOPIFY_API_VERSION="2026-04"
export SHOPIFY_ACCESS_TOKEN="<your-key>"Or persist it in .
~/.config/shopify-pp-cli/config.tomlRun to verify setup.
shopify-pp-cli doctor通过环境变量设置商店主机、Admin API版本及访问令牌:
bash
export SHOPIFY_SHOP="<你的商店>.myshopify.com"
export SHOPIFY_API_VERSION="2026-04"
export SHOPIFY_ACCESS_TOKEN="<你的密钥>"也可将配置持久化到文件中。
~/.config/shopify-pp-cli/config.toml执行验证配置是否正确。
shopify-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:
--selectbashshopify-pp-cli customers list --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
-
Read-mostly — resource commands are read-only;mutates remote state by starting an export job and should only be used on explicit request
bulk-operations run-query
在任何命令后添加参数,该参数等价于:。
--agent--json --compact --no-input --no-color --yes-
可管道化 — 标准输出为JSON格式,错误信息输出到标准错误
-
可过滤 —参数保留指定字段子集。点路径可深入嵌套结构;数组会遍历每个元素。这在处理冗长API时对缩小上下文范围至关重要:
--selectbashshopify-pp-cli customers list --agent --select id,name,status -
可预览 —参数显示请求内容但不发送
--dry-run -
离线友好 — 同步/搜索命令在可用时可使用本地SQLite存储
-
非交互式 — 从不提示用户,所有输入均通过标志参数提供
-
只读优先 — 资源命令为只读;会通过启动导出任务修改远程状态,仅应在用户明确请求时使用
bulk-operations run-query
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": <数据>
}解析字段获取数据,字段表示数据来源是实时API还是本地存储。仅当标准输出为终端时,才会将人类可读的摘要输出到标准错误;管道/Agent消费者仅会在标准输出获取纯JSON数据。
.results.meta.sourceN results (live)Agent Feedback
Agent反馈
When you (or the agent) notice something off about this CLI, record it:
shopify-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
shopify-pp-cli feedback --stdin < notes.txt
shopify-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.
~/.shopify-pp-cli/feedback.jsonlSHOPIFY_FEEDBACK_ENDPOINT--sendSHOPIFY_FEEDBACK_AUTO_SEND=trueWrite what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.
当你(或Agent)发现本CLI存在问题时,可记录反馈:
shopify-pp-cli feedback "--since标志是包含性的,但文档说是排他性的"
shopify-pp-cli feedback --stdin < notes.txt
shopify-pp-cli feedback list --json --limit 10反馈条目会本地存储在文件中。仅当设置了且传递了参数或设置了时,反馈才会被POST到指定端点。默认行为仅本地存储反馈。
~/.shopify-pp-cli/feedback.jsonlSHOPIFY_FEEDBACK_ENDPOINT--sendSHOPIFY_FEEDBACK_AUTO_SEND=true请记录让你感到意外的内容,而非正式的Bug报告。简短、具体、单条记录:这样的反馈才更有价值。
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.
每个命令都支持参数。输出会发送到指定的sink,同时(或替代)输出到标准输出,以便Agent无需手动管道即可路由命令结果。支持三种sink:
--deliver <sink>| 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.
shopify-pp-cli profile save briefing --json
shopify-pp-cli --profile briefing customers list
shopify-pp-cli profile list --json
shopify-pp-cli profile show briefing
shopify-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”模式)。
shopify-pp-cli profile save briefing --json
shopify-pp-cli --profile briefing customers list
shopify-pp-cli profile list --json
shopify-pp-cli profile show briefing
shopify-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--helpoutputshopify-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的输出shopify-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/commerce/shopify/cmd/shopify-pp-mcp@latest - Register with Claude Code:
bash
claude mcp add shopify-pp-mcp -- shopify-pp-mcp - Verify:
claude mcp list
- 安装MCP服务器:
bash
go install github.com/mvanhorn/printing-press-library/library/commerce/shopify/cmd/shopify-pp-mcp@latest - 在Claude Code中注册:
bash
claude mcp add shopify-pp-mcp -- shopify-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 shopify-pp-cli - Match the user query to the best command from the Unique Capabilities and Command Reference above.
- Execute with the flag:
--agentbashshopify-pp-cli <command> [subcommand] [args] --agent - If ambiguous, drill into subcommand help: .
shopify-pp-cli <command> --help
- 检查是否已安装:若未找到,可提供安装选项(参考本文档顶部前提条件中的安装步骤)。
which shopify-pp-cli - 将用户查询与上方“独特功能”和“命令参考”中最匹配的命令对应。
- 添加参数执行命令:
--agentbashshopify-pp-cli <command> [subcommand] [args] --agent - 若存在歧义,可查看子命令帮助:。
shopify-pp-cli <command> --help