diff --git a/reference/commands.rst b/reference/commands.rst index 04c81351a39a..1cecb336fdb5 100644 --- a/reference/commands.rst +++ b/reference/commands.rst @@ -75,6 +75,34 @@ and these :ref:`custom command examples ` - :doc:`conan upload `: Upload packages from the local cache to a specified remote +.. _commands_output: + +**Commands Output to stdout and stderr** + +Conan commands output information following a deliberate design choice that aligns with +common practices in many CLI tools and the `POSIX standard +`_: + +- ``stdout``: For final command results (e.g., JSON, HTML). +- ``stderr``: For diagnostic output, including logs, warnings, errors, and progress + messages. + +**Redirecting Output to Files** + +You can redirect Conan output to files using shell redirection: + +.. code-block:: bash + + $ conan install . --format=json > output.json + +Alternatively, use the ``--out-file`` argument (available since Conan 2.12.0) to specify an +output file directly: + +.. code-block:: bash + + $ conan install . --format=json --out-file=output.json + + Command formatters ------------------