You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/book/reference/environment-variables.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -129,6 +129,28 @@ To set the path to the global config file, used by ZenML to manage and store the
129
129
export ZENML_CONFIG_PATH=/path/to/somewhere
130
130
```
131
131
132
+
## CLI output formatting
133
+
134
+
### Default output format
135
+
136
+
Set the default output format for all CLI list commands:
137
+
138
+
```bash
139
+
export ZENML_DEFAULT_OUTPUT=json
140
+
```
141
+
142
+
Choose from `table` (default), `json`, `yaml`, `csv`, or `tsv`. This applies to commands like `zenml stack list`, `zenml pipeline list`, etc.
143
+
144
+
### Terminal width override
145
+
146
+
Override the automatic terminal width detection for table rendering:
147
+
148
+
```bash
149
+
export ZENML_CLI_COLUMN_WIDTH=120
150
+
```
151
+
152
+
This is useful when running ZenML in CI/CD environments or when you want to control table formatting regardless of your terminal size.
153
+
132
154
## Server configuration
133
155
134
156
For more information on server configuration, see the [ZenML Server documentation](../getting-started/deploying-zenml/deploy-with-docker.md#zenml-server-configuration-options) for more, especially the section entitled "ZenML server configuration options".
The output can be customized with an `--output` (json, yaml, csv, tsv, table) option and a `--columns` selection. See [environment variables](environment-variables.md#cli-output-formatting) for more details.
52
+
{% endhint %}
53
+
50
54
The following is an example of the layout of the global config directory immediately after initialization:
Copy file name to clipboardExpand all lines: docs/book/user-guide/best-practices/quick-wins.md
+59Lines changed: 59 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ micro-setup (under 5 minutes) and any tips or gotchas to anticipate.
25
25
|[Model Control Plane](#id-12-register-models-in-the-model-control-plane)| Track models and their lifecycle | Central hub for model lineage and governance |
26
26
|[Parent Docker images](#id-13-create-a-parent-docker-image-for-faster-builds)| Pre-configure your dependencies in a base image | Faster builds and consistent environments |
27
27
|[ZenML docs via MCP](#id-14-enable-ide-ai-zenml-docs-via-mcp-server)| Connect your IDE assistant to live ZenML docs | Faster, grounded answers and doc lookups while coding |
28
+
|[Export CLI data](#id-15-export-cli-data-in-multiple-formats)| Get machine-readable output from list commands | Perfect for scripting, automation, and data analysis |
28
29
29
30
30
31
## 1 Log rich metadata on every run
@@ -854,3 +855,61 @@ Using the zenmldocs MCP server, show me how to register an MLflow experiment tra
854
855
- For bleeding-edge features on develop, consult the repo or develop docs directly
855
856
856
857
Learn more: [Access ZenML documentation via llms.txt and MCP](https://docs.zenml.io/reference/llms-txt)
858
+
859
+
## 15 Export CLI data in multiple formats
860
+
861
+
All `zenml list` commands support multiple output formats for scripting, CI/CD integration, and data analysis.
862
+
863
+
```bash
864
+
# Get stack data as JSON for processing with jq
865
+
zenml stack list --output=json | jq '.items[] | select(.name=="production")'
866
+
867
+
# Export pipeline runs to CSV for analysis
868
+
zenml pipeline runs list --output=csv > pipeline_runs.csv
869
+
870
+
# Get deployment info as YAML for configuration management
871
+
zenml deployment list --output=yaml
872
+
873
+
# Filter columns to see only what you need
874
+
zenml stack list --columns=id,name,orchestrator
875
+
876
+
# Combine filtering with custom output formats
877
+
zenml pipeline list --columns=id,name,num_runs --output=json
878
+
```
879
+
880
+
**Available formats**
881
+
-**json** - Structured data with pagination info, perfect for programmatic processing
882
+
-**yaml** - Human-readable structured format, great for configuration
883
+
-**csv** - Comma-separated values for spreadsheets and data analysis
884
+
-**tsv** - Tab-separated values for simpler parsing
885
+
-**table** (default) - Formatted tables with colors and alignment
886
+
887
+
**Key features**
888
+
-**Column filtering** - Use `--columns` to show only the fields you need
889
+
-**Scriptable** - Combine with tools like `jq`, `grep`, `awk` for powerful automation
890
+
-**Environment control** - Set `ZENML_DEFAULT_OUTPUT` to change the default format
891
+
-**Width control** - Override terminal width with `ZENML_CLI_COLUMN_WIDTH` for consistent formatting
892
+
893
+
**Best practices**
894
+
- Use JSON format for robust parsing in scripts (includes pagination metadata)
895
+
- Use CSV/TSV for importing into spreadsheet tools or databases
896
+
- Use `--columns` to reduce noise and focus on relevant data
897
+
- Set default formats via environment variables in CI/CD environments
Copy file name to clipboardExpand all lines: docs/book/user-guide/production-guide/understand-stacks.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,10 @@ Stack 'default' with id '...' is owned by user default and is 'private'.
49
49
...
50
50
```
51
51
52
+
{% hint style="info" %}
53
+
You can customize the output using `--columns` to show specific fields or `--output` to change the format (json, yaml, csv, tsv). Learn more in the [Quick Wins guide](../best-practices/quick-wins.md#id-15-export-cli-data-in-multiple-formats).
54
+
{% endhint %}
55
+
52
56
{% hint style="info" %}
53
57
As you can see a stack can be **active** on your **client**. This simply means that any pipeline you run will be using the **active stack** as its environment.
0 commit comments