Skip to main content

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 --apply for 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 --verbose and --stats

Installation

Or run locally:

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

CommandDescription
stateset "<request>"AI-powered interface (auto-routes to best agent)
stateset-chatMulti-turn interactive REPL
stateset-direct <resource> <action>Direct CLI (no AI required)

Specialized Agent Commands

CommandAgentDescription
stateset-checkoutcheckoutShopping cart & checkout flow (ACP)
stateset-ordersordersOrder lifecycle management
stateset-inventoryinventoryStock & reservation management
stateset-returnsreturnsRMA & refund processing
stateset-analyticsanalyticsSales metrics & forecasting
stateset-promotionspromotionsPromotions, discounts & coupons
stateset-subscriptionssubscriptionsSubscription plans & recurring billing
stateset-createstorefrontScaffold e-commerce storefronts
stateset-manufacturingmanufacturingBOM & work order management
stateset-paymentspaymentsPayment processing & refunds
stateset-shipmentsshipmentsShipment tracking & delivery
stateset-supplierssuppliersSupplier & purchase order management
stateset-invoicesinvoicesB2B invoice management
stateset-warrantieswarrantiesProduct warranty & claims
stateset-currencycurrencyMulti-currency & exchange rates
stateset-taxtaxTax calculation & compliance
stateset-paystablecoinNative crypto payments (USDC, ssUSD, BTC, ZEC)

Utility Commands

CommandDescription
stateset-configProfile and configuration management
stateset-doctorHealth check and diagnostics
stateset-eventsEvent management and webhooks
stateset-syncVerifiable Event Sync with sequencer
stateset-tutorialInteractive tutorials and onboarding
stateset-completionShell 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

DomainOperations
OrdersCreate, confirm, process, ship, deliver, cancel
CustomersProfiles, addresses, preferences, history
ProductsCatalog with variants and attributes
InventoryMulti-location stock, reservations, adjustments
CartsShopping cart with ACP checkout flow
ReturnsRMA processing with refund management
ShipmentsFulfillment tracking with carrier integration

Manufacturing Operations

DomainOperations
Bill of MaterialsCreate, manage, activate BOMs
Work OrdersProduction job management
ComponentsTrack component requirements

Financial Operations

DomainOperations
Multi-Currency35+ currencies (USD, EUR, GBP, JPY, BTC, ETH, USDC)
PaymentsCredit card, PayPal, cryptocurrency
RefundsMultiple payout methods
InvoicesB2B invoice management with payment terms
Purchase OrdersSupplier management and procurement
TaxMulti-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

FeatureDescription
Preview ModeDefault read-only operation
Confirmation ThresholdsHigh-value operations (>$1000) prompt for confirmation
Permission GatingFive levels: none, read, preview, write, admin
Spending LimitsMax order value, daily totals
Rate LimitingTool calls/minute, write ops/minute
Audit LoggingComplete 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:
Supported Chains:
ChainTokenDescription
solanaUSDCFast, cheap, proven liquidity
solana_devnetUSDCTesting
set_chainssUSDStateSet L2, yield-bearing
baseUSDCCoinbase L2, low fees
ethereumUSDC/USDT/DAIMaximum security
arbitrumUSDCFast L2
zcashZECPrivacy-focused (t-addresses)
bitcoinBTCOriginal cryptocurrency

Supplier Management

B2B Invoicing

Storefront Creation

Available templates: nextjs, nextjs-minimal, vite-react, astro

Event Sync (VES Protocol)

Synchronize events between agents and the StateSet Sequencer using the Verifiable Event Sync protocol:
gRPC Streaming for real-time sync:
VES Protocol Features:
  • 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:
AgentToolsPurpose
checkout14 ACP toolsShopping cart & payment flows
orders6 toolsOrder lifecycle & fulfillment
inventory6 toolsStock management & reservations
returns5 toolsRMA & refund processing
analytics10 toolsBusiness intelligence & forecasting
promotions10 toolsCampaigns, discounts, coupons
subscriptions15 toolsSubscription plans & recurring billing
manufacturing11 toolsBOM & work order management
payments5 toolsPayment processing & refunds
shipments5 toolsShipment tracking & delivery
suppliers8 toolsSupplier & purchase order management
invoices7 toolsB2B invoice management
warranties6 toolsProduct warranty & claims
currency8 toolsMulti-currency & exchange rates
tax9 toolsTax calculation & compliance
storefront12 toolsE-commerce site scaffolding
customer-serviceAll 87+ toolsFull-service fallback agent

Auto-Routing

The main stateset command automatically routes requests to the best agent based on:
  • Request content analysis
  • Confidence scoring
  • Domain keyword matching
  • Ambiguity detection

MCP Tools (90+ Total)

DomainCountExamples
Customers3list, get, create
Orders6list, get, create, update_status, ship, cancel
Products4list, get, get_variant, create
Inventory6get_stock, create_item, adjust, reserve, confirm, release
Returns5list, get, create, approve, reject
Carts/Checkout14create, add_item, set_address, set_payment, complete_checkout
Analytics10sales_summary, top_products, demand_forecast, revenue_forecast
Currency8get_rate, convert, set_rate, format
Tax9calculate_tax, calculate_cart_tax, get_rate, list_jurisdictions
Promotions10list, create, activate, create_coupon, validate_coupon, apply
Subscriptions15list_plans, create_plan, create_subscription, pause, resume, cancel
Manufacturing11list_boms, create_bom, create_work_order, complete_work_order
Payments5list, get, create, complete, create_refund
Shipments3list, create, deliver
Suppliers/POs6list_suppliers, create_supplier, create_purchase_order
Invoices5list, create, send, record_payment, get_overdue
Warranties4list, create, create_claim, approve_claim
Stablecoin4get_agent_wallet, get_wallet_balance, create_payment, list_chains

Configuration

Environment Variables

Database

Flags Reference

FlagDescription
--db <path>Database path
--applyEnable write operations
--model <name>Claude model to use
--resume <id>Resume previous session
--jsonJSON output
--verboseReal-time telemetry
--statsExecution statistics
--parallel <n>Process batch requests in parallel
--batch <file>Read requests from file
--stdinRead requests from stdin
--helpShow help

Session Management

Sessions enable multi-turn conversations with context preservation:

Tutorials

Learn the CLI with interactive tutorials:

Shell Completions

Generate shell completion scripts:

Command Reference

stateset - AI Agent

stateset-chat - Interactive Mode

stateset-direct - Direct Commands

Error Handling

The CLI provides structured error handling with helpful suggestions:

Diagnostics

Run health checks:

Development

Programmatic Usage

The CLI modules can be used programmatically: