Möbius
Reference

mb CLI reference

Install, authenticate, and push governance artifacts from the mb command-line client.

The mb CLI is the developer interface to Möbius. Use it to push governance artifacts from your local machine or CI pipeline, attach warehouse connectors, inspect certification history, and manage governed tables. Get a CLI token from Integration → CLI in the dashboard, or run mb auth login for a browser sign-in.

Installation

Requires Node.js 18+.

npm install -g @mobiusdt/mb

Verify the install:

mb --version

Authentication

Two ways to authenticate:

Browser sign-in (recommended for people):

mb auth login

Opens a browser-based device authorization flow and writes credentials to a named profile in ~/.mb/config.json (default profile: default). Add --profile <name> to keep multiple workspaces or environments side by side. mb auth login refuses to start a new sign-in while the target profile still holds a live token; pass --force to override.

Static token (for scripts and CI):

mb auth set --token <your-cli-token> --base https://your-mobius-url.com

Check current credentials at any time:

mb auth status
# API_BASE:  https://mobius.acme.com
# API_TOKEN: mb_live_••••••••••••5f3a

mb auth logout [--profile <name>] clears stored credentials — a single profile, or the whole config file if --profile is omitted.

Token security

  • CLI tokens are long-lived — treat them like passwords.
  • Store them in your secrets manager or CI secret vault, never in source control.
  • Each token is scoped to a workspace. Revoke unused tokens from Integration → CLI.

Global options

Every command accepts:

FlagMeaning
--token <token>Override the stored API token (default: MOBIUS_TOKEN env var or the active profile)
--base <url>Override the API base URL (default: MOBIUS_API_URL env var or the active profile)
--profile <name>Use a specific named profile instead of the active one
--jsonMachine-readable JSON output, for scripting and CI

Command reference

Table-creation commands (push, delete) only operate on Mode A (connector-backed) tables. Everything else — list, status, gate *, certify, reject, quarantine, config — works on any table regardless of custody mode; the token is workspace-scoped, not mode-scoped.

CommandWhat it does
mb whoamiShow the current identity: profile, user, workspace, role, token scope, effective environment scope
mb listList all tables in the workspace
mb status <tableId>Lifecycle state, certification info, schema drift, active gate-run jobs. --watch polls until no jobs remain
mb push <file>Register a governance artifact (Mode A only — see below)
mb delete <tableId>Deregister a governance artifact (Mode A only — see below)
mb connectors listList warehouse connectors in the workspace
mb versions list <tableId>Show certification history for an artifact
mb versions restore <tableId> --to <version> --reason <text>Put an earlier certified contract version back on the live contract, as a new forward-minted version
mb certify <tableId>Run the certification engine on a table in PENDING_REVIEW and apply the result (interactive auth only — no CLI-token path)
mb reject <tableId> --reason <text>Bounce a PENDING_REVIEW table back to QUARANTINED with an audit trail
mb quarantine listList QUARANTINED tables (alias for mb list filtered to that state)
mb quarantine open <tableId>Fetch a table's DDL and write it to a local file for editing
mb recertification listList open recertification requests (drift, schema change, ingest, manual)
mb recertification dismiss <requestId>Acknowledge a recertification request without certifying or rejecting the table
mb config listShow current workspace configuration
mb config set <key> <value>Update a workspace configuration value
mb config history <key>Show the audit trail for one configuration key
mb contract set-intent <tableId>Set a table's decision class, allowed consumer classes, and (optionally) its structured grain declaration
mb env promote <tableId> --to <env>Promote a table's governance artifact to another environment
mb gate ...Manage Gate 1 rule extensions and run/track gate jobs — see Gate commands

mb push <file>

Push a governance artifact (SQL view, YAML schema, or JSON definition) to Möbius. Mode A onlymb push always registers a connector-backed, no-custody table; there is no CSV/row-upload path through this command. A new artifact is registered in QUARANTINED state and an auto-baseline gate run kicks off immediately; a steward then opens the tracking URL to complete the semantic contract and move it toward certification.

mb push models/customer_risk_profile.sql
# Pushed: customer_risk_profile
# Governance ID: clxyz456...
# Tracking URL:  https://mobius.acme.com/tables/clxyz456
# Status: QUARANTINED — auto-baseline running

Options:

  • --connector <id> — attach a warehouse connector at push time. Required to run Gate 1 predicate SQL and to serve live preview data.
  • --source <schema.table> — the warehouse identity this artifact governs. Required unless the artifact declares it itself (a qualified CREATE VIEW schema.name in SQL, or a source: / "source" key in YAML/JSON). There is no silent fallback to the filename.
  • --replace <governanceId> — update an existing artifact after a schema or SQL change. Required on a name collision; Möbius refuses a push without it to prevent accidental overwrites. A --replace push resets the table to QUARANTINED and triggers recertification if it was previously CERTIFIED. It cannot be used to overwrite a Mode B (custody) table.
  • --wait — block until the auto-baseline job finishes (recommended for CI).
# First push — registers a new governance artifact
mb push models/customer_risk_profile.sql
# Schema changed — re-push to update the existing artifact
mb push models/customer_risk_profile.sql --replace gov_abc123

mb delete <id>

Soft-delete a governance artifact by its governance ID. Mode A only — Möbius refuses a delete against a custody (Mode B) table with a 400; Mode B tables are managed through the dashboard or API instead. The source warehouse object is never touched — only the governance record is removed. Requires confirmation unless --yes is passed. Only the table owner or a workspace admin may delete.

mb delete clxyz456
# Delete governance artifact clxyz456? (y/N) y
# Deleted.

mb list

mb list
# ID                  NAME                       MODE      STATE                  GATE
# dyn_8b3f9c2a        customer_profiles          MODE_A    BASELINE_VERIFIED      ENFORCING
# dyn_a1c2e3f4        orders                     MODE_A    CORE                   ENFORCING
# dyn_4d5e6f7g        ml_training_set            MODE_B    QUARANTINED            ADVISORY

mb status <tableId>

mb status dyn_8b3f9c2a
# Table:        customer_profiles
# Mode:         A (no-custody)
# Lifecycle:    BASELINE_VERIFIED
# Active jobs:
#   [job-bb-01] gate-baseline-auto  RUNNING  17s  (4/6 predicates)

--watch polls every few seconds and streams updates until no active gate-run jobs remain (NDJSON under --json).

mb versions list <tableId>

Shows the immutable certification history — one entry per point-in-time snapshot written when the table reached CERTIFIED.

mb versions list clxyz456
# V#   Certified At          Certified By      Grain
# 3    2026-04-18 09:12:00   user@acme.com     One row per customer, keyed by customer_id...
# 2    2026-04-10 14:03:00   steward@acme.com  One row per customer...

mb versions restore <tableId> --to <version> --reason <text>

Puts an earlier certified contract's content back onto the live contract. Nothing is undone or deleted — a new version is cut recording the restore and who did it. If the table is currently CERTIFIED, a recertification request is filed instead of minting a new certification claim. --reason is required. --env <label> asserts the table's environment; a mismatch is refused. Cross-environment restore is not supported.

mb connectors list

mb connectors list
# ID            NAME              TYPE      STATUS    ENV
# conn_abc123   prod-postgres     POSTGRES  ACTIVE    Production

mb contract set-intent <tableId>

Sets a table's semantic-contract primitives: --intent <METRIC|DECISION|OPERATIONAL|EXPLORATORY> (decision class) and --allowed-consumers <HUMAN,AI,AUTOMATION,EXTERNAL> (which consumer classes may read it), plus an optional structured grain declaration (--grain-type + --grain-key <col>[,<col>...]). Grain, meaning, and other contract fields carry forward unchanged unless you also pass --grain / --meaning.

mb env promote <tableId> --to <env>

Promotes a table's governance artifact to another environment. --dest-profile <name> relays across two CLI profiles (e.g. two separate Möbius workspaces); --bundle-out <file> / --bundle-in <file> export and import the artifact as a portable JSON bundle instead of promoting directly.

Gate commands

The 6 baseline Gate 1 predicates (record count, column presence, grain uniqueness, null rate, referential integrity, numeric bounds) always run on certification. For stricter checks — regex on a column, custom SQL bounds, cross-column arithmetic — declare them in a gate1.yml file and apply it to the contract. Möbius never infers patterns from column names; if you want a check, declare it.

patternChecks:
  - name: customer_email_format
    column: email
    regex: "^[^@]+@[^@]+\.[^@]+$"
    severity: HARD_FAIL

customPredicates:
  - name: positive_balance
    sql: '"balance" >= 0'
    severity: HARD_FAIL

fieldOverrides:
  - field: customer_id
    nullRate:
      warn: 0.0
      fail: 0.0
CommandWhat it does
mb gate get <tableId> [-o file]Fetch the current gate1.yml for a table (stdout, or write to a file)
mb gate apply <tableId> -f <file>Validate and persist a gate1.yml. Private editing — does not notify the steward. Triggers recertification if the table is currently CERTIFIED
mb gate validate -f <file>Offline schema/SQL-safety validation — no server call. Good for pre-commit hooks
mb gate diff <tableId> [-f file]Diff a local gate1.yml against the server's current version. --from vN --to vM instead compares two server versions. Exit code 0 = identical, 1 = different
mb gate run <tableId>Gate 1 (default): dry-run all baseline predicates and return the proof without persisting or changing lifecycle state. --gate 2 or --gate 3 instead enqueues a detached Gate 2 (semantic/structural) or Gate 3 (statistical) run — evidence only, certifies nothing. Gate 3 requires --baseline <reportId>: a distribution verdict is only meaningful against a named baseline. --sample <spec> (Gate 1 only) evaluates a windowed sample — head:N, tail:N, random:N, chunks:K@N
mb gate submit <tableId>Steward handoff. Always a full scan; persists the proof, transitions the table to PENDING_REVIEW, and notifies the steward
mb gate result <jobId>Fetch the proof of a terminal gate-run job
mb gate status <jobId> --gate <n>Unified status/result read for any gate job. --gate is required — --gate 1 reads the same proof as mb gate result; --gate 2 or --gate 3 reads a detached run's result
mb gate cancel <jobId>Cancel a queued or running gate-run job. Defaults to Gate 1; pass --gate 2 or --gate 3 for a detached run
mb gate suggest <tableId>AI-proposed gate1.yml predicate stubs, printed as YAML to stdout with each proposal's justification on stderr. Review before applying — pipe into mb gate apply <tableId> -f -
mb gate apply dyn_8b3f9c2a -f gate1.yml
# ✓ Applied to dyn_8b3f9c2a
#   Recertification: triggered (table was CERTIFIED)

mb gate run dyn_8b3f9c2a --gate 3 --baseline report_abc123
# ⚠️  DETACHED RUN — evidence only, not a certification
# Gate 3 run: job_xyz (QUEUED)
# Track via: mb gate status job_xyz --gate 3

Apply ≠ Submit

mb gate apply is private editing — it persists rules without notifying the steward. Iterate freely. mb gate submit is the explicit steward-handoff verb.

File formats

mb push accepts three file types. The table name and columns are extracted automatically — no manual registration needed.

YAML (.yml / .yaml) — use table: or name: for the table name, columns: or fields: for columns. Best for human-authored governance specs.

table: customer_risk_profile
decision_context: Used by credit risk team to gate loan approvals.
columns:
  - customer_id
  - risk_score
  - risk_band
  - assessed_at

SQL (.sql) — the table name comes from CREATE OR REPLACE VIEW <name>; columns are inferred from the SELECT aliases. Best for dbt views and warehouse-defined datasets. Möbius always publishes the certified projection as a plain SQL view, regardless of what you pushed — the default schema is certified_<env>.

CREATE OR REPLACE VIEW certified_prod.customer_risk_profile AS
SELECT
  c.id          AS customer_id,
  r.score       AS risk_score,
  r.band        AS risk_band,
  r.assessed_at AS assessed_at
FROM customers c
JOIN risk_scores r ON r.customer_id = c.id;

JSON (.json) — use table or name, with a type per column for richer schema inference. Best for programmatically generated artifact definitions.

CI/CD integration

Unattended pipelines that only need to author or replace a governance definition should call POST /api/workspace/definitions directly (see the REST reference), using a management service token stored as a CI secret — not a personal CLI token. There is no mb wrapper over that door: every mb verb carries the logged-in user's authority, and a CI-authored artifact push is a machine action with its own, narrower credential.

- name: Push governance artifact
  env:
    MOBIUS_TOKEN:   ${{ secrets.MOBIUS_MGMT_TOKEN }}
    MOBIUS_API_URL: ${{ secrets.MOBIUS_BASE_URL }}
  run: |
    jq -n --arg filename "models/customer_risk_profile.sql" \
          --arg mimeType "sql" \
          --arg connectorId "${{ vars.CONNECTOR_ID }}" \
          --rawfile content models/customer_risk_profile.sql \
          '{filename:$filename, mimeType:$mimeType, connectorId:$connectorId, content:$content}' \
      | curl --fail-with-body -X POST "$MOBIUS_API_URL/api/workspace/definitions" \
          -H "Authorization: Bearer $MOBIUS_TOKEN" \
          -H "Content-Type: application/json" \
          -d @-

Store the returned governance ID in a CI variable or a lock file committed to your repo — it stays stable across pushes and is what you pass as replaceId on the next schema change.

Error reference

ErrorCauseFix
UnauthorizedToken missing or expiredRun mb auth set or mb auth login with a fresh token
A governance artifact named 'X' already existsName collision without --replaceAdd --replace <governanceId> from the hint in the error
Connector not foundConnector ID doesn't exist or belongs to another workspaceRun mb connectors list for valid IDs
Unsupported file typeFile extension is not .sql, .yml, .yaml, or .jsonConvert the file to a supported format
CLI delete is restricted to warehouse-connected governance artifactsmb delete was pointed at a Mode B (custody) tableManage the table from the dashboard or API instead
Only table owners or workspace admins can deleteInsufficient roleAsk a workspace admin or the table owner to run the delete
--baseline <reportId> is required for Gate 3mb gate run --gate 3 with no --baselinePass the certification report ID Gate 3 should compare against

Best practices

  • Commit artifacts to source control. Treat .sql and .yml governance files like code — version them alongside the models they describe.
  • Store governance IDs in a lock file after the first push, for use with --replace in later CI runs.
  • Attach a connector at push time (--connector) to unlock live preview and Gate 1 predicate checks during certification.
  • Never commit CLI tokens. Use CI secrets or a secrets manager; revoke and rotate if exposed.
  • Use --yes carefully in CI. The delete confirmation prompt exists to prevent accidents — gate automated deletes on an explicit approval step.

On this page