Skip to main content
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 / FlagDescription
nameMetric/dimension name (positional).
--contextTag 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
FlagDescription
--metricsMetric name(s): comma-separated and/or repeatable.
--dimensionsDimension name(s): same comma/repeat rules as --metrics.
--filterA filter as field=value or field:op:value (repeatable).
--file, -fSemantic 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
ArgumentDescription
nameMetric name or alias (positional).
Prints the metric’s source, grain, dimensions, freshness (last_validated_at), and any worked examples on file.