# Commands

_Pekit / Reference_

> The pekit commands, what each is for, the options every building command shares, and the page that explains each one.

The `pekit` command has a subcommand for each kind of work. This page says
what each is for and where to read about it. `pekit(1)` is the authority
for every command, option, exit status, environment variable, and file,
and `pekit <command> --help` summarizes one command.

## The commands

These are the commands, in the order you're likely to meet them:

| Command | Does | Read |
|---|---|---|
| `pekit build` | Builds targets. | [Building a First Program](/pekit/getting-started/building-a-first-program.md) |
| `pekit test` | Runs tests, every test below this directory by default. | [Writing and Running Tests](/pekit/testing-and-running/testing.md) |
| `pekit run` | Runs a script, or the program a build gives. | [Running Scripts and Programs](/pekit/testing-and-running/running-scripts-and-programs.md) |
| `pekit query deps` | Lists the steps and files targets reach. | [Querying What Targets Reach](/pekit/testing-and-running/querying-what-targets-reach.md) |
| `pekit query rdeps` | Lists the targets that read a file. | [Querying What Targets Reach](/pekit/testing-and-running/querying-what-targets-reach.md) |
| `pekit lock` | Pins the libraries the workspace imports. | [Pinning Libraries](/pekit/libraries/pinning-libraries.md) |
| `pekit sources` | Records what each recipe's packages are built from in `pekit.sources`. | [Recording Corresponding Source](/pekit/shipping/recording-corresponding-source.md) |
| `pekit package` | Packs packages with the workspace's packagers. | [Packaging](/pekit/shipping/packaging.md) |
| `pekit publish` | Packs packages and publishes them into a store. | [Packaging](/pekit/shipping/packaging.md) |
| `pekit release` | Builds a package from `HEAD` strictly, publishes it, and tags it. | [Releasing](/pekit/shipping/releasing.md) |
| `pekit clean` | Removes `pekit-out/`, and with `--cache` the store. | [Managing the Store](/pekit/building/managing-the-store.md) |
| `pekit store stats` | Shows the store's size, its limit, and whether a build is using it. | [Managing the Store](/pekit/building/managing-the-store.md#see-and-evict-the-store) |
| `pekit store evict` | Evicts the store to within its limit now. | [Managing the Store](/pekit/building/managing-the-store.md#see-and-evict-the-store) |
| `pekit store verify` | Hashes every file of the store again, and with `--repair` repairs what is wrong. | [Managing the Store](/pekit/building/managing-the-store.md#verify-the-store) |

## Options the building commands share

`build`, `test`, `run`, `query`, `package`, `publish`, and `sources` take
the same options for how they build:

| Option | Does | Read |
|---|---|---|
| `--jobs` | Limits how many programs this build runs at once. | [Targets and Steps](/pekit/concepts/targets-and-steps.md), [Sharing the Machine](/pekit/concepts/sharing-the-machine.md) |
| `--evaluating` | Limits how many targets this build evaluates at once. | [Sharing the Machine](/pekit/concepts/sharing-the-machine.md#memory-for-evaluating-targets) |
| `--platform` | Builds for another platform. | [Building for Another Platform](/pekit/building/building-for-another-platform.md) |
| `--profile` | Chooses the keychain's profile. | [Using Secrets](/pekit/building/using-secrets.md) |
| `--rebuild` | Runs every step, reusing nothing from the store. | [Reuse and the Store](/pekit/concepts/reuse-and-the-store.md) |
| `--check-reproducible` | Runs every step twice and compares the outputs. | [Checking That a Build Is Reproducible](/pekit/building/checking-reproducibility.md) |
| `--strict` | Builds as a release does. | [Hermetic and Strict Builds](/pekit/concepts/hermetic-and-strict-builds.md) |
| `--fail-fast` | Stops the build at the first target that fails. | [Naming Targets](/pekit/building/naming-targets.md) |
| `--no-dynamic` | Fails a target that waits for a step's result. | [Targets and Steps](/pekit/concepts/targets-and-steps.md#waiting-for-a-step-s-result) |
| `--trace` | Writes a timeline of the build. | [Profiling a Build](/pekit/building/profiling-a-build.md) |
| `--gcsl-profile` | Writes a profile of the build's GCSL code. | [Profiling a Build](/pekit/building/profiling-a-build.md) |
| `--remote-cache`, `--remote-instance`, `--remote-header` | Looks for steps in a remote cache. | [Sharing a Remote Cache](/pekit/building/sharing-a-remote-cache.md) |
| `--remote-upload` | Writes the steps a build records to the remote cache. | [Sharing a Remote Cache](/pekit/building/sharing-a-remote-cache.md) |

Related content:

- [Naming Targets](/pekit/building/naming-targets.md)
- [Definition Types and Attributes](/pekit/reference/definition-types-and-attributes.md)
