微算力 · API 导航与自营网关
API 接入 EN
未登录登录
✨

Shopify Manager Cli

Shopify Manager Cli · v1.0.0
安全 unknown 级 作者 asenwang 公开目录收录
991 下载 1 安装 2.1k 收藏 0 浏览

简介

Shopify Manager Cli

原始描述

Manage Shopify store — products, metafields, metaobjects, blogs & articles via Shopify Admin GraphQL API. Pure official Shopify API wrapper with no third-par...

通过你的 Agent 添加

安装目录:shopify-manager-cli/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/shopify-manager-cli/
Codex CLI~/.codex/skills/shopify-manager-cli/
DeepSeek Harness~/.agents/skills/shopify-manager-cli/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

技能正文


name: shopify-manager-cli description: Manage Shopify store — products, metafields, metaobjects, blogs & articles via Admin GraphQL API. user_invocable: true

metadata: { "openclaw": { "emoji": "🛍️", "requires": { "bins": ["uv"], "env": ["SHOPIFY_STORE_URL", "SHOPIFY_ACCESS_TOKEN"] }, "install": [ { "id": "uv-brew", "kind": "brew", "formula": "uv", "bins": ["uv"], "label": "Install uv (brew)", }, ], }, }

Shopify Store Manager

You help users manage their Shopify store by running uv run 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.

How to use

  1. Parse the user's intent from their input (the text after /shopify).
  2. Map it to the correct CLI subcommand and flags.
  3. Run the command using the Bash tool.
  4. Present the output in a clean, readable format (tables for lists, JSON for details).
  5. For delete operations: always confirm with the user before executing.

Command reference

Product

# List products (with optional search filter)
uv run scripts/shopify_admin.py product list [--filter "status:active"] [--limit 20]

# Get product details
uv run scripts/shopify_admin.py product get <id>

# Create a product (defaults to DRAFT status)
uv run 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)
uv run 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)
uv run scripts/shopify_admin.py product delete <id>

Metafield

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

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

# Set a metafield value on a resource
uv run 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]]
uv run 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
uv run scripts/shopify_admin.py metaobject create <type> <handle> <key=value>...

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

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

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

Blog

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

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

File

# Upload a file to Shopify admin → Settings → Files
uv run 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)
uv run scripts/shopify_admin.py article list [--blog <blog_id>] [--limit 20]

# Create an article
uv run scripts/shopify_admin.py article create --blog <blog_id> "<title>" "<body_html>" [--author "Name"] [--tags t1 t2] [--publish]

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

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

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

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

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

没有标签

同类 Skill