muxi deploy

Push your formation to production

Deploy a formation to MUXI Server with zero downtime. The server handles rolling updates, health checks, and automatic restarts.

For local development, use muxi up / muxi down instead - like docker compose up / docker compose down. Runs directly from source without bundling. See the cheatsheet.

Usage

muxi deploy [options]

Basic Deploy

cd my-formation
muxi deploy

Output:

Deploying my-assistant...
✓ Bundled formation
✓ Uploaded to server
✓ Formation started on port 8001
✓ Health check passed

Formation deployed successfully!
API: http://localhost:8001

Options

Flag Description
--profile <name> Server profile to use
--path <dir> Formation directory
--validate Validate only, don't deploy
--dry-run Show what would be deployed
--include-db Include memory.db in bundle (excluded by default)

Deploy to Profile

muxi deploy --profile production

Uses server from profile:

# ~/.muxi/cli/servers.yaml
profiles:
  production:
    url: https://prod.example.com:7890
    key_id: MUXI_production
    secret_key: sk_...

Deploy from Path

muxi deploy --path /path/to/formation

Validate Only

Check formation without deploying:

muxi deploy --validate

Output:

Validating my-assistant...
✓ Schema valid
✓ Agents valid
✓ MCPs valid
✓ Secrets configured

Formation is valid.

Dry Run

muxi deploy --dry-run

Shows what would be deployed without making changes.

Persistent Memory (memory.db)

Formations using SQLite for persistent memory store data in memory.db in the formation directory. By default, this file is excluded from deploy bundles to prevent overwriting production data with local development data.

# Default: memory.db is excluded
muxi deploy

# Include memory.db (e.g., for initial seeding)
muxi deploy --include-db

The server maintains memory.db separately from deployed formation files, so it persists across deploys and rollbacks.

Deploy Process

  1. Validate - Check formation configuration
  2. Bundle - Package formation files
  3. Upload - Send to server
  4. Deploy - Server starts formation
  5. Health check - Verify formation is running

Errors

Missing Secrets

Error: Missing required secrets: OPENAI_API_KEY

Run: muxi secrets setup

Validation Failed

Error: Invalid formation

- agents[0].role is required
- mcps[0].server is required

Fix the errors and retry.

Server Unreachable

Error: Cannot connect to server

Check:

- Server is running
- Network connectivity
- Profile configuration

Full Deployment Cycle

# 1. Create and develop locally
muxi new formation my-bot
cd my-bot
muxi secrets setup
muxi dev

# 2. Deploy to server
muxi deploy --profile production

# 3. Monitor and manage
muxi logs --follow
muxi server get my-bot

# 4. Download server version to another machine
muxi download my-bot --profile production

# 5. Update and redeploy
muxi bump patch
muxi deploy --profile production

Download from Server

Need to get the server version locally? Use muxi download:

# Download to current formation directory (replaces local files)
cd my-bot
muxi download

# Download to new directory
muxi download my-bot --profile production

See muxi server for details.

Examples

# Deploy current directory
muxi deploy

# Deploy to production
muxi deploy --profile production

# Deploy specific formation
muxi deploy --path ~/formations/my-bot

# Validate before deploy
muxi deploy --validate