Skip to content

omx omni

Omni Analytics integration — import Omni models into OnlyMetrix.

Commands

omx omni sync

Sync Omni model definitions to OnlyMetrix. Two modes: local files or Omni REST API.

Local mode — read from a git-synced model directory:

bash
omx omni sync --project-dir ~/omni-models
omx omni sync --project-dir ~/omni-models --dry-run

API mode — pull directly from Omni:

bash
omx omni sync \
  --host https://company.omniapp.co \
  --model-id <uuid> \
  --token $OMNI_API_TOKEN

Output:

Fetching model abc-123 from https://company.omniapp.co...
Scanning /tmp/omni-model-xyz for Omni model files...

OMNI SYNC COMPLETE

  6 synced    0 failed    6 total

  Catalog synced. Run: omx validation run

omx omni list

List metrics that would be extracted from an Omni project without syncing.

bash
omx omni list --project-dir ~/omni-models
omx omni list --project-dir ~/omni-models --json

Output:

OMNI METRICS — 6 found

  orders:
    o orders_total_revenue (sum)
      SELECT SUM(amount) AS total_revenue FROM public.orders
    o orders_order_count (count)
      SELECT COUNT(id) AS order_count FROM public.orders

  customers:
    o customers_customer_count (count)
      SELECT COUNT(id) AS customer_count FROM public.customers

What Gets Imported

Omni conceptOnlyMetrix IR
view.sql_table_nameMetricIR.source_tables
view.measuresMetricIR.measures
view.dimensionsMetricIR.dimensions (Pass 2b skipped — Omni is source of truth)
topic.relationshipsMetricIR.joins
dimension.type: timestampDimensionKind::Temporal
dimension.type: stringDimensionKind::Categorical
aggregate_type: sumAggFunc::Sum
aggregate_type: count_distinctCOUNT(DISTINCT col)

Topic Join Mapping

Omni topics define relationships between views. These map to join paths:

yaml
# Omni .topic file
relationships:
  - join_from_view: orders
    join_to_view: customers
    relationship_type: many_to_one
    on: orders.customer_id = customers.id

Maps to:

JoinPath {
  from_table: "public.orders",
  to_table: "public.customers",
  on_clause: "orders.customer_id = customers.id",
  cardinality: ManyToOne,
}

Dimensions from joined views get source_table: Some("public.customers") — enabling join resolution at query time.

After Sync

Once synced, Omni metrics work with the full pipeline:

bash
omx reliability check        # reliability scores for Omni metrics
omx validation run           # inferred tests against live data
omx agent "analyze revenue"  # agent investigation

Environment Variables

VariableDefaultDescription
OMX_API_URLhttps://api.onlymetrix.comOnlyMetrix API
OMX_API_KEYOnlyMetrix API key
OMNI_API_TOKENOmni API token (for API mode)

MIT Licensed (SDK) | Proprietary (Server)