Skip to content

User guide (advanced)

Some of Stack's features will not be needed regularly or by all users. This part of the guide provides information about those features, organised as a reference guide. Some of the features are complex and separate pages are dedicated to them.

Environment variables

The existence or content of certain environment variables can affect how Stack behaves. For further information, see the environment variables documentation.

YAML configuration files

Stack is configured by the content of YAML files. A global YAML configuration file contains non-project specific options. A project-level YAML configuration file contains project-specific options and may contain non-project specific options. For further information, see the YAML configuration documentation.

Global flags and options

Stack can also be configured by flags and options on the command line. Global flags and options apply to all of Stack's commands. For further information, see the global flags and options documentation.

Stack commands

Stack's commands are listed below, in alphabetical order.

  • bench - a synonym for stack build --bench
  • build - build packages
  • clean - delete build artefacts for the project packages
  • config - access and modify Stack's configuration
  • docker - use Stack with Docker
  • dot - dependency visualization
  • eval - evaluate some Haskell code inline
  • exec - executate a command in the Stack environment
  • haddock - a synonym for stack build --haddock
  • hoogle - run hoogle
  • hpc - generate Haskell Program Coverage (HPC) code coverage reports
  • ghc - run ghc
  • ghci - run GHCi, a REPL environment
  • ide - information for an integrated development environment (IDE)
  • init - initialise Stack's project-level YAML configuration file for an existing project
  • install - a synonym for stack build --copy-bins
  • list - list packages on Hackage or in a snapshot
  • ls - list information about Stack
  • new - create a new project with Stack
  • path - information about locations used by Stack
  • purge - delete the Stack working directories
  • query - information about the build
  • repl - a synonym for stack ghci
  • run - build and run an executable
  • runghc - run runghc
  • runhaskell - a synonym for stack runghc
  • script - run a Haskell source file as a script
  • sdist - create an archive file for a package, in a form accepted by Hackage
  • setup - get GHC for a Stack project
  • templates - information about templates for use with stack new
  • test - a synonym for stack build --test
  • uninstall - information about how to uninstall Stack
  • unpack - unpack one or more packages locally
  • update - update the package index
  • upgrade - upgrade Stack
  • upload - upload a package to Hackage