Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions reference/commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ and these :ref:`custom command examples <examples_extensions_custom_commands>`
commands/search
commands/version
commands/workspace
commands/run

- :doc:`conan cache <commands/cache>`: Return the path of recipes and packages in the cache
- :doc:`conan config <commands/config>`: Manage Conan configuration (remotes, settings, plugins, etc)
Expand All @@ -45,6 +46,7 @@ and these :ref:`custom command examples <examples_extensions_custom_commands>`
- :doc:`conan search <commands/search>`: Search packages matching a name
- :doc:`conan version <commands/version>`: Give information about the Conan client version
- :doc:`conan workspace (incubating) <commands/workspace>`: Manage Conan workspaces
- :doc:`conan run <commands/run>`: Execute binaries with automatic environment activation


**Creator commands:**
Expand Down
29 changes: 29 additions & 0 deletions reference/commands/run.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
.. _reference_commands_run:

conan run
=========

.. autocommand::
:command: conan run -h


The conan run command lets you directly execute a binary from a Conan package, automatically resolving and installing
all its dependencies. There’s no need to manually activate environments: just pass the executable,
and Conan runs it.

The command can receive either a conanfile or have the requirements specified directly in the cli.

For example, if we to call an specific version of openssl we would:

.. code-block:: bash

$ conan run "openssl --version" --tool-requires=openssl/3.5.4

Installing and building dependencies, this might take a while...
OpenSSL 3.5.4 30 Sep 2025 (Library: OpenSSL 3.5.4 30 Sep 2025)

This command is useful when you want to execute somme specific binary from any package.

.. note::
This command activates both the ``host`` and ``build`` contexts, so that both contexts binaries are made available at once.
In case that a packege exists in both contexts, the ``host`` context binaries take precedence.