StateSet iCommerce CLI
AI-powered command-line interface for autonomous commerce operations.Philosophy
The StateSet CLI is built on the premise that commerce infrastructure should be designed for AI agents, not just humans. Think of it as “The SQLite of Commerce” — an embedded, zero-dependency commerce engine that:- Runs locally without cloud dependencies
- Deterministic operations for agent reliability
- Agentic Commerce Protocol (ACP) for standardized agent interactions
- Safety-first architecture — read-only by default, explicit
--applyfor writes
Features
Core
- Natural Language Interface - Ask Claude to perform commerce operations
- Multi-Agent System - 17 specialized agents auto-route to the best handler
- 90+ MCP Tools - Full commerce API exposed to Claude
- Hybrid Vector Search - Semantic + BM25 search for products, customers, orders, and inventory (requires
OPENAI_API_KEY) - Multi-turn Sessions - Resume conversations for complex workflows
- Preview Mode - See what would happen before making changes
- Direct Commands - Fast, non-AI mode for scripting
- Interactive Chat - REPL for exploratory work
Sync & Streaming
- VES Protocol v1.0 - Verifiable Event Sync with Ed25519 signatures
- gRPC Streaming - Real-time bidirectional sync with sequencer
- Event Outbox - SQLite-backed event sourcing with conflict resolution
- Optimistic Concurrency - Base version tracking for safe multi-agent updates
Payments
- Multi-Chain Stablecoins - USDC on Solana, Base, Ethereum, Arbitrum
- SET Chain ssUSD - Yield-bearing stablecoin on StateSet L2
- Bitcoin & Zcash - Native BTC and ZEC support
- VES Key Derivation - Deterministic wallet addresses per agent
Infrastructure
- Batch Processing - Sequential or parallel request processing
- Interactive Tutorials - Guided onboarding for new users
- SQLite/PostgreSQL - Flexible storage backends
- Rich Output - ASCII tables, progress bars, formatted displays
- Telemetry - Distributed tracing with
--verboseand--stats
Installation
Quick Start
Tip:ss is a shorthand alias for stateset.
Run the Tutorial
New to StateSet CLI? Start with the interactive tutorial:AI-Powered Mode
Interactive Chat
Direct Commands (No AI)
Batch Processing
Commands
Primary Commands
| Command | Description |
|---|---|
stateset "<request>" | AI-powered interface (auto-routes to best agent) |
stateset-chat | Multi-turn interactive REPL |
stateset-direct <resource> <action> | Direct CLI (no AI required) |
Specialized Agent Commands
| Command | Agent | Description |
|---|---|---|
stateset-checkout | checkout | Shopping cart & checkout flow (ACP) |
stateset-orders | orders | Order lifecycle management |
stateset-inventory | inventory | Stock & reservation management |
stateset-returns | returns | RMA & refund processing |
stateset-analytics | analytics | Sales metrics & forecasting |
stateset-promotions | promotions | Promotions, discounts & coupons |
stateset-subscriptions | subscriptions | Subscription plans & recurring billing |
stateset-create | storefront | Scaffold e-commerce storefronts |
stateset-manufacturing | manufacturing | BOM & work order management |
stateset-payments | payments | Payment processing & refunds |
stateset-shipments | shipments | Shipment tracking & delivery |
stateset-suppliers | suppliers | Supplier & purchase order management |
stateset-invoices | invoices | B2B invoice management |
stateset-warranties | warranties | Product warranty & claims |
stateset-currency | currency | Multi-currency & exchange rates |
stateset-tax | tax | Tax calculation & compliance |
stateset-pay | stablecoin | Native crypto payments (USDC, ssUSD, BTC, ZEC) |
Utility Commands
| Command | Description |
|---|---|
stateset-config | Profile and configuration management |
stateset-doctor | Health check and diagnostics |
stateset-events | Event management and webhooks |
stateset-sync | Verifiable Event Sync with sequencer |
stateset-tutorial | Interactive tutorials and onboarding |
stateset-completion | Shell completion scripts (bash/zsh/fish) |
Architecture
Technology Stack
- Rust Core - Pure domain logic with deterministic execution
- @stateset/embedded - Native Node.js bindings via NAPI
- Claude Agent SDK - AI agent framework with MCP tools
- SQLite/PostgreSQL - Flexible database backends
Capabilities
Commerce Operations
| Domain | Operations |
|---|---|
| Orders | Create, confirm, process, ship, deliver, cancel |
| Customers | Profiles, addresses, preferences, history |
| Products | Catalog with variants and attributes |
| Inventory | Multi-location stock, reservations, adjustments |
| Carts | Shopping cart with ACP checkout flow |
| Returns | RMA processing with refund management |
| Shipments | Fulfillment tracking with carrier integration |
Manufacturing Operations
| Domain | Operations |
|---|---|
| Bill of Materials | Create, manage, activate BOMs |
| Work Orders | Production job management |
| Components | Track component requirements |
Financial Operations
| Domain | Operations |
|---|---|
| Multi-Currency | 35+ currencies (USD, EUR, GBP, JPY, BTC, ETH, USDC) |
| Payments | Credit card, PayPal, cryptocurrency |
| Refunds | Multiple payout methods |
| Invoices | B2B invoice management with payment terms |
| Purchase Orders | Supplier management and procurement |
| Tax | Multi-jurisdiction tax calculation (US, EU, CA) |
Promotions & Discounts
Subscriptions & Recurring Billing
Manufacturing
Tax Management
Analytics & Forecasting
Safety Architecture
Read-Only by Default
All write operations are blocked by default. The CLI shows what would happen without making changes.Permission Controls
| Feature | Description |
|---|---|
| Preview Mode | Default read-only operation |
| Confirmation Thresholds | High-value operations (>$1000) prompt for confirmation |
| Permission Gating | Five levels: none, read, preview, write, admin |
| Spending Limits | Max order value, daily totals |
| Rate Limiting | Tool calls/minute, write ops/minute |
| Audit Logging | Complete operation history |
Observability
Workflows
E-commerce Workflow
Shopping Cart Checkout (ACP)
Cart Recovery
Inventory Management
Processing Returns
Multi-Currency Support
Stablecoin Payments
Send native cryptocurrency payments across multiple blockchains:| Chain | Token | Description |
|---|---|---|
solana | USDC | Fast, cheap, proven liquidity |
solana_devnet | USDC | Testing |
set_chain | ssUSD | StateSet L2, yield-bearing |
base | USDC | Coinbase L2, low fees |
ethereum | USDC/USDT/DAI | Maximum security |
arbitrum | USDC | Fast L2 |
zcash | ZEC | Privacy-focused (t-addresses) |
bitcoin | BTC | Original cryptocurrency |
Supplier Management
B2B Invoicing
Storefront Creation
nextjs, nextjs-minimal, vite-react, astro
Event Sync (VES Protocol)
Synchronize events between agents and the StateSet Sequencer using the Verifiable Event Sync protocol:- Ed25519 cryptographic signatures for event integrity
- Domain-separated hashing (
VES_PAYLOAD_PLAIN_V1) - Optimistic concurrency with base version tracking
- Automatic conflict detection and resolution
- Global sequence numbers for ordering
Agent System
17 specialized agents handle different commerce domains:| Agent | Tools | Purpose |
|---|---|---|
| checkout | 14 ACP tools | Shopping cart & payment flows |
| orders | 6 tools | Order lifecycle & fulfillment |
| inventory | 6 tools | Stock management & reservations |
| returns | 5 tools | RMA & refund processing |
| analytics | 10 tools | Business intelligence & forecasting |
| promotions | 10 tools | Campaigns, discounts, coupons |
| subscriptions | 15 tools | Subscription plans & recurring billing |
| manufacturing | 11 tools | BOM & work order management |
| payments | 5 tools | Payment processing & refunds |
| shipments | 5 tools | Shipment tracking & delivery |
| suppliers | 8 tools | Supplier & purchase order management |
| invoices | 7 tools | B2B invoice management |
| warranties | 6 tools | Product warranty & claims |
| currency | 8 tools | Multi-currency & exchange rates |
| tax | 9 tools | Tax calculation & compliance |
| storefront | 12 tools | E-commerce site scaffolding |
| customer-service | All 87+ tools | Full-service fallback agent |
Auto-Routing
The mainstateset command automatically routes requests to the best agent based on:
- Request content analysis
- Confidence scoring
- Domain keyword matching
- Ambiguity detection
MCP Tools (90+ Total)
| Domain | Count | Examples |
|---|---|---|
| Customers | 3 | list, get, create |
| Orders | 6 | list, get, create, update_status, ship, cancel |
| Products | 4 | list, get, get_variant, create |
| Inventory | 6 | get_stock, create_item, adjust, reserve, confirm, release |
| Returns | 5 | list, get, create, approve, reject |
| Carts/Checkout | 14 | create, add_item, set_address, set_payment, complete_checkout |
| Analytics | 10 | sales_summary, top_products, demand_forecast, revenue_forecast |
| Currency | 8 | get_rate, convert, set_rate, format |
| Tax | 9 | calculate_tax, calculate_cart_tax, get_rate, list_jurisdictions |
| Promotions | 10 | list, create, activate, create_coupon, validate_coupon, apply |
| Subscriptions | 15 | list_plans, create_plan, create_subscription, pause, resume, cancel |
| Manufacturing | 11 | list_boms, create_bom, create_work_order, complete_work_order |
| Payments | 5 | list, get, create, complete, create_refund |
| Shipments | 3 | list, create, deliver |
| Suppliers/POs | 6 | list_suppliers, create_supplier, create_purchase_order |
| Invoices | 5 | list, create, send, record_payment, get_overdue |
| Warranties | 4 | list, create, create_claim, approve_claim |
| Stablecoin | 4 | get_agent_wallet, get_wallet_balance, create_payment, list_chains |
Configuration
Environment Variables
Database
Flags Reference
| Flag | Description |
|---|---|
--db <path> | Database path |
--apply | Enable write operations |
--model <name> | Claude model to use |
--resume <id> | Resume previous session |
--json | JSON output |
--verbose | Real-time telemetry |
--stats | Execution statistics |
--parallel <n> | Process batch requests in parallel |
--batch <file> | Read requests from file |
--stdin | Read requests from stdin |
--help | Show help |