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 | bashgit clone https://github.com/txtx/moneymq
cd moneymq
cargo moneymq-installVerify the installation:
moneymq --versionQuick Reference
| Command | Description |
|---|---|
moneymq run [ENV] | Run MoneyMQ with a specific environment |
moneymq sandbox | Run in sandbox mode (shorthand for run sandbox) |
moneymq init | Initialize a new MoneyMQ project |
moneymq catalog fetch | Fetch and display catalog from Stripe |
moneymq catalog sync | Sync Stripe catalog to local YAML files |
moneymq lint | Lint manifest and catalog files |
moneymq cloud login | Log in to MoneyMQ Cloud |
moneymq cloud logout | Log out of MoneyMQ Cloud |
moneymq cloud status | Show current login status |
moneymq mcp | Start the MCP server for AI integration |
Running MoneyMQ
moneymq run
Run MoneyMQ with a specified environment from your manifest.
moneymq run [ENVIRONMENT] [OPTIONS]Arguments:
| Argument | Description | Default |
|---|---|---|
ENVIRONMENT | Environment name from your manifest | sandbox |
Options:
| Option | Description |
|---|---|
--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.yamlThe environment name must match an entry in your manifest's environments section:
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:
| Option | Description |
|---|---|
--port <PORT> | Override the port from environment config |
--log-level <LEVEL> | Log level: error, warn, info, debug, trace |
--weather-example | Load 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 debugIn 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:
| Option | Description |
|---|---|
--manifest-path <PATH> | Where to create the manifest |
What it creates:
moneymq.yaml- Project manifestbilling/v1/products/- Product definitions directorybilling/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.yamlCatalog 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:
| Option | Description |
|---|---|
-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:
| Variable | Description |
|---|---|
STRIPE_SECRET_KEY | Your Stripe API key (production) |
STRIPE_SANDBOX_SECRET_KEY | Your 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 -smoneymq 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:
| Option | Description |
|---|---|
-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_xxxxxThis creates YAML files in your catalog directory:
billing/v1/
products/
prod_abc123.yaml
prod_def456.yaml
meters/
meter_xyz789.yamlIf 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:
| Option | Description |
|---|---|
-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 v2Output:
✓ Linting catalog at billing/v1...
✓ 3 products validated
⚠ 1 warning: Product "weather-starter" has no description
Lint passed! 3 products, 0 errors, 1 warningThe 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 mcpUsage with Claude Code:
Configure in your Claude Code settings (~/.claude/settings.json):
{
"mcpServers": {
"moneymq": {
"command": "moneymq",
"args": ["mcp"]
}
}
}Available Tools:
| Tool | Description |
|---|---|
add_product_to_catalog | Create 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_tokenOptions:
| Option | Description |
|---|---|
-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 logoutmoneymq cloud status
Show current authentication status.
moneymq cloud statusExample output:
Logged in as: John Doe
Email: john@example.com
Status: ActiveGlobal Options
These options work with all commands:
| Option | Short | Description |
|---|---|---|
--manifest-path <PATH> | -m | Path to manifest file |
--catalog <NAME> | -c | Catalog to use from manifest |
--network <NAME> | -n | Network configuration to use |
--sandbox | -s | Use sandbox configuration |
--help | -h | Show help |
--version | -V | Show 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 stopEnvironment Variables
MoneyMQ uses these environment variables:
| Variable | Description |
|---|---|
MONEYMQ_SOLANA_FACILITATOR_KEYPAIR | Base58 Solana keypair for payment API |
STRIPE_SECRET_KEY | Stripe production API key |
STRIPE_SANDBOX_SECRET_KEY | Stripe test mode API key |
RUST_LOG | Log level (e.g., debug, info, warn) |
Example .env file:
MONEYMQ_SOLANA_FACILITATOR_KEYPAIR=your_base58_keypair
STRIPE_SECRET_KEY=sk_live_...
STRIPE_SANDBOX_SECRET_KEY=sk_test_...
RUST_LOG=infoMoneyMQ automatically loads .env files from your project root.
Debug Logging
Enable debug logging to troubleshoot issues:
RUST_LOG=debug moneymq sandboxLog levels:
error- Only errorswarn- Warnings and errorsinfo- General information (default)debug- Detailed debuggingtrace- Very verbose tracing
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | General error |
Next Steps
- Manifest Configuration - Configure your moneymq.yaml
- Integration Guide - Implement payments in your app
Playground 101
This section is an interactive guide giving you a full overview of what MoneyMQ does. It connects directly to your local MoneyMQ installation, so you can run the code snippets and interact with your own setup in real-time.
Manifest Configuration
Configure MoneyMQ with the moneymq.yaml manifest file