shopify-setup by jezweb/claude-skills
npx skills add https://github.com/jezweb/claude-skills --skill shopify-setup为商店设置可正常工作的 Shopify CLI 身份验证和管理员 API 访问权限。生成一个经过验证的 API 连接,可用于产品和内容管理。
验证 Shopify CLI 是否已安装:
shopify version
如果未安装:
npm install -g @shopify/cli
shopify auth login --store mystore.myshopify.com
这将打开浏览器进行 OAuth 授权。用户必须是商店所有者或具有适当权限的员工。
登录后,进行验证:
shopify store info
自定义应用提供稳定的管理员 API 访问令牌(与过期的 CLI 会话令牌不同)。
检查应用是否已存在:询问用户是否已设置自定义应用。如果是,则跳至步骤 4。
如果不存在自定义应用,则通过浏览器引导用户完成创建:
https://{store}.myshopify.com/admin/settings/apps/development广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
references/api-scopes.md):
read_products, write_productsread_content, write_contentread_product_listingsread_inventory, write_inventoryread_files, write_files如果用户希望在管理界面导航方面获得帮助,可以使用浏览器自动化工具(如 Chrome MCP 或 playwright-cli)。
安全地存储令牌。切勿将其提交到 git。
对于项目使用 — 创建 .dev.vars:
SHOPIFY_STORE=mystore.myshopify.com
SHOPIFY_ACCESS_TOKEN=shpat_xxxxxxxxxxxxxxxxxxxxx
确保 .dev.vars 在 .gitignore 中。
对于跨项目使用 — 存储在您偏好的密钥管理器中(环境变量、1Password CLI 等)。
使用简单的 GraphQL 查询测试连接:
curl -s https://{store}.myshopify.com/admin/api/2025-01/graphql.json \
-H "Content-Type: application/json" \
-H "X-Shopify-Access-Token: {token}" \
-d '{"query": "{ shop { name primaryDomain { url } } }"}' | jq .
预期响应包含商店名称和域名。如果收到 401 错误,则令牌无效或已过期 — 请重新创建应用。
在项目根目录中创建 shopify.config.json,供其他技能引用:
{
"store": "mystore.myshopify.com",
"apiVersion": "2025-01",
"tokenSource": ".dev.vars"
}
始终指定明确的 API 版本(例如 2025-01)。在生产环境中使用 unstable 版本会在无警告的情况下中断。Shopify 每季度淘汰 API 版本。
| 令牌 | 格式 | 用途 |
|---|---|---|
| 管理员 API 访问令牌 | shpat_* | 自定义应用 — 稳定、长期有效 |
| CLI 会话令牌 | 短期有效 | 仅用于 Shopify CLI 命令 |
| 店面 API 令牌 | shpca_* | 公共店面查询 |
此技能设置的是 管理员 API 访问令牌 — 这是用于产品和内容管理的正确选择。
Shopify 使用漏桶算法进行速率限制:
对于批量操作,请使用 bulkOperationRunQuery 变体,而不是循环操作。
references/api-scopes.md — 产品和内容管理所需的管理员 API 范围每周安装次数
324
代码仓库
GitHub 星标数
643
首次出现
2026年2月22日
安全审计
安装于
gemini-cli291
opencode291
github-copilot291
codex291
amp289
kimi-cli289
Set up working Shopify CLI authentication and Admin API access for a store. Produces a verified API connection ready for product and content management.
Verify the Shopify CLI is installed:
shopify version
If not installed:
npm install -g @shopify/cli
shopify auth login --store mystore.myshopify.com
This opens a browser for OAuth. The user must be a store owner or staff member with appropriate permissions.
After login, verify:
shopify store info
Custom apps provide stable Admin API access tokens (unlike CLI session tokens which expire).
Check if an app already exists : Ask the user if they have a custom app set up. If yes, skip to Step 4.
If no custom app exists , guide the user through creation via browser:
https://{store}.myshopify.com/admin/settings/apps/developmentreferences/api-scopes.md for details):
read_products, write_productsread_content, write_contentread_product_listingsread_inventory, write_inventoryread_files, write_filesUse browser automation (Chrome MCP or playwright-cli) if the user prefers assistance navigating the admin.
Store the token securely. Never commit it to git.
For project use — create .dev.vars:
SHOPIFY_STORE=mystore.myshopify.com
SHOPIFY_ACCESS_TOKEN=shpat_xxxxxxxxxxxxxxxxxxxxx
Ensure .dev.vars is in .gitignore.
For cross-project use — store in your preferred secrets manager (environment variable, 1Password CLI, etc.).
Test the connection with a simple GraphQL query:
curl -s https://{store}.myshopify.com/admin/api/2025-01/graphql.json \
-H "Content-Type: application/json" \
-H "X-Shopify-Access-Token: {token}" \
-d '{"query": "{ shop { name primaryDomain { url } } }"}' | jq .
Expected response includes the shop name and domain. If you get a 401, the token is invalid or expired — recreate the app.
Create a shopify.config.json in the project root for other skills to reference:
{
"store": "mystore.myshopify.com",
"apiVersion": "2025-01",
"tokenSource": ".dev.vars"
}
Always specify an explicit API version (e.g. 2025-01). Using unstable in production will break without warning. Shopify retires API versions quarterly.
| Token | Format | Use |
|---|---|---|
| Admin API access token | shpat_* | Custom apps — stable, long-lived |
| CLI session token | Short-lived | Shopify CLI commands only |
| Storefront API token | shpca_* | Public storefront queries |
This skill sets up Admin API access tokens — the right choice for product and content management.
Shopify uses a leaky bucket rate limiter:
For bulk operations, use the bulkOperationRunQuery mutation instead of looping.
references/api-scopes.md — Admin API scopes needed for product and content managementWeekly Installs
324
Repository
GitHub Stars
643
First Seen
Feb 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
gemini-cli291
opencode291
github-copilot291
codex291
amp289
kimi-cli289
xdrop 文件传输脚本:Bun 环境下安全上传下载工具,支持加密分享
20,700 周安装