Skip to main content

Setup

mori init

Interactive setup. Walks you through engine selection, provider, and credentials.
mori init
Some of these flows might not be optimal since there’s so many combinations. If the interactive flow isn’t working for you, try using the direct connection string method.In the meantime, you can open an issue for the way you were trying to connect.
Non-interactive init with a connection string:
mori init --from "postgres://user:pass@host:5432/mydb?sslmode=require"
More information at Configuration > Providers
Use a custom Docker image for the Shadow container (e.g., for PostgreSQL with pre-installed extensions):
mori init --image myregistry/postgres-custom:16
FlagDescription
--fromConnection string for non-interactive mode
--imageCustom Docker image for the Shadow container. Persisted in mori.yaml and used by mori start. Useful when extensions cannot be auto-installed via apt-get (e.g., distroless images, proprietary extensions).
For PostgreSQL, Mori automatically attempts to install extensions via apt-get inside the Shadow container when CREATE EXTENSION fails. The --image flag is an escape hatch for cases where auto-install does not work.

Running

mori start

Start the proxy. On first run, creates the Shadow database.
mori start                    # Start with default connection
mori start my-connection      # Start a specific connection
mori start --port 5433        # Start on a custom port
mori start --verbose          # Log all queries and routing decisions
mori start --mcp              # Enable MCP server for AI agents
mori start --mcp-port 9000    # Set MCP server port
FlagDescriptionDefault
--portProxy listen portAuto-assign
--verboseLog all queries and routing decisionsfalse
--mcpEnable MCP serverfalse
--mcp-portMCP HTTP server port9000
--max-rowsMax rows to hydrate from prod per query0 (unlimited)

mori stop

Graceful shutdown. Persists all state (Delta Map, Tombstone Set, Schema Registry).
mori stop

State Management

mori reset

Wipe all local state — Shadow data, Delta Map, Tombstone Set, Schema Registry. Use this for quick resets between runs.
mori reset            # Wipe local state
mori reset is irreversible. The local shadow persists, but all local mutations are permanently deleted.

mori reinit

Wipe all local state and delete the shadow container. Use this when the production schema has changed since the last init.
mori reinit            # Wipe local state and delete the shadow container
mori reinit is irreversible. The local shadow and all local mutations are permanently deleted.

mori status

Display current state: delta rows, tombstones, schema diffs, sequence offsets.
mori status

mori inspect

Detailed state for a specific table: delta count, tombstone count, schema divergence, PK type.
mori inspect users

Logging

mori log

Stream the proxy activity log.
mori log              # Stream live
mori log --tail 50    # Show last 50 entries

mori dash

Launch the TUI dashboard — real-time query stream, delta/tombstone stats, table breakdown, live charts.
mori dash

Connection Management

mori ls

List all configured connections.
mori ls

mori rm

Remove a connection and its associated state.
mori rm my-connection

mori config

View or edit configuration.
mori config

Configuration Files

Mori stores all state in a .mori/ directory at your project root, created by mori init. See Components for details on each state file.
.mori/
  mori.yaml             # Connection config (engine, addresses, ports)
  shadow/               # Shadow container metadata
  state/
    delta.json           # Delta Map (locally modified rows)
    tombstones.json      # Tombstone Set (locally deleted rows)
    schema_registry.json # Schema divergence tracking
    tables.json          # Table metadata (PKs, types)
    sequences.json       # Sequence offsets
  log/                   # Query and routing logs
You may want to check mori.yaml into version control (with secrets excluded) so teammates can share the same connection setup.