lsh list command can render its results in a machine-readable format that’s easy to consume from scripts, CI pipelines, and AI agents. Output format, filtering, and pagination all work the same way across every list command.
You can also run lsh output-formats for the built-in version of this guide.
Output formats
Use the global--output (or -o) flag to choose how results are rendered. The default is a human-readable table.
json, yaml, csv) are honored everywhere, including when you pipe the output to another command. An empty result set prints [] in JSON, so your scripts always receive valid JSON to parse.
Filtering with --query
The --query flag post-processes structured output with a JMESPath expression, so you can filter and reshape results without piping to jq or another tool. It works with json, yaml, and csv.
--query requires a structured output format, so pair it with -o json, -o yaml, or -o csv. The expression is validated up front: an invalid query fails immediately with a non-zero exit code instead of producing partial output.
Pagination
List commands fetch every page by default. These global flags give you control over large listings:Environment variables
Set
LSH_OUTPUT to avoid passing -o on every command: