pp-tiktok-shop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

TikTok Shop - Printing Press Safe v1

TikTok Shop - Printing Press Safe v1

Prerequisites: Install the CLI

前提条件:安装CLI

This skill drives the
tiktok-shop-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 tiktok-shop --cli-only
  2. Verify:
    tiktok-shop-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.23+):
bash
go install github.com/mvanhorn/printing-press-library/library/commerce/tiktok-shop/cmd/tiktok-shop-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.
本技能驱动
tiktok-shop-pp-cli
二进制文件。在调用本技能的任何命令之前,必须先验证CLI是否已安装。如果未安装,请先执行以下步骤安装:
  1. 通过Printing Press安装程序安装:
    bash
    npx -y @mvanhorn/printing-press install tiktok-shop --cli-only
  2. 验证安装:
    tiktok-shop-pp-cli --version
  3. 确保
    $GOPATH/bin
    (或
    $HOME/go/bin
    )已添加到
    $PATH
    环境变量中。
如果
npx
安装失败(如无Node环境、离线等),可改用Go直接安装(要求Go 1.23及以上版本):
bash
go install github.com/mvanhorn/printing-press-library/library/commerce/tiktok-shop/cmd/tiktok-shop-pp-cli@latest
如果安装后执行
--version
提示“command not found”,说明安装步骤未将二进制文件添加到
$PATH
中。请在验证成功前不要继续执行技能命令。

Official Source Boundaries

官方资料边界

Only use official TikTok Shop Partner Center docs for API, auth, signing, scope, endpoint, and rate-limit claims:
Rate limits remain unclear in accessible official docs and are not encoded as numeric claims.
仅使用TikTok Shop官方合作伙伴中心文档获取API、认证、签名、权限范围、端点和速率限制相关信息:
速率限制在可访问的官方文档中尚未明确说明,未编码为数值限制。

Command Reference

命令参考

Implemented:
  • tiktok-shop-pp-cli doctor
    - Check config, env, auth readiness, and official-doc basis without sending a live probe.
  • tiktok-shop-pp-cli auth status
    - Show whether app credentials, tokens, and shop selector are configured without revealing secrets.
  • tiktok-shop-pp-cli auth exchange --auth-code <code>
    - Exchange a Partner Center authorization code for tokens; output redacts tokens.
  • tiktok-shop-pp-cli auth refresh
    - Refresh an access token; output redacts tokens.
  • tiktok-shop-pp-cli shops info
    - List shops authorized for this app/token and retrieve shop cipher.
  • tiktok-shop-pp-cli orders list
    - Search orders; response contains buyer/order PII.
  • tiktok-shop-pp-cli orders get <order-id>
    - Get order detail; response contains buyer/order PII.
  • tiktok-shop-pp-cli products list
    - Search products/listings.
  • tiktok-shop-pp-cli products get <product-id>
    - Get product detail.
  • tiktok-shop-pp-cli inventory list --product-id <id>
    or
    --sku-id <id>
    - Search inventory.
  • tiktok-shop-pp-cli inventory get <sku-id>
    - Get inventory for one SKU.
  • tiktok-shop-pp-cli fulfillment list
    - Search fulfillment packages; response may contain fulfillment PII.
  • tiktok-shop-pp-cli fulfillment get <package-id>
    - Get package detail.
  • tiktok-shop-pp-cli fulfillment warehouses
    - List seller warehouses.
  • tiktok-shop-pp-cli which [query]
    - Resolve capabilities to commands.
  • tiktok-shop-pp-cli agent-context
    - Emit JSON context for agents.
Deferred:
  • tiktok-shop-pp-cli inventory update
    - Official endpoint is confirmed, but safe v1 defers execution until idempotency and no-retry mutation behavior are designed.
已实现的命令:
  • tiktok-shop-pp-cli doctor
    - 检查配置、环境、认证就绪状态以及官方文档依据,无需发送实时探测请求。
  • tiktok-shop-pp-cli auth status
    - 显示应用凭证、令牌和店铺选择器是否已配置,不会泄露敏感信息。
  • tiktok-shop-pp-cli auth exchange --auth-code <code>
    - 将合作伙伴中心的授权码兑换为令牌;输出会隐藏令牌信息。
  • tiktok-shop-pp-cli auth refresh
    - 刷新访问令牌;输出会隐藏令牌信息。
  • tiktok-shop-pp-cli shops info
    - 列出当前应用/令牌已授权的店铺并获取店铺密文。
  • tiktok-shop-pp-cli orders list
    - 搜索订单;响应包含买家/订单个人身份信息(PII)。
  • tiktok-shop-pp-cli orders get <order-id>
    - 获取订单详情;响应包含买家/订单个人身份信息(PII)。
  • tiktok-shop-pp-cli products list
    - 搜索产品/商品列表。
  • tiktok-shop-pp-cli products get <product-id>
    - 获取产品详情。
  • tiktok-shop-pp-cli inventory list --product-id <id>
    --sku-id <id>
    - 搜索库存。
  • tiktok-shop-pp-cli inventory get <sku-id>
    - 获取单个SKU的库存信息。
  • tiktok-shop-pp-cli fulfillment list
    - 搜索履约包裹;响应可能包含履约相关的个人身份信息(PII)。
  • tiktok-shop-pp-cli fulfillment get <package-id>
    - 获取包裹详情。
  • tiktok-shop-pp-cli fulfillment warehouses
    - 列出卖家仓库。
  • tiktok-shop-pp-cli which [query]
    - 将功能解析为对应命令。
  • tiktok-shop-pp-cli agent-context
    - 输出供Agent使用的JSON上下文。
暂未实现的命令:
  • tiktok-shop-pp-cli inventory update
    - 官方端点已确认,但Safe v1版本会延迟执行,直到实现幂等性和无重试变更行为的设计。

Auth Setup

认证设置

Set values obtained through official TikTok Shop Partner Center flows. Never hardcode secrets.
bash
export TIKTOK_SHOP_APP_KEY="<from Partner Center>"
export TIKTOK_SHOP_APP_SECRET="<from Partner Center>"
export TIKTOK_SHOP_ACCESS_TOKEN="<from official token exchange>"
export TIKTOK_SHOP_REFRESH_TOKEN="<from official token exchange>"
export TIKTOK_SHOP_SHOP_CIPHER="<from shops info>"
Optional overrides:
bash
export TIKTOK_SHOP_CONFIG="$HOME/.config/tiktok-shop-pp-cli/config.toml"
export TIKTOK_SHOP_BASE_URL="https://open-api.tiktokglobalshop.com"
export TIKTOK_SHOP_AUTH_BASE_URL="https://auth.tiktok-shops.com"
Run:
bash
tiktok-shop-pp-cli doctor --json
Token exchange/refresh do not print token values. Add
--save
only when you intentionally want the returned token bundle persisted to
~/.config/tiktok-shop-pp-cli/config.toml
with
0600
permissions.
设置通过TikTok Shop官方合作伙伴中心流程获取的值。切勿硬编码敏感信息。
bash
export TIKTOK_SHOP_APP_KEY="<来自合作伙伴中心>"
export TIKTOK_SHOP_APP_SECRET="<来自合作伙伴中心>"
export TIKTOK_SHOP_ACCESS_TOKEN="<来自官方令牌兑换>"
export TIKTOK_SHOP_REFRESH_TOKEN="<来自官方令牌兑换>"
export TIKTOK_SHOP_SHOP_CIPHER="<来自shops info命令>"
可选的覆盖配置:
bash
export TIKTOK_SHOP_CONFIG="$HOME/.config/tiktok-shop-pp-cli/config.toml"
export TIKTOK_SHOP_BASE_URL="https://open-api.tiktokglobalshop.com"
export TIKTOK_SHOP_AUTH_BASE_URL="https://auth.tiktok-shops.com"
执行以下命令验证:
bash
tiktok-shop-pp-cli doctor --json
令牌交换/刷新不会打印令牌值。仅当你有意将返回的令牌包持久化到
~/.config/tiktok-shop-pp-cli/config.toml
(权限为
0600
)时,才添加
--save
参数。

Agent Mode

Agent模式

Add
--agent
to any command. It expands to
--json --compact --no-input --no-color --yes
.
Agent-safe examples:
bash
tiktok-shop-pp-cli doctor --agent
tiktok-shop-pp-cli shops info --agent --dry-run
tiktok-shop-pp-cli which --agent
tiktok-shop-pp-cli inventory update --agent
在任何命令后添加
--agent
参数。它会自动扩展为
--json --compact --no-input --no-color --yes
Agent安全示例:
bash
tiktok-shop-pp-cli doctor --agent
tiktok-shop-pp-cli shops info --agent --dry-run
tiktok-shop-pp-cli which --agent
tiktok-shop-pp-cli inventory update --agent

Safety Rules

安全规则

  • Treat orders, fulfillment, returns, and buyer identifiers as PII.
  • Use
    shops info
    to obtain
    shop_cipher
    ; do not invent or decrypt shop ciphers.
  • Use
    --dry-run
    before first live calls to inspect signed request shape without transmitting it.
  • Do not retry mutations. Safe v1 only executes read commands and auth token calls.
  • Do not use unofficial endpoints, SDK guesses, blog posts, or copied Postman collections for missing API behavior.
  • 将订单、履约、退货和买家标识视为个人身份信息(PII)。
  • 使用
    shops info
    命令获取
    shop_cipher
    ;请勿自行生成或解密店铺密文。
  • 在首次发起实时调用前使用
    --dry-run
    参数,检查签名请求的格式而不实际发送请求。
  • 不要重试变更操作。Safe v1版本仅执行只读命令和认证令牌相关调用。
  • 对于缺失的API行为,请勿使用非官方端点、SDK猜测、博客文章或复制的Postman集合。

Exit Codes

退出码

CodeMeaning
0Success, including intentional deferred placeholder output
1Unclassified error
2Usage error
4Authentication/config material missing
5Upstream API error
7Rate limited
10Config error
代码含义
0成功,包括有意的暂存输出
1未分类错误
2使用错误
4认证/配置材料缺失
5上游API错误
7速率限制触发
10配置错误

Argument Parsing

参数解析

Parse
$ARGUMENTS
:
  1. Empty,
    help
    , or
    --help
    means show
    tiktok-shop-pp-cli --help
    .
  2. Starts with
    install
    and ends with
    mcp
    means MCP installation; otherwise CLI installation.
  3. Anything else means direct use with
    --agent
    .
解析
$ARGUMENTS
的规则:
  1. 为空、
    help
    --help
    时,显示
    tiktok-shop-pp-cli --help
  2. install
    开头且以
    mcp
    结尾时,执行MCP安装;否则执行CLI安装。
  3. 其他情况则直接添加
    --agent
    参数执行命令。

MCP Server Installation

MCP服务器安装

bash
go install github.com/mvanhorn/printing-press-library/library/commerce/tiktok-shop/cmd/tiktok-shop-pp-mcp@latest
claude mcp add tiktok-shop-pp-mcp -- tiktok-shop-pp-mcp
The MCP server exposes the same safe v1 read surface and an
inventory_update_status
explainer instead of a stock mutation tool.
bash
go install github.com/mvanhorn/printing-press-library/library/commerce/tiktok-shop/cmd/tiktok-shop-pp-mcp@latest
claude mcp add tiktok-shop-pp-mcp -- tiktok-shop-pp-mcp
MCP服务器暴露与Safe v1版本相同的只读接口,并且提供
inventory_update_status
解释器而非库存变更工具。