Skip to content

CLI Overview

The omx CLI gives you command-line access to your OnlyMetrix workspace.

Installation

bash
pip install onlymetrix

Configuration

Set two environment variables:

bash
export OMX_KEY="omx_sk_..."           # Your API key
export OMX_URL="https://api.onlymetrix.com"  # Default, or your self-hosted URL

All commands

CommandDescription
omx initInteractive setup wizard
omx healthHealth check
omx statusWorkspace status (connection, sync, readiness)
omx connectConnect a data warehouse
omx configureSet schemas, PII rules, policies
omx datasourcesList configured datasources
omx datasource delete <name>Remove a datasource
omx metricsList all metrics
omx metrics createCreate or update a metric
omx metrics import <file...>Bulk import from YAML/JSON files
omx metrics delete <name>Delete a metric
omx keysList API keys
omx keys createGenerate a new API key
omx keys revoke <id>Revoke an API key
omx tablesList accessible tables
omx tables describe <table>Describe table columns
omx query "SELECT ..."Execute raw SQL
omx search "query"Search metrics by natural language
omx dbt sync <manifest.json>Sync metrics from dbt manifest
omx entity-syncResolve entity IDs via Kanoniv

Examples

bash
# Connect to Snowflake
omx connect snowflake --account xy12345 --user SVC \
  --password secret --database ANALYTICS --warehouse WH

# Connect to ClickHouse
omx connect clickhouse --host my-cluster.clickhouse.cloud \
  --port 8443 --user default --password secret --database analytics --secure

# Connect to Postgres
omx connect postgres --host localhost --port 5432 \
  --user admin --password secret --database mydb

# Configure workspace
omx configure --schemas public --pii email:email,phone:phone

# Create a metric
omx metrics create --name total_revenue \
  --description "Total revenue" --sql "SELECT SUM(amount) FROM orders"

# Import metrics from files
omx metrics import metrics/finance.yaml metrics/ops.yaml

# Search by intent
omx search "how much money are we making"

# Run raw SQL
omx query "SELECT country, SUM(revenue) FROM orders GROUP BY country"

MIT Licensed (SDK) | Proprietary (Server)