CLI Overview
The omx CLI gives you command-line access to your OnlyMetrix workspace.
Installation
bash
pip install onlymetrixConfiguration
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 URLAll commands
| Command | Description |
|---|---|
omx init | Interactive setup wizard |
omx health | Health check |
omx status | Workspace status (connection, sync, readiness) |
omx connect | Connect a data warehouse |
omx configure | Set schemas, PII rules, policies |
omx datasources | List configured datasources |
omx datasource delete <name> | Remove a datasource |
omx metrics | List all metrics |
omx metrics create | Create or update a metric |
omx metrics import <file...> | Bulk import from YAML/JSON files |
omx metrics delete <name> | Delete a metric |
omx keys | List API keys |
omx keys create | Generate a new API key |
omx keys revoke <id> | Revoke an API key |
omx tables | List 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-sync | Resolve 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"