Skip to content

Latest commit

 

History

History
136 lines (107 loc) · 5.85 KB

index.md

File metadata and controls

136 lines (107 loc) · 5.85 KB
title
Commands

Commands (advanced)

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

Stack commands (thematic)

Setting up

  • setup - get GHC for a Stack project (usually not needed)
  • update - update the package index (usually not needed)
  • new - create a new project with Stack
  • init - initialise Stack's project-level YAML configuration file for an existing project

Building

  • build - build packages
  • test - a synonym for stack build --test
  • bench - a synonym for stack build --bench
  • haddock - a synonym for stack build --haddock
  • install - a synonym for stack build --copy-bins
  • run - build and run an executable

Docker-related

  • docker - use Stack with Docker

Executing in the Stack environment

  • exec - executate a command in the Stack environment
  • ghc - run ghc
  • eval - evaluate some Haskell code inline
  • runghc - run runghc
  • runhaskell - a synonym for stack runghc

Using GHC interactively

  • ghci - run GHCi, a REPL environment
  • repl - a synonym for stack ghci

Down/up loading local packages from/to Hackage

  • unpack - unpack one or more packages locally
  • sdist - create an archive file for a package, in a form accepted by Hackage
  • upload - upload a package to Hackage

Cleaning-up

  • clean - delete build artefacts for the project packages
  • purge - delete the Stack working directories

Amending Stack's configuration files

Using Haskell code as a script

  • script - run a Haskell source file as a script

Getting information

  • path - information about locations used by Stack
  • ls - list information about Stack
  • list - list packages on Hackage or in a snapshot
  • ide - information for an integrated development environment (IDE)
  • query - information about the build
  • config env - modify Stack's configuration
  • templates - information about templates for use with stack new
  • uninstall - information about how to uninstall Stack

Using tools in Stack's environment

  • hoogle - run hoogle
  • dot - dependency visualization
  • hpc - generate Haskell Program Coverage (HPC) code coverage reports

Managing Stack versions

Stack commands (alphabetical)

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