Skip to content

The stack query command

Experimental

0.1.6.0

stack query [SELECTOR...]

stack query outputs certain build information. For example, for a multi-package project multi specifying snapshot lts-19.25 (GHC 9.0.2) and with two local packages, my-package-A (version 0.1.0.0) and my-package-B (version 0.2.0.0), command stack query outputs:

compiler:
  actual: ghc-9.0.2
  wanted: ghc-9.0.2
locals:
  my-package-A:
    path: <absolute_path_to>\multi\my-package-A\
    version: 0.1.0.0
  my-package-B:
    path: <absolute_path_to>\multi\my-package-B\
    version: 0.2.0.0

The component parts of the information can be specified using 'selectors' with the command. In the example above the selectors include compiler, compiler actual, locals, locals my-package-A, and locals my-package-A version. For example, commanding:

stack query locals my-package-B path

results in output:

<absolute_path_to>\multi\my-package-B\