Skip to content

Output formats and file output

The CLI separates what the data looks like (--format), how it is shaped (--template), and where it goes (stdout, a file, or many files). This page covers formats and file output; templating has its own guide.

Set with --format / -f.

FormatOutputBest for
tableHuman-readable table (default for list)Interactive use
jsonPretty-printed JSON (default for get)Scripting, piping to jq
yaml / ymlYAMLConfig files, readability
json-compact / compactSingle-line JSON, no whitespaceStreaming, grep
csvCSV, flattened to the lowest levelSpreadsheets, data analysis
Terminal window
katalogue system list --format table
katalogue system list --format json
katalogue system list --format yaml
katalogue field list --format csv
katalogue field list --format json-compact | grep '"is_pii":true'

table is for display only: it cannot be combined with --template or any file-output option, and the export command does not accept it (its choices are json, yaml, yml, json-compact, compact, csv).

When --include-children is combined with --format csv, the hierarchy is flattened to the lowest available level (fields if present, otherwise datasets, dataset groups, or datasources). Parent values are repeated in every child row.

Terminal window
katalogue system get 1 --include-children --format csv
# → one CSV row per field, with system/datasource/dataset columns denormalized into each row

glossary export --format csv flattens the nested business_terms tree instead: one row per asset (business term or field description), with the term hierarchy in a path column and glossary metadata denormalized into each row. A field description linked to several terms produces one row per link.

Terminal window
katalogue glossary export 2 --format csv
# → one CSV row per business term / field description, with a path column

Use --output-file / -o to write rendered output to a file instead of printing it.

Terminal window
# Write JSON to a file
katalogue system get 1 --include-children --format json --output-file ./export.json
# Write dbt-source YAML to a file
katalogue datasource export 5 --template dbt-source --output-file ./sources.yml
# Overwrite an existing file
katalogue datasource export 5 --template dbt-source --output-file ./sources.yml --overwrite

Use --split-by / -s with --output-dir / -d to write one file per resource level.

Terminal window
# One JSON file per dataset
katalogue system get 1 --include-children --format json \
--split-by dataset --output-dir ./out/
# One dbt-source YAML file per dataset
katalogue system export 1 --template dbt-source \
--split-by dataset --output-dir ./dbt/models/

Valid --split-by levels depend on the root resource:

Root resourceValid split levels
systemsystem, datasource, dataset_group, dataset
datasourcedatasource, dataset_group, dataset
dataset_groupdataset_group, dataset
datasetdataset

File extensions are derived automatically: --format yaml.yaml, --format json.json, --format csv.csv; built-in or repo-registered templates use their configured default format; and direct .j2 files fall back to .yml. When both a format and a template are set, the format wins.

With --split-by, control per-file names using --filename-template — a Jinja2 expression evaluated against each split’s context:

Terminal window
katalogue system export 1 --template dbt-source \
--split-by dataset --output-dir ./out \
--filename-template '{{ dataset.dataset_name }}.yml'

See Filename templates for the available context variables.

Preview the planned files without writing anything:

Terminal window
katalogue system export 1 --template dbt-source \
--split-by dataset --output-dir ./out --dry-run

The output lists every file that would be created.