From 51cd5a3e0e7c04c3a962c7b3531527d135a55d7e Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Tue, 14 Jul 2026 00:42:04 +0000 Subject: [PATCH] docs: document --include-spaces/--exclude-spaces for lightdash validate --- references/lightdash-cli.mdx | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/references/lightdash-cli.mdx b/references/lightdash-cli.mdx index fb17201b..9bf6f1c2 100644 --- a/references/lightdash-cli.mdx +++ b/references/lightdash-cli.mdx @@ -537,9 +537,20 @@ All standard [dbt options](#dbt-options) work with `lightdash validate`. - `--only [elems...]` - (default: ["charts","dashboards","tables"]) - Specify project elements to validate +- `--include-spaces ` + - Only report chart and dashboard validation errors from these spaces. Matching cascades recursively into sub-spaces via parent space relationships, so passing a parent space slug also includes everything under it. Use the same `spaceSlug` identifiers that appear in `lightdash download` output. Space slugs aren't unique — if the same slug exists in multiple spaces, all of them (and their sub-spaces) are matched. Mutually exclusive with `--exclude-spaces`. +- `--exclude-spaces ` + - Skip chart and dashboard validation errors from these spaces (and their sub-spaces, applied recursively). Everything else is reported. Mutually exclusive with `--include-spaces`. + + **Notes on space filtering:** + - Unknown slugs fail fast **before** the compile step with an actionable error listing the available slugs, so a typo in CI fails in about a second instead of after a full validation run. + - Spaces that aren't visible to the credentials running the CLI (for example, private spaces the token can't see) can't be matched. + - Table-level errors are project-level and aren't scoped to a space, so they're never affected by these flags. Use `--only tables` (or omit `tables` from `--only`) to control whether table errors are reported. + - When errors are hidden by a space filter, the CLI prints an `(N errors in filtered-out spaces hidden)` note. The exit code reflects only the visible errors, so filtered-out errors won't fail CI. + -**Example:** +**Examples:** Validate only dashboards and use the existing compiled dbt manifest: @@ -547,6 +558,18 @@ Validate only dashboards and use the existing compiled dbt manifest: lightdash validate --only ["dashboards"] --skip-dbt-compile ``` +Validate production content only, so errors in an `archive` space don't fail CI: + +```bash +lightdash validate --exclude-spaces archive +``` + +Validate a single space and everything nested under it: + +```bash +lightdash validate --include-spaces orders +``` + ### `lightdash generate`