Skip to content

joeynyc/shopctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

shopctl

Shopify store management from the command line

License: MIT Node.js Tests

InstallCommandsCSV WorkflowPipeline


What It Does

shopctl is a CLI for managing Shopify stores. Products, inventory, metafields, orders, and CSV operations — all from your terminal with --json output for scripting.

The killer feature: CSV workflows that don't blow up in your face. Validate before import, auto-fix common issues, diff against your live store, and dry-run everything.

Think of it as gh but for Shopify.

Install

# Global install
npm install -g shopctl

# Or run locally
git clone https://github.com/joeynyc/shopctl.git
cd shopctl
npm install
node bin/shopctl.js --help

Setup

# Interactive auth (prompts for store URL + API token)
shopctl auth

# Multiple stores
shopctl auth --profile staging
shopctl auth --profile production
shopctl --profile staging store

Credentials are stored at ~/.shopctl/config.json.

CSV Workflow

The #1 pain point on Reddit and Shopify forums: CSV import is a nightmare. Cryptic errors, silent failures, variant structures that break for no reason.

shopctl makes it transparent:

shopctl csv validate products.csv        # "3 errors on lines 12, 45, 89"
shopctl csv fix products.csv -o fixed.csv  # "fixed 8 issues automatically"
shopctl csv validate fixed.csv           # "clean ✅"
shopctl csv diff fixed.csv               # "here's what will change vs your live store"
shopctl csv import fixed.csv --dry-run   # "rehearsal: 47 products, 12 updates, 0 deletes"
shopctl csv import fixed.csv             # "done, 47 products imported"

Step by step, no surprises.

What Gets Auto-Fixed

  • BOM encoding issues
  • Missing required fields (fills with safe defaults)
  • Handle deduplication
  • Price formatting (strips currency symbols, normalizes decimals)
  • Dead image URL detection
  • Published/status field normalization

Commands

Products

shopctl products list --status active --vendor Acme
shopctl products get 1234567890
shopctl products create --title "New Tee" --price 29.99 --sku TEE-001
shopctl products update 1234567890 --price 39.99 --status draft
shopctl products delete 1234567890
shopctl products search "TEE"
shopctl products bulk-update --file updates.json

CSV

shopctl csv validate products.csv
shopctl csv fix products.csv -o fixed.csv
shopctl csv export --format shopify -o products.csv
shopctl csv import products.csv --dry-run
shopctl csv import products.csv --overwrite
shopctl csv diff products.csv

Inventory

shopctl inventory list
shopctl inventory list --location "Main Warehouse"
shopctl inventory set SKU-123 25 --location "Main Warehouse"
shopctl inventory adjust SKU-123 -2 --reason "damaged"
shopctl inventory sync --file inventory.csv

Metafields

shopctl metafields list product 1234567890
shopctl metafields set product 1234567890 --namespace custom --key subtitle --value "Hello" --type single_line_text_field
shopctl metafields delete product 1234567890 9999999999
shopctl metafields export product -o metafields.json

Orders

shopctl orders list --status open --limit 50
shopctl orders get 1234567890
shopctl orders fulfill 1234567890 --tracking 1Z999 --carrier UPS

Store

shopctl store   # Store info + API usage

Global Flags

Flag Description
--profile <name> Select credential profile (default: default)
--json Output JSON (pipe into jq, scripts, automations)
--csv Output CSV where supported
--dry-run Preview destructive operations without executing

AI Pipeline

shopctl pairs with CSV Cleaner Agent for AI-powered cleaning before Shopify import:

CSV Cleaner Agent (AI profiling + smart fixes) → shopctl (Shopify validation + import)

The AI handles messy, unpredictable data issues. shopctl handles exact Shopify schema compliance. See the CSVCleanerAgent pipeline docs for setup.

Safety

  • --dry-run on all destructive operations
  • Clear error messages with recovery suggestions
  • Automatic rate limit handling with exponential backoff
  • No writes without explicit confirmation

Development

# Run tests
npm test

# Check syntax
node --check bin/shopctl.js src/index.js

License

MIT


Built for merchants who are tired of Shopify's CSV import breaking silently.

About

Shopify store management CLI — products, CSV workflows, inventory, metafields, orders

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors