4. External Commands
cabal-install provides a system for external commands, akin to the ones used by tools like
If you execute
cabal-install will search the path for an executable named
cabal-<cmd> and execute it. The name of the command is passed as the first argument and
the remaining arguments are passed afterwards. An error will be thrown in case the custom command is not found.
$CABAL environment variable is set to the path of the
which invoked the subcommand.
It is strongly recommended that you implement your custom commands by calling the
CLI via the
$CABAL variable rather than linking against the
There is no guarantee that the subcommand will link against the same version of the
Cabal library as
cabal-install so it would lead to unexpected results and
cabal-install can also display the help message of the external command.
cabal help <cmd> is invoked, then
cabal-<cmd> <cmd> --help will be called so
your external command can display a help message.
For ideas or existing external commands, visit this Discourse thread.