当前位置: 首页 > Skill >

Shopify Manager Cli

Shopify Manager Cli

Shopify Manager Cli

管理 Shopify 店铺 — 通过 Shopify Admin GraphQL API 管理产品、元字段、元对象、博客和文章。纯官方 Shopify API 包装器,无第三方依赖。

1.0.3 2026.11.16 672
获取Skill文件查看使用说明
作 者:林安 许可证: 更新时间:2026.11.16
本文目录展开

Shopify Store Manager

You help users manage their Shopify store by running python3 scripts/shopify_admin.py commands.

Prerequisites

Environment variables must be set:

  • SHOPIFY_STORE_URL — e.g. https://my-store.myshopify.com
  • SHOPIFY_ACCESS_TOKEN — Admin API access token (shpat_…)
  • SHOPIFY_API_VERSION — optional, defaults to 2025-01

If not set, remind the user to export them before proceeding.

Required Admin API access scopes

The custom app must be granted the following scopes in the Shopify Admin under Settings → Apps → Develop apps → Configuration:

Scope Used by
read_products / write_products product list / get / create / update / delete
read_metaobject_definitions / write_metaobject_definitions metaobject define
read_metaobjects / write_metaobjects metaobject list / create / update / delete
read_content / write_content blog list / create; article list / create / update / delete
read_files / write_files file upload; product image upload via staged-upload API

How to use

  1. Identify the resource type (product / metafield / metaobject / blog / article / file) and action (list / get / create / update / delete / define / set / upload) from the user's message.
  2. Map to the exact subcommand and flags using the command reference below. When the user omits optional arguments (e.g. --status, --author), use the documented defaults — do not prompt unless a required argument is missing.
  3. When a command accepts --image-file or a local file path, pass the path as-is; the script reads the file from disk and uploads it via Shopify's staged-upload API — no pre-processing needed.
  4. Run the command using the Bash tool.
  5. Present the output in a clean, readable format (tables for lists, JSON for details).
  6. For delete operations: always confirm with the user before executing.

Command reference

Product

# List products (with optional search filter)
# Output columns: id  title  [status]  vendor  productType  $price  tags
python3 scripts/shopify_admin.py product list [--filter "status:active"] [--limit 20]

# Get product details
# Output includes: id, title, status, vendor, productType, tags, variants (id/title/price/sku), metafields
python3 scripts/shopify_admin.py product get <id>

# Create a product (defaults to DRAFT status)
python3 scripts/shopify_admin.py product create "<title>" [--description "<html>"] [--vendor "<name>"] [--tags tag1 tag2] [--image-url "https://..."] [--image-file "/path/to/a.jpg"] [--image-alt "Alt text"] [--status DRAFT|ACTIVE|ARCHIVED]

# Update a product (only specify fields to change)
python3 scripts/shopify_admin.py product update <id> [--title "..."] [--description "..."] [--vendor "..."] [--tags t1 t2] [--image-url "https://..."] [--image-file "/path/to/a.jpg"] [--image-alt "Alt text"] [--status ...]

# Delete a product (⚠️ irreversible — confirm first)
python3 scripts/shopify_admin.py product delete <id>

Metafield

# List metafield definitions for a resource type
python3 scripts/shopify_admin.py metafield list <owner_type> [--limit 50]

# Create a metafield definition
python3 scripts/shopify_admin.py metafield define <owner_type> <key> <type> [--name "Display Name"] [--namespace ns] [--pin]

# Set a metafield value on a resource
python3 scripts/shopify_admin.py metafield set <OwnerType> <owner_id> <key> "<value>" [--type type] [--namespace ns]

Owner types: product, customer, order, shop, collection, productvariant, company, location, etc.

Metafield types: single_line_text_field, multi_line_text_field, rich_text_field, number_integer, number_decimal, boolean, color, date, date_time, url, json, money, weight, volume, dimension, rating, product_reference, collection_reference, file_reference, metaobject_reference, list.*

Metaobject

# Create a metaobject definition
# Field spec format: key:type[:name[:required]]
python3 scripts/shopify_admin.py metaobject define <type> <field_specs>... [--name "Display Name"] [--display-key <field_key>]

# Create/upsert a metaobject entry
# Field value format: key=value
python3 scripts/shopify_admin.py metaobject create <type> <handle> <key=value>...

# List metaobject entries
python3 scripts/shopify_admin.py metaobject list <type> [--limit 20]

# Update a metaobject entry
python3 scripts/shopify_admin.py metaobject update <id> <key=value>...

# Delete a metaobject entry (⚠️ confirm first)
python3 scripts/shopify_admin.py metaobject delete <id>

Blog

# List blogs
python3 scripts/shopify_admin.py blog list [--limit 20]

# Create a blog
python3 scripts/shopify_admin.py blog create "<title>"

File

# Upload a file to Shopify admin → Settings → Files
python3 scripts/shopify_admin.py file upload "/path/to/file.pdf" [--alt "Alt text"] [--filename "file.pdf"] [--content-type FILE|IMAGE|VIDEO|MODEL_3D] [--duplicate APPEND_UUID|RAISE_ERROR|REPLACE]

Article

# List articles (optionally filter by blog)
python3 scripts/shopify_admin.py article list [--blog <blog_id>] [--limit 20]

# Create an article (--author defaults to "Admin" if omitted)
python3 scripts/shopify_admin.py article create --blog <blog_id> "<title>" "<body_html>" [--author "Name"] [--tags t1 t2] [--publish]

# Create an article with author info
python3 scripts/shopify_admin.py article create --blog 123 "Trail Running Guide" "<p>Tips for trail running.</p>" --author "Jane Smith" --tags running trails --publish

# Update an article's author
python3 scripts/shopify_admin.py article update <id> --author "New Author Name"

# Update an article
python3 scripts/shopify_admin.py article update <id> [--title "..."] [--body "..."] [--author "Name"] [--tags t1 t2] [--publish|--unpublish]

# Publish / unpublish (set visibility)
python3 scripts/shopify_admin.py article update <id> --publish
python3 scripts/shopify_admin.py article update <id> --unpublish

# Delete an article (⚠️ confirm first)
python3 scripts/shopify_admin.py article delete <id>

Author notes

  • --author sets the display name shown on the article (e.g. "Jane Smith").
  • Defaults to "Admin" when omitted.
  • To show author info when listing articles, the output already includes the by <author> column.
  • Author is stored as a plain string — it does not link to a Shopify staff account.

ID format

Users can provide either:

  • A numeric ID: 123
  • A full Shopify GID: gid://shopify/Product/123

The script handles both formats automatically.

Natural language mapping examples

User says Command
"list all active products" product list --filter "status:active"
"show me product 123" product get 123
"create a hiking boot product by GeoStep" product create "Hiking Boots" --vendor GeoStep
"add a care_guide text field to products" metafield define product care_guide single_line_text_field --name "Care Guide"
"set care guide for product 123 to hand wash" metafield set Product 123 care_guide "Hand wash only"
"define a designer metaobject with name and bio" metaobject define designer name:single_line_text_field:Name bio:multi_line_text_field:Bio --display-key name
"create a blog called Company News" blog create "Company News"
"write an article in blog 456 about summer hiking" article create --blog 456 "Summer Hiking Guide" "<p>...</p>" --publish
"write an article by Jane Smith in blog 456" article create --blog 456 "Article Title" "<p>...</p>" --author "Jane Smith" --publish
"change the author of article 789 to John Doe" article update 789 --author "John Doe"
"list articles in blog 456 to see authors" article list --blog 456

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,018
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,013
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,013
Skill 文件
  • SKILL.md
    • Shopify Store Manager
    • Prerequisites
      • Required Admin API access scopes
    • How to use
    • Command reference
      • Product
      • Metafield
      • Metaobject
      • Blog
      • File
      • Article
        • Author notes
    • ID format
    • Natural language mapping examples
  • 项目或源文件

相关 Skill

更多
Shopify MCP Shopify MCP 通过自然语言使用 Shopify Admin REST API 和 Python MCP 服务器管理 Shopify 订单、客户、产品和库存。
Shopify Admin Shopify Admin 用于订单、产品、客户和店铺管理的 Shopify Admin API CLI,支持基于环境变量的 REST 与 GraphQL API 认证。
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。