canonic sl exposes the semantic-layer capabilities directly: useful for debugging what a metric resolves to or what SQL a query compiles down to, without executing anything.
With --json, each of these commands’ output matches its corresponding MCP tool payload byte-for-byte (resolve_metric, compile_query, describe_metric).
sl resolve
Resolve a name to its canonical binding.
canonic sl resolve revenue
canonic sl resolve revenue --context finance_review
| Argument / Flag | Description |
|---|
name | Metric/dimension name (positional). |
--context | Tag for context-scoped guardrail resolution. |
Prints the resolved metric, owning source, measure, and binding kind.
sl compile
Compile a semantic query to SQL + metadata without executing it.
canonic sl compile --metrics revenue --dimensions order_date
canonic sl compile --file query.json
| Flag | Description |
|---|
--metrics | Metric name(s): comma-separated and/or repeatable. |
--dimensions | Dimension name(s): same comma/repeat rules as --metrics. |
--filter | A filter as field=value or field:op:value (repeatable). |
--file, -f | Semantic query JSON file. |
--metrics/--dimensions/--filter and -f are mutually exclusive, same as canonic query; see canonic query for the full filter syntax. The flags build the identical SemanticQuery a JSON file would deserialize: {"metrics": [...], "dimensions": [...], "filters": [...], "limit": null}. Output includes the target dialect, the compiled SQL, resolved bindings, and any guardrails that fired.
sl describe
Return grain, dimensions, measures, and freshness for one metric.
canonic sl describe revenue
| Argument | Description |
|---|
name | Metric name or alias (positional). |
Prints the metric’s source, grain, dimensions, freshness (last_validated_at), and any worked examples on file.