.. _command_output:

JSON Command Output
===================

The commands listed below support machine-readable output on stdout. Pass ``--output-format json``
for a compact, single-line result or ``--output-format json-pretty`` for indented output.
Diagnostic messages and progress go to stderr, so stdout can be piped directly into tools such as
``jq``.

A command can print a result and still exit with a nonzero status, for example if some snapshots
could not be removed or some files failed verification. Check the exit status as well as the
result. When piping output in Bash, use ``set -o pipefail`` so the pipeline also reports a failure
of the mirror command. A command that fails before it has a result leaves stdout empty.

``config mirror list``, ``config mirror show``, and the corresponding ``config media`` commands
also support ``--output-format``. They print configuration entries whose properties are described
in the configuration file reference.

.. include:: command-output-schemas.rst
