ecomcoder-cli
v1.3.17
Published
CLI tools for EcomCoder - Shopify development utilities
Maintainers
Readme
EcomCoder CLI
CLI tools for EcomCoder - Shopify development utilities
A command-line interface for streamlining Shopify theme development and testing. Built for developers working with EcomCoder's Shopify development platform.
Installation
npm install -g ecomcoder-cliOr use with npx (no installation required):
npx ecomcoder-cli [command]Prerequisites
- Node.js >= 18.0.0
- Active EcomCoder session (authenticated via Claude Agent SDK)
Usage
ecomcoder <command> <subcommand> [options]Commands
Products
Create Dummy Products
Create test products in your Shopify store for development and testing.
ecomcoder products create --count=10Options:
--count- Number of products to create (default: 10)
List Products
Retrieve and display products from your Shopify store.
ecomcoder products list --limit=50Options:
--limit- Maximum number of products to retrieve (default: 50)
Metafields
Create Metafield Definition
Create custom metafield definitions at product or shop level.
Product-level metafield:
ecomcoder metafield create \
--name="Product Rating" \
--key=rating \
--type=number_decimal \
--owner-type=PRODUCTShop-level metafield (global):
ecomcoder metafield create \
--name="Cart Upsell Product" \
--key=cart_upsell \
--type=product_reference \
--owner-type=SHOPOptions:
--name- Display name for the metafield--key- Metafield key (used in code)--type- Metafield type (e.g.,number_decimal,product_reference,single_line_text_field)--owner-type- Owner type:PRODUCTorSHOP
Get Metafield Definition
Retrieve metafield definitions from your store.
ecomcoder metafield get \
--namespace=ecomcoder \
--key=upsell \
--owner-type=PRODUCTOptions:
--namespace- Metafield namespace--key- Metafield key--owner-type- Owner type:PRODUCTorSHOP
Documentation
Search Shopify Docs
Search Shopify theme documentation using AI-powered semantic search.
ecomcoder docs search --query="How do sections work in Shopify themes?"Options:
--query- Your search question
Authentication
The CLI uses session-based authentication that's automatically provided when running within the Claude Agent SDK environment. The following environment variables are auto-injected:
SESSION_ID- Session identifierBACKEND_URL- Orchestrator backend URLSUPABASE_JWT- Authentication tokenSUPABASE_URL- Supabase project URLSUPABASE_ANON_KEY- Supabase anonymous key
You can also manually provide the session ID:
ecomcoder products list --session-id=your-session-idSafety Features
User Approval for Destructive Operations
All commands that modify your live Shopify store (create, update, delete operations) require user confirmation before execution. This prevents accidental changes to your production store.
Commands requiring approval:
- Product updates (price, title, description, status, etc.)
- Product/variant creation and deletion
- Discount creation and deletion
- Metafield modifications
Read-only commands (like products list, product get) execute immediately without approval prompts.
When used with the EcomCoder app, you'll see a confirmation dialog before any destructive operation is executed. The CLI will wait for your approval before proceeding.
Development
Setup
# Clone the repository
git clone https://github.com/ImadMoka/ecomcoder-cli.git
cd ecomcoder-cli
# Install dependencies
npm install
# Build the project
npm run build
# Run in development mode (watch mode)
npm run devProject Structure
ecomcoder-cli/
├── bin/
│ └── ecomcoder.js # CLI executable
├── src/
│ ├── commands/ # Command implementations
│ │ ├── create-dummy-products.ts
│ │ ├── list-products.ts
│ │ ├── create-metafield.ts
│ │ ├── get-metafield.ts
│ │ └── docs-search.ts
│ ├── lib/ # Shared utilities
│ │ ├── api-client.ts
│ │ ├── shopify-client.ts
│ │ ├── supabase-client.ts
│ │ ├── pinecone-client.ts
│ │ ├── args-parser.ts
│ │ └── types.ts
│ └── cli.ts # Main CLI entry point
├── dist/ # Compiled output
└── package.jsonScripts
npm run build- Compile TypeScript to JavaScriptnpm run dev- Watch mode for developmentnpm run release:patch- Bump patch version and publish (manual)npm run release:minor- Bump minor version and publish (manual)npm run release:major- Bump major version and publish (manual)
Publishing
Automated Publishing (Recommended)
This project uses GitHub Actions for automated npm publishing:
Create a GitHub Release:
- Go to your repository on GitHub
- Click "Releases" → "Create a new release"
- Create a tag following semver (e.g.,
v1.2.12,v1.3.0) - Add release notes describing changes
- Click "Publish release"
Automatic Publishing:
- GitHub Actions automatically triggers
- Updates package.json version from the tag
- Builds the project
- Publishes to npm with provenance
- Provides a summary with npm link
Setup (First Time Only)
1. Create npm Access Token:
- Go to npmjs.com → Account Settings → Access Tokens
- Generate a new "Automation" token
- Copy the token
2. Add Token to GitHub:
- Repository Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
NPM_TOKEN - Value: paste your npm token
- Save
Manual Publishing (Legacy)
# Patch release (1.2.11 → 1.2.12)
npm run release:patch
# Minor release (1.2.11 → 1.3.0)
npm run release:minor
# Major release (1.2.11 → 2.0.0)
npm run release:majorExamples
# Create 25 test products
ecomcoder products create --count=25
# List all products (up to 100)
ecomcoder products list --limit=100
# Create a shop-level recommended products metafield
ecomcoder metafield create \
--name="Recommended Products" \
--key=recommended \
--type=list.product_reference \
--owner-type=SHOP
# Search for information about Liquid filters
ecomcoder docs search --query="What are the available date filters in Liquid?"License
MIT
Support
For issues and feature requests, please visit:
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Built with:
- TypeScript
- Shopify Admin API
- Supabase
- Pinecone (for semantic search)
