Skip to main content

Table Output Formats

Commands that display tabular data provide a shared --format option. The option is available on commands such as cache:list, customer:list, indexer:list, and sys:cron:list.

Supported Formats

FormatDescription
csvComma-separated values with a header row. Suitable for spreadsheets and general data exchange.
tsvTab-separated values with a header row. Useful when values commonly contain commas.
jsonPretty-printed JSON object output.
json_arrayPretty-printed JSON array output. Use this when consumers expect a JSON array rather than an object.
jsonlOne JSON object per line. Also known as JSON Lines. Useful for streaming and shell pipelines.
yamlYAML output for human-readable structured data.
markdownPipe-delimited Markdown table output for documentation and issue trackers.
xmlXML output wrapped in a <table> element.

Format Aliases

The following aliases produce the same output as their canonical format:

AliasFormat
ymlyaml
mdmarkdown
ndjsonjsonl

Aliases are case-insensitive, as are canonical format names.

Examples

Export an indexer list as CSV:

n98-magerun2.phar indexer:list --format=csv

Generate a Markdown table:

n98-magerun2.phar customer:list --format=markdown

Process one JSON record at a time:

n98-magerun2.phar sys:cron:list --format=jsonl | while read -r row; do
printf '%s\n' "$row"
done

Use an alias when preferred:

n98-magerun2.phar config:search "web/*" --format=yml

Invalid Formats

An unsupported value does not fall back to the default terminal table. The command exits with an error that identifies the invalid format and lists the supported canonical formats.

Unknown output format "toml". Supported formats: csv, tsv, json, json_array, jsonl, yaml, markdown, xml.

TOML and TOON are intentionally not supported output formats. TOML is primarily intended for configuration, while TOON is a specialized, less widely supported notation for token-efficient data exchange. JSON, CSV, YAML, and Markdown provide better interoperability for the command-line use cases covered by n98-magerun2.