stack - Man Page
manual page for Version 2.15.7 x86_64
Examples (TL;DR)
- Create a new package:
stack new package template
- Compile a package:
stack build
- Run tests inside a package:
stack test
- Compile a project and re-compile every time a file changes:
stack build --file-watch
- Compile a project and execute a command after compilation:
stack build --exec "command"
- Run a program and pass an argument to it:
stack exec program -- argument
Synopsis
stack [--help] [--version] [--numeric-version] [--hpack-numeric-version]
Description
stack - The Haskell Tool Stack
[--docker*] [--nix*] [--verbosity VERBOSITY | (-v|--verbose) | --silent] [--[no-]time-in-log] [--[no-]rsl-in-log] [--[no-]plan-in-log] [--stack-root STACK-ROOT] [--work-dir WORK-DIR] [--[no-]system-ghc] [--[no-]install-ghc] [--arch ARCH] [--ghc-variant VARIANT] [--ghc-build BUILD] [-j|--jobs JOBS] [--extra-include-dirs DIR] [--extra-lib-dirs DIR] [--custom-preprocessor-extensions EXT] [--with-gcc PATH-TO-GCC] [--with-hpack HPACK] [--[no-]skip-ghc-check] [--[no-]skip-msys] [--local-bin-path DIR] [--setup-info-yaml URL] [--[no-]modify-code-page] [--[no-]allow-different-user] [--[no-]dump-logs] [--color|--colour WHEN] [--snapshot-location-base URL] [--[no-]script-no-run-compile] [--resolver|--snapshot SNAPSHOT] [--compiler COMPILER] [--[no-]terminal] [--stack-colors|--stack-colours STYLES] [--terminal-width INT] [--stack-yaml STACK-YAML] [--lock-file ARG] COMMAND|FILE
Available options
- --help
Show this help text.
- --version
Show version.
- --numeric-version
Show only version number.
- --hpack-numeric-version
Show only Hpack's version number.
- --docker*
Run 'stack --docker-help' for details.
- --nix*
Run 'stack --nix-help' for details.
- --verbosity VERBOSITY
Set verbosity level: silent, error, warn, info or debug.
- -v,--verbose
Enable verbose mode: verbosity level "debug".
- --silent
Enable silent mode: verbosity level "silent".
- --[no-]time-in-log
Enable/disable inclusion of timings in logs, for the purposes of using diff with logs. (default: enabled)
- --[no-]rsl-in-log
Enable/disable inclusion of raw snapshot layer (rsl) in logs. (default: disabled)
- --[no-]plan-in-log
Enable/disable inclusion of information about build plan construction in logs. (default: disabled)
- --stack-root STACK-ROOT
Absolute path to the global Stack root directory. Overrides any STACK_ROOT environment variable.
- --work-dir WORK-DIR
Relative path to Stack's work directory. Overrides any STACK_WORK environment variable. (default: '.stack-work')
- --[no-]system-ghc
Enable/disable using the system installed GHC (on the PATH) if it is available and its version matches. (default: disabled)
- --[no-]install-ghc
Enable/disable downloading and installing GHC if necessary. (Can be done manually with 'stack setup'.) (default: enabled)
- --arch ARCH
System architecture, e.g. i386, x86_64, aarch64.
- --ghc-variant VARIANT
Specialized GHC variant, e.g. int-native or integersimple (incompatible with --system-ghc).
- --ghc-build BUILD
Specialized GHC build, e.g. 'gmp4' or 'standard' (usually auto-detected).
- -j,--jobs JOBS
Number of concurrent jobs to run.
--extra-include-dirs DIR Extra directories to check for C header files.
- --extra-lib-dirs DIR
Extra directories to check for libraries.
- --custom-preprocessor-extensions EXT
Extensions used for custom preprocessors.
- --with-gcc PATH-TO-GCC
Use gcc found at PATH-TO-GCC.
- --with-hpack HPACK
Use HPACK executable (overrides bundled Hpack).
- --[no-]skip-ghc-check
Enable/disable skipping the GHC version and architecture check. (default: disabled)
- --[no-]skip-msys
Enable/disable skipping the local MSYS installation (Windows only). (default: disabled)
- --local-bin-path DIR
Override the target directory for 'stack build --copy-bins' and 'stack install'. DIR can be an absolute path or one relative to the current directory.
- --setup-info-yaml URL
Alternate URL or path (relative or absolute) for Stack dependencies.
- --[no-]modify-code-page
Enable/disable setting the codepage to support UTF-8 (Windows only). (default: enabled)
- --[no-]allow-different-user
Enable/disable permission for users other than the owner of the Stack root directory to use a Stack installation (POSIX only). (default: inside Docker, true; otherwise, false)
- --[no-]dump-logs
Enable/disable dump the build output logs for local packages to the console. (default: dump warning logs)
- --color,--colour WHEN
Specify when to use color in output; WHEN is 'always', 'never', or 'auto'. On Windows versions before Windows 10, for terminals that do not support color codes, the default is 'never'; color may work on terminals that support color codes.
- --snapshot-location-base URL
The base location of LTS/Nightly snapshots.
- --[no-]script-no-run-compile
Enable/disable the use of options `--no-run --compile` with `stack script`. (default: disabled)
- --resolver,--snapshot SNAPSHOT
Override snapshot in the project configuration file.
- --compiler COMPILER
Use the specified compiler.
- --[no-]terminal
Enable/disable overriding terminal detection in the case of running in a false terminal.
- --stack-colors,--stack-colours STYLES
Specify Stack's output styles; STYLES is a colon-delimited sequence of key=value, where 'key' is a style name and 'value' is a semicolon-delimited list of 'ANSI' SGR (Select Graphic Rendition) control codes (in decimal). Use 'stack ls stack-colors --basic' to see the current sequence. In shells where a semicolon is a command separator, enclose STYLES in quotes.
- --terminal-width INT
Specify the width of the terminal, used for pretty-print messages.
- --stack-yaml STACK-YAML
Override project stack.yaml file (overrides any STACK_YAML environment variable).
- --lock-file ARG
Specify how to interact with lock files. (default: if resolver is overridden: read-only; otherwise: read/write)
Available commands
- build
Build the package(s) in this directory/configuration.
- install
Shortcut for 'build --copy-bins'.
- uninstall
Show how to uninstall Stack or a Stack-supplied tool. This command does not itself uninstall Stack or a Stack-supplied tool.
- test
Shortcut for 'build --test'.
- bench
Shortcut for 'build --bench'.
- haddock
Shortcut for 'build --haddock'.
- new
Create a new project from a template. Run 'stack templates' to see available templates. Will also initialise if there is no stack.yaml file. Note: you can also specify a local file or a remote URL as a template; or force an initialisation.
- templates
Show how to find templates available for 'stack new'. 'stack new' can accept a template from a remote repository (default: github), local file or remote URL. Note: this downloads the help file.
- init
Create Stack project configuration from Cabal or Hpack package specifications.
- setup
Get the appropriate GHC for your project.
- path
Print out handy path information.
- ls
List command. (Supports snapshots, dependencies, Stack's styles and installed tools.)
- unpack
Unpack one or more packages, or one or more package candidates, locally.
- update
Update the package index.
- upgrade
Upgrade Stack, installing to Stack's local-bin directory and, if different and permitted, the directory of the current Stack executable.
- upload
Upload one or more packages, or documentation for one or more packages, to Hackage.
- sdist
Create source distribution tarballs.
- dot
Visualize your project's dependency graph using Graphviz dot.
- ghc
Run ghc.
- hoogle
Run hoogle, the Haskell API search engine. Use the '-- ARGUMENT(S)' syntax to pass Hoogle arguments, e.g. 'stack hoogle -- --count=20', or 'stack hoogle -- server --local'.
- exec
Execute a command. If the command is absent, the first of any arguments is taken as the command.
- run
Build and run an executable. Defaults to the first available executable if none is provided as the first argument.
- ghci
Run ghci in the context of package(s).
- repl
Run ghci in the context of package(s) (alias for 'ghci').
- runghc
Run runghc.
- runhaskell
Run runghc (alias for 'runghc').
- script
Run a Stack script.
- eval
Evaluate some Haskell code inline. Shortcut for 'stack exec ghc -- -e CODE'.
- clean
Delete build artefacts for the project packages.
- purge
Delete the project Stack working directories (.stack-work by default). Shortcut for 'stack clean --full'.
- query
Query general build information (experimental).
- list
List package id's in snapshot (experimental).
- ide
IDE-specific commands.
- docker
Subcommands specific to Docker use.
- config
Subcommands for accessing and modifying configuration values.
- hpc
Subcommands specific to Haskell Program Coverage.
Stack's documentation is available at https://docs.haskellstack.org/. Command 'stack COMMAND --help' for help about a Stack command. Stack also supports the Haskell Error Index at https://errors.haskell.org/.
Compiled with: - Cabal-3.10.3.0 - Cabal-syntax-3.10.3.0 - Glob-0.10.2 - OneTuple-0.4.2 - QuickCheck-2.14.3 - StateVar-1.2.2 - aeson-2.1.2.1 - aeson-warning-parser-0.1.1 - annotated-wl-pprint-0.7.0 - ansi-terminal-1.0.2 - ansi-terminal-types-0.11.5 - appar-0.1.8 - array-0.5.6.0 - asn1-encoding-0.9.6 - asn1-parse-0.9.5 - asn1-types-0.3.4 - assoc-1.1.1 - async-2.2.5 - attoparsec-0.14.4 - attoparsec-0.14.4 - attoparsec-iso8601-1.1.1.0 - auto-update-0.1.6 - base-4.18.2.1 - base-compat-0.13.1 - base-compat-batteries-0.13.1 - base-orphans-0.9.2 - base16-bytestring-1.0.2.0 - base64-bytestring-1.2.1.0 - basement-0.0.16 - bifunctors-5.6.2 - binary-0.8.9.1 - bitvec-1.1.5.0 - blaze-builder-0.4.2.3 - blaze-html-0.9.2.0 - blaze-markup-0.8.3.0 - byteorder-1.0.4 - bytestring-0.11.5.3 - casa-client-0.0.2 - casa-types-0.0.2 - case-insensitive-1.2.1.0 - cereal-0.5.8.3 - clock-0.8.4 - colour-2.3.6 - comonad-5.0.8 - companion-0.1.0 - conduit-1.3.5 - conduit-extra-1.3.6 - containers-0.6.7 - contravariant-1.5.5 - cookie-0.4.6 - cryptohash-sha256-0.11.102.1 - crypton-0.34 - crypton-conduit-0.2.3 - crypton-connection-0.3.2 - crypton-x509-1.7.7 - crypton-x509-store-1.6.9 - crypton-x509-system-1.6.7 - crypton-x509-validation-1.6.12 - data-default-class-0.1.2.0 - data-fix-0.3.4 - deepseq-1.4.8.1 - digest-0.0.2.1 - directory-1.3.8.5 - distributive-0.6.2.1 - dlist-1.0 - easy-file-0.2.5 - echo-0.1.4 - ed25519-0.0.5.0 - exceptions-0.10.7 - extra-1.7.16 - fast-logger-3.2.3 - file-embed-0.0.16.0 - filelock-0.1.1.7 - filepath-1.4.300.1 - fsnotify-0.4.1.0 - generic-deriving-1.14.5 - generically-0.1.1 - ghc-bignum-1.3 - ghc-boot-9.6.6 - ghc-boot-th-9.6.6 - ghc-prim-0.10.0 - githash-0.1.7.0 - hackage-security-0.6.2.4 - hashable-1.4.4.0 - hi-file-parser-0.1.6.0 - hinotify-0.4.1 - hourglass-0.2.12 - hpack-0.36.1 - hpc-0.6.2.0 - http-api-data-0.5.1 - http-client-0.7.17 - http-client-tls-0.3.6.3 - http-conduit-2.3.8.3 - http-download-0.2.1.0 - http-types-0.12.4 - indexed-traversable-0.1.4 - indexed-traversable-instances-0.1.2 - infer-license-0.2.0 - integer-conversion-0.1.0.1 - integer-gmp-1.1 - integer-logarithms-1.0.3.1 - iproute-1.7.14 - libyaml-0.1.4 - lift-type-0.1.2.0 - lifted-base-0.2.3.12 - lukko-0.1.1.3 - megaparsec-9.5.0 - memory-0.18.0 - microlens-0.4.13.1 - microlens-mtl-0.2.0.3 - microlens-th-0.4.3.15 - mime-types-0.1.2.0 - monad-control-1.0.3.1 - monad-logger-0.3.40 - monad-loops-0.4.3 - mono-traversable-1.0.17.0 - mtl-2.3.1 - mustache-2.4.2 - neat-interpolation-0.5.1.4 - network-3.1.4.0 - network-uri-2.6.4.2 - old-locale-1.0.0.7 - old-time-1.1.0.4 - open-browser-0.2.1.0 - optparse-applicative-0.18.1.0 - optparse-simple-0.1.1.4 - os-string-2.0.6 - pantry-0.9.3.2 - pantry-0.9.3.2 - parsec-3.1.16.1 - parser-combinators-1.3.0 - path-0.9.5 - path-io-1.8.2 - path-pieces-0.2.1 - pem-0.2.4 - persistent-2.14.6.1 - persistent-sqlite-2.13.3.0 - persistent-template-2.12.0.0 - pretty-1.1.3.6 - prettyprinter-1.7.1 - prettyprinter-ansi-terminal-1.1.3 - primitive-0.8.0.0 - process-1.6.19.0 - project-template-0.2.1.0 - random-1.2.1.2 - resource-pool-0.4.0.0 - resourcet-1.3.0 - retry-0.9.3.1 - rio-0.1.22.0 - rio-orphans-0.1.2.0 - rio-prettyprint-0.1.8.0 - rts-1.0.2 - safe-exceptions-0.1.7.4 - scientific-0.3.7.0 - semialign-1.3.1 - semigroupoids-6.0.1 - silently-1.2.5.3 - socks-0.6.1 - split-0.2.5 - splitmix-0.1.0.5 - static-bytes-0.1.0 - stm-2.5.1.0 - stm-chans-3.0.0.9 - streaming-commons-0.2.2.6 - strict-0.5 - tagged-0.8.8 - tar-0.5.1.1 - tar-conduit-0.4.1 - template-haskell-2.20.0.0 - temporary-1.3 - text-2.0.2 - text-metrics-0.3.2 - text-short-0.1.6 - th-abstraction-0.5.0.0 - th-compat-0.1.5 - th-lift-0.8.4 - th-lift-instances-0.1.20 - these-1.2.1 - time-1.12.2 - time-compat-1.9.6.1 - tls-1.8.0 - transformers-0.6.1.0 - transformers-base-0.4.6 - transformers-compat-0.7.2 - typed-process-0.2.11.1 - unix-2.8.4.0 - unix-compat-0.7.2 - unix-time-0.4.15 - unliftio-0.2.25.0 - unliftio-core-0.2.1.0 - unordered-containers-0.2.20 - uuid-types-1.0.5.1 - vault-0.3.1.5 - vector-0.13.1.0 - vector-algorithms-0.9.0.2 - vector-stream-0.1.0.1 - witherable-0.4.2 - yaml-0.11.11.2 - zip-archive-0.4.3.2 - zlib-0.6.3.0
Warning: this is an unsupported build that may use different versions of dependencies and GHC than the officially released binaries, and therefore may not behave identically. If you encounter problems, please try the latest official build by running 'stack upgrade --force-download'.