Toolchain

CLI Commands

Complete reference for MoneyMQ CLI commands

The MoneyMQ CLI provides commands for running your payment server, managing catalogs, and initializing projects.


Installation

Install MoneyMQ CLI:

curl -sSL https://install.money.mq | bash
git clone https://github.com/txtx/moneymq
cd moneymq
cargo moneymq-install

Verify the installation:

moneymq --version

Quick Reference

CommandDescription
moneymq run [ENV]Run MoneyMQ with a specific environment
moneymq sandboxRun in sandbox mode (shorthand for run sandbox)
moneymq initInitialize a new MoneyMQ project
moneymq catalog fetchFetch and display catalog from Stripe
moneymq catalog syncSync Stripe catalog to local YAML files
moneymq lintLint manifest and catalog files
moneymq cloud loginLog in to MoneyMQ Cloud
moneymq cloud logoutLog out of MoneyMQ Cloud
moneymq cloud statusShow current login status
moneymq mcpStart the MCP server for AI integration

Running MoneyMQ

moneymq run

Run MoneyMQ with a specified environment from your manifest.

moneymq run [ENVIRONMENT] [OPTIONS]

Arguments:

ArgumentDescriptionDefault
ENVIRONMENTEnvironment name from your manifestsandbox

Options:

OptionDescription
--port <PORT>Override the port from environment config
--log-level <LEVEL>Log level: error, warn, info, debug, trace
-m, --manifest-path <PATH>Path to manifest file (default: ./moneymq.yaml)

Examples:

# Run the sandbox environment (default)
moneymq run

# Explicitly run sandbox
moneymq run sandbox

# Run a staging environment
moneymq run staging

# Run production environment
moneymq run production

# Override port
moneymq run sandbox --port 9000

# Enable debug logging
moneymq run sandbox --log-level debug

# Use a different manifest file
moneymq run --manifest-path ./config/moneymq.yaml

The environment name must match an entry in your manifest's environments section:

moneymq.yaml
environments:
  sandbox:
    deployment: Sandbox
    # ...
  staging:
    deployment: SelfHosted
    # ...
  production:
    deployment: CloudHosted
    # ...

moneymq sandbox

Shorthand for moneymq run sandbox. Starts MoneyMQ in sandbox mode with an embedded Surfpool validator.

moneymq sandbox [OPTIONS]

Options:

OptionDescription
--port <PORT>Override the port from environment config
--log-level <LEVEL>Log level: error, warn, info, debug, trace
--weather-exampleLoad example Weather API catalog (starter, pro, enterprise tiers)
-m, --manifest-path <PATH>Path to manifest file (default: ./moneymq.yaml)

Examples:

# Start sandbox (equivalent to moneymq run sandbox)
moneymq sandbox

# With custom port
moneymq sandbox --port 9000

# Load example products for testing
moneymq sandbox --weather-example

# Enable debug logging
moneymq sandbox --log-level debug

In sandbox mode, MoneyMQ automatically starts an embedded Surfpool validator and funds test accounts with SOL and USDC.


Project Initialization

moneymq init

Initialize a new MoneyMQ project with interactive setup.

moneymq init [OPTIONS]

Options:

OptionDescription
--manifest-path <PATH>Where to create the manifest

What it creates:

  • moneymq.yaml - Project manifest
  • billing/v1/products/ - Product definitions directory
  • billing/v1/meters/ - Meter definitions directory
  • .env.example - Example environment variables

Example:

# Initialize in current directory
moneymq init

# Initialize with custom manifest path
moneymq init --manifest-path ./config/moneymq.yaml

Catalog Management

moneymq catalog fetch

Fetch and display your product catalog from Stripe. This command shows your catalog without saving to disk - use catalog sync to save locally.

moneymq catalog fetch [OPTIONS]

Options:

OptionDescription
-k, --api-key <KEY>Stripe API key (overrides env var)
-f, --format <FORMAT>Output format: pretty (default) or json
-m, --manifest-path <PATH>Path to manifest file

Environment Variables:

VariableDescription
STRIPE_SECRET_KEYYour Stripe API key (production)
STRIPE_SANDBOX_SECRET_KEYYour Stripe API key (test mode)

Examples:

# Fetch and display catalog (pretty format)
export STRIPE_SECRET_KEY=sk_live_...
moneymq catalog fetch

# Output as JSON
moneymq catalog fetch --format json

# Use specific API key
moneymq catalog fetch --api-key sk_live_xxxxx

# Fetch from sandbox
moneymq catalog fetch -s

moneymq catalog sync

Download your Stripe catalog and save it locally as YAML files. This is an interactive command that:

  • Downloads products and meters from Stripe
  • Compares with existing local files
  • Prompts for handling conflicts (pull remote or keep local)
  • Optionally matches production products with sandbox equivalents
moneymq catalog sync [OPTIONS]

Options:

OptionDescription
-k, --api-key <KEY>Stripe API key (overrides env var)
-m, --manifest-path <PATH>Path to manifest file

Examples:

# Sync catalog from Stripe to local YAML files
export STRIPE_SECRET_KEY=sk_live_...
moneymq catalog sync

# Use specific API key
moneymq catalog sync --api-key sk_live_xxxxx

This creates YAML files in your catalog directory:

billing/v1/
  products/
    prod_abc123.yaml
    prod_def456.yaml
  meters/
    meter_xyz789.yaml

If STRIPE_SANDBOX_SECRET_KEY is set, the sync will also attempt to match production products with their sandbox equivalents.


Linting

moneymq lint

Validate your manifest and catalog files for errors and warnings.

moneymq lint [OPTIONS]

Options:

OptionDescription
-m, --manifest-path <PATH>Path to manifest file
-c, --catalog <NAME>Catalog to lint

Example:

# Lint the default catalog
moneymq lint

# Lint a specific catalog
moneymq lint --catalog v2

Output:

✓ Linting catalog at billing/v1...

  ✓ 3 products validated
  ⚠ 1 warning: Product "weather-starter" has no description

Lint passed! 3 products, 0 errors, 1 warning

The linter checks for:

  • Valid YAML syntax
  • Required fields (name, prices)
  • Price configuration (amounts, intervals)
  • Metadata format
  • Feature definitions

MCP Server

moneymq mcp

Start the Model Context Protocol (MCP) server for AI integration. This allows AI assistants like Claude to interact with MoneyMQ.

moneymq mcp

Usage with Claude Code:

Configure in your Claude Code settings (~/.claude/settings.json):

{
  "mcpServers": {
    "moneymq": {
      "command": "moneymq",
      "args": ["mcp"]
    }
  }
}

Available Tools:

ToolDescription
add_product_to_catalogCreate product YAML files from AI-generated product definitions

The MCP server enables AI agents to scaffold MoneyMQ projects and create product catalogs through natural language.


Cloud Commands

MoneyMQ Cloud provides hosted deployment and management of your payment infrastructure.

moneymq cloud login

Authenticate with MoneyMQ Cloud. Supports three methods:

# Browser-based OAuth (default, interactive)
moneymq cloud login

# Email/password authentication
moneymq cloud login --email user@example.com --password secret

# Personal Access Token (non-interactive, for CI/CD)
moneymq cloud login --pat your_personal_access_token

Options:

OptionDescription
-e, --email <EMAIL>Email address for authentication
-p, --password <PASSWORD>Password (required with email)
--pat <PAT>Personal Access Token for non-interactive login

moneymq cloud logout

Log out of MoneyMQ Cloud and remove stored credentials.

moneymq cloud logout

moneymq cloud status

Show current authentication status.

moneymq cloud status

Example output:

Logged in as: John Doe
Email: john@example.com
Status: Active

Global Options

These options work with all commands:

OptionShortDescription
--manifest-path <PATH>-mPath to manifest file
--catalog <NAME>-cCatalog to use from manifest
--network <NAME>-nNetwork configuration to use
--sandbox-sUse sandbox configuration
--help-hShow help
--version-VShow version

Output

When MoneyMQ starts successfully, you'll see output like:

Loading products ✓ 3 products
Loading meters ⚠ Meters directory not found

# Catalog & Billing API (schema: stripe)
  GET http://localhost:8488/catalog/v1/products
 POST http://localhost:8488/catalog/v1/billing/meters
  ...

# Payment API (protocol: x402, public key: 7xKX...)
  GET http://localhost:8488/payment/v1/supported
 POST http://localhost:8488/payment/v1/verify
 POST http://localhost:8488/payment/v1/settle

MoneyMQ Studio: http://localhost:8488 - Press Ctrl+C to stop

Environment Variables

MoneyMQ uses these environment variables:

VariableDescription
MONEYMQ_SOLANA_FACILITATOR_KEYPAIRBase58 Solana keypair for payment API
STRIPE_SECRET_KEYStripe production API key
STRIPE_SANDBOX_SECRET_KEYStripe test mode API key
RUST_LOGLog level (e.g., debug, info, warn)

Example .env file:

.env
MONEYMQ_SOLANA_FACILITATOR_KEYPAIR=your_base58_keypair
STRIPE_SECRET_KEY=sk_live_...
STRIPE_SANDBOX_SECRET_KEY=sk_test_...
RUST_LOG=info

MoneyMQ automatically loads .env files from your project root.


Debug Logging

Enable debug logging to troubleshoot issues:

RUST_LOG=debug moneymq sandbox

Log levels:

  • error - Only errors
  • warn - Warnings and errors
  • info - General information (default)
  • debug - Detailed debugging
  • trace - Very verbose tracing

Exit Codes

CodeMeaning
0Success
1General error

Next Steps

On this page