Command line help

How to dynamically get more information on Pants's internals.

To get help with Pants, enter <<pantscmd>> help:

$ <<pantscmd>> help
Pants 1.28.0.dev2 https://pypi.org/pypi/pantsbuild.pants/1.28.0.dev2

  ./pants [option ...] [goal ...] [target/file ...]  Attempt the specified goals.
  ./pants help                                       Get help.
  ./pants help [goal]                                Get help for a goal.

Global options

      default: True
      Set whether log messages are displayed in color.

      default: False
      Run v2 @goal_rules continuously as file changes are detected.

  --spec-file="['<str>', '<str>', ...]"
      default: []
      Read additional specs from this file (e.g. target addresses or file names). Each
      spec should be one per line.


This displays help for Pants's global options, and some commands you can use to get more help.

Listing Goals

You can list all available goals using <<pantscmd>> goals:

$ <<pantscmd>> goals

Use `./pants help $goal` to get help for a particular goal.

binary        Create a runnable binary.

cloc          Count lines of code.

dependees     List all targets that depend on any of the input targets.

dependencies  List the dependencies of the input targets.


Which goals you see listed will depend on which backends are configured.

Getting Help for a Goal

To get help for a specific goal, enter <<pantscmd>> help $goal. For example:

$ <<pantscmd>> help test
`test` options

Runs tests.

      default: False
      Run a single test target in an interactive process. This is necessary, for
      example, when you add breakpoints in your code.

      default: False
      If a coverage report file is generated, open it on the local system if the
      system supports this.

      default: False
      Generate a coverage report for this test run.

Advanced Help

Many options are classified as advanced, meaning they are primarily intended to be used by admins, not by regular users.

You can get help for global advanced options using <<pantscmd>> help-advanced, and for a goal's advanced options using <<pantscmd>> help-advanced $goal.