Format output
Choose table, JSON or YAML output for any liya command, set a default with LIYA_OUTPUT, and pipe the results into jq and scripts.
After reading this page you will be able to:
- Switch output format per command
- Script against JSON output with jq
Every command accepts -o (or --output):
| Format | For |
|---|---|
-o table | Reading. The default, unless LIYA_OUTPUT sets another. |
-o json | Scripts and jq. The server's full payload. |
-o yaml | Reviewing. |
liya agents list -o json | jq -r '.agents[] | select(.stage=="assist") | .key'
liya budgets list -o yaml > budgets.yamlTables and data go to stdout. Hints go to stderr, so a pipe only ever carries data. liya export writes YAML files for liya apply (see GitOps with liya).
Tip
Tables are for people and may change between releases. Scripts should always use -o json.