stack ls commands¶
stack ls commands list different types of information. Command
for the available commands.
stack ls dependencies command¶
stack ls dependencies lists all of the packages and versions used for a
project. All local packages are considered by default, but a target can be
specified as an argument. For further information, see the
target syntax documentation.
Subcommands specify the format of the output, as follows:
caballists the packages in the format of exact Cabal constraints. For example (extract):
jsonlists dependencies in JSON format (an array of objects). For example (extract):
Each object has the following keys:
~~~json name: zlib version: 0.6.3.0 location: type: hackage url: https://hackage.haskell.org/package/zlib-0.6.3.0 licence: BSD3 dependencies: - base - bytestring ~~~
text(the default) lists the packages, each on a separate line. For example (extract):
treelists dependencies in the format of a tree. For example (extract):
--separator option specifies the separator between the package name and
its version. The default is a space character.
--licence flag, after the
tree subcommand, to replace each
package's version with its licence.
--no-external flag to exclude external dependencies.
--no-include-base flag to exclude dependencies on the
--depth option limits the depth of dependency resolution.
--prune <packages> option prunes the specified packages from the output,
<packages> is a comma separated list of package names.
--flag option allows Cabal flags to be specified.
--test flag to consider the dependencies of test suite components.
--bench flag to consider the dependencies of benchmark components.
--global-hints flag to use a hints file for global packages. The
command then does not require an installed GHC.
stack ls snapshots command¶
stack ls snapshots will list all the local snapshots by default. You can also
view the remote snapshots using
stack ls snapshots remote. It also supports
options for viewing only lts (
-l) and nightly (
stack ls stack-colors command¶
The British English spelling is also accepted (
stack ls stack-colours).
stack ls stack-colors will list all of Stack's output styles. A number of
different formats for the output are available, see
stack ls stack-colors --help.
The default is a full report, with the equivalent SGR instructions and an
example of the applied style. The latter can be disabled with flags
--basic specifies a more basic report, in the format that is accepted
by Stack's command line option
--stack-colors and the YAML configuration key
stack ls tools command¶
stack ls tools will list Stack's installed tools. On Unix-like operating
systems, they will be one or more versions of GHC. On Windows, they will include
MSYS2. For example, on Windows the command:
yields output like:
--filter <tool_name> option will filter the output by a tool name (e.g.
'ghc', 'ghc-git' or 'msys2'). The tool name is case sensitive. For example the
yields output like: