pp-tiktok-shop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTikTok Shop - Printing Press Safe v1
TikTok Shop - Printing Press Safe v1
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:
tiktok-shop-pp-cli- Install via the Printing Press installer:
bash
npx -y @mvanhorn/printing-press install tiktok-shop --cli-only - Verify:
tiktok-shop-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/tiktok-shop/cmd/tiktok-shop-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是否已安装。如果未安装,请先执行以下步骤安装:
tiktok-shop-pp-cli- 通过Printing Press安装程序安装:
bash
npx -y @mvanhorn/printing-press install tiktok-shop --cli-only - 验证安装:
tiktok-shop-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/tiktok-shop/cmd/tiktok-shop-pp-cli@latest如果安装后执行提示“command not found”,说明安装步骤未将二进制文件添加到中。请在验证成功前不要继续执行技能命令。
--version$PATHOfficial Source Boundaries
官方资料边界
Only use official TikTok Shop Partner Center docs for API, auth, signing, scope, endpoint, and rate-limit claims:
- Seller API overview: https://partner.tiktokshop.com/docv2/page/650b1f2ff1fd3102b93c6d3d
- Authorization overview: https://partner.tiktokshop.com/docv2/page/678e3a3292b0f40314a92d75
- Authorization guide: https://partner.tiktokshop.com/docv2/page/678e3a2dbd083702fd17455c
- Signing algorithm: https://partner.tiktokshop.com/docv2/page/678e3a3d4ddec3030b238faf
- Get Authorized Shops: https://partner.tiktokshop.com/docv2/page/6507ead7b99d5302be949ba9
- Get Active Shops: https://partner.tiktokshop.com/docv2/page/650a69e24a0bb702c067291c
- Get Order List: https://partner.tiktokshop.com/docv2/page/650aa8094a0bb702c06df242
- Get Order Detail: https://partner.tiktokshop.com/docv2/page/650aa8ccc16ffe02b8f167a0
- Search Products: https://partner.tiktokshop.com/docv2/page/6503081a56e2bb0289dd6d7d
- Get Product: https://partner.tiktokshop.com/docv2/page/6509d85b4a0bb702c057fdda
- Inventory Search: https://partner.tiktokshop.com/docv2/page/650a9191c16ffe02b8eec161
- Update Inventory, deferred: https://partner.tiktokshop.com/docv2/page/6503068fc20ad60284b38858
- Get Warehouse List: https://partner.tiktokshop.com/docv2/page/650aa418defece02be6e66b6
- Search Package: https://partner.tiktokshop.com/docv2/page/650aa592bace3e02b75db748
- Get Package Detail: https://partner.tiktokshop.com/docv2/page/650aa39fbace3e02b75d8617
Rate limits remain unclear in accessible official docs and are not encoded as numeric claims.
仅使用TikTok Shop官方合作伙伴中心文档获取API、认证、签名、权限范围、端点和速率限制相关信息:
- 卖家API概览:https://partner.tiktokshop.com/docv2/page/650b1f2ff1fd3102b93c6d3d
- 认证概览:https://partner.tiktokshop.com/docv2/page/678e3a3292b0f40314a92d75
- 认证指南:https://partner.tiktokshop.com/docv2/page/678e3a2dbd083702fd17455c
- 签名算法:https://partner.tiktokshop.com/docv2/page/678e3a3d4ddec3030b238faf
- 获取已授权店铺:https://partner.tiktokshop.com/docv2/page/6507ead7b99d5302be949ba9
- 获取活跃店铺:https://partner.tiktokshop.com/docv2/page/650a69e24a0bb702c067291c
- 获取订单列表:https://partner.tiktokshop.com/docv2/page/650aa8094a0bb702c06df242
- 获取订单详情:https://partner.tiktokshop.com/docv2/page/650aa8ccc16ffe02b8f167a0
- 搜索产品:https://partner.tiktokshop.com/docv2/page/6503081a56e2bb0289dd6d7d
- 获取产品详情:https://partner.tiktokshop.com/docv2/page/6509d85b4a0bb702c057fdda
- 库存搜索:https://partner.tiktokshop.com/docv2/page/650a9191c16ffe02b8eec161
- 更新库存(暂未开放):https://partner.tiktokshop.com/docv2/page/6503068fc20ad60284b38858
- 获取仓库列表:https://partner.tiktokshop.com/docv2/page/650aa418defece02be6e66b6
- 搜索包裹:https://partner.tiktokshop.com/docv2/page/650aa592bace3e02b75db748
- 获取包裹详情:https://partner.tiktokshop.com/docv2/page/650aa39fbace3e02b75d8617
速率限制在可访问的官方文档中尚未明确说明,未编码为数值限制。
Command Reference
命令参考
Implemented:
- - Check config, env, auth readiness, and official-doc basis without sending a live probe.
tiktok-shop-pp-cli doctor - - Show whether app credentials, tokens, and shop selector are configured without revealing secrets.
tiktok-shop-pp-cli auth status - - Exchange a Partner Center authorization code for tokens; output redacts tokens.
tiktok-shop-pp-cli auth exchange --auth-code <code> - - Refresh an access token; output redacts tokens.
tiktok-shop-pp-cli auth refresh - - List shops authorized for this app/token and retrieve shop cipher.
tiktok-shop-pp-cli shops info - - Search orders; response contains buyer/order PII.
tiktok-shop-pp-cli orders list - - Get order detail; response contains buyer/order PII.
tiktok-shop-pp-cli orders get <order-id> - - Search products/listings.
tiktok-shop-pp-cli products list - - Get product detail.
tiktok-shop-pp-cli products get <product-id> - or
tiktok-shop-pp-cli inventory list --product-id <id>- Search inventory.--sku-id <id> - - Get inventory for one SKU.
tiktok-shop-pp-cli inventory get <sku-id> - - Search fulfillment packages; response may contain fulfillment PII.
tiktok-shop-pp-cli fulfillment list - - Get package detail.
tiktok-shop-pp-cli fulfillment get <package-id> - - List seller warehouses.
tiktok-shop-pp-cli fulfillment warehouses - - Resolve capabilities to commands.
tiktok-shop-pp-cli which [query] - - Emit JSON context for agents.
tiktok-shop-pp-cli agent-context
Deferred:
- - Official endpoint is confirmed, but safe v1 defers execution until idempotency and no-retry mutation behavior are designed.
tiktok-shop-pp-cli inventory update
已实现的命令:
- - 检查配置、环境、认证就绪状态以及官方文档依据,无需发送实时探测请求。
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 - - 搜索订单;响应包含买家/订单个人身份信息(PII)。
tiktok-shop-pp-cli orders list - - 获取订单详情;响应包含买家/订单个人身份信息(PII)。
tiktok-shop-pp-cli orders get <order-id> - - 搜索产品/商品列表。
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> - - 获取单个SKU的库存信息。
tiktok-shop-pp-cli inventory get <sku-id> - - 搜索履约包裹;响应可能包含履约相关的个人身份信息(PII)。
tiktok-shop-pp-cli fulfillment list - - 获取包裹详情。
tiktok-shop-pp-cli fulfillment get <package-id> - - 列出卖家仓库。
tiktok-shop-pp-cli fulfillment warehouses - - 将功能解析为对应命令。
tiktok-shop-pp-cli which [query] - - 输出供Agent使用的JSON上下文。
tiktok-shop-pp-cli agent-context
暂未实现的命令:
- - 官方端点已确认,但Safe v1版本会延迟执行,直到实现幂等性和无重试变更行为的设计。
tiktok-shop-pp-cli inventory update
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 --jsonToken exchange/refresh do not print token values. Add only when you intentionally want the returned token bundle persisted to with permissions.
--save~/.config/tiktok-shop-pp-cli/config.toml0600设置通过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.toml0600--saveAgent Mode
Agent模式
Add to any command. It expands to .
--agent--json --compact --no-input --no-color --yesAgent-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 --yesAgent安全示例:
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 --agentSafety Rules
安全规则
- Treat orders, fulfillment, returns, and buyer identifiers as PII.
- Use to obtain
shops info; do not invent or decrypt shop ciphers.shop_cipher - Use before first live calls to inspect signed request shape without transmitting it.
--dry-run - 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
退出码
| Code | Meaning |
|---|---|
| 0 | Success, including intentional deferred placeholder output |
| 1 | Unclassified error |
| 2 | Usage error |
| 4 | Authentication/config material missing |
| 5 | Upstream API error |
| 7 | Rate limited |
| 10 | Config error |
| 代码 | 含义 |
|---|---|
| 0 | 成功,包括有意的暂存输出 |
| 1 | 未分类错误 |
| 2 | 使用错误 |
| 4 | 认证/配置材料缺失 |
| 5 | 上游API错误 |
| 7 | 速率限制触发 |
| 10 | 配置错误 |
Argument Parsing
参数解析
Parse :
$ARGUMENTS- Empty, , or
helpmeans show--help.tiktok-shop-pp-cli --help - Starts with and ends with
installmeans MCP installation; otherwise CLI installation.mcp - Anything else means direct use with .
--agent
解析的规则:
$ARGUMENTS- 为空、或
help时,显示--help。tiktok-shop-pp-cli --help - 以开头且以
install结尾时,执行MCP安装;否则执行CLI安装。mcp - 其他情况则直接添加参数执行命令。
--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-mcpThe MCP server exposes the same safe v1 read surface and an explainer instead of a stock mutation tool.
inventory_update_statusbash
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-mcpMCP服务器暴露与Safe v1版本相同的只读接口,并且提供解释器而非库存变更工具。
inventory_update_status