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-runAPI mode — pull directly from Omni:
bash
omx omni sync \
--host https://company.omniapp.co \
--model-id <uuid> \
--token $OMNI_API_TOKENOutput:
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 runomx 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 --jsonOutput:
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.customersWhat Gets Imported
| Omni concept | OnlyMetrix IR |
|---|---|
view.sql_table_name | MetricIR.source_tables |
view.measures | MetricIR.measures |
view.dimensions | MetricIR.dimensions (Pass 2b skipped — Omni is source of truth) |
topic.relationships | MetricIR.joins |
dimension.type: timestamp | DimensionKind::Temporal |
dimension.type: string | DimensionKind::Categorical |
aggregate_type: sum | AggFunc::Sum |
aggregate_type: count_distinct | COUNT(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.idMaps 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 investigationEnvironment Variables
| Variable | Default | Description |
|---|---|---|
OMX_API_URL | https://api.onlymetrix.com | OnlyMetrix API |
OMX_API_KEY | — | OnlyMetrix API key |
OMNI_API_TOKEN | — | Omni API token (for API mode) |