CLI options

Trunk Check detailed command line options




Run on all the files in the repository. Useful if trying to assess a new linter in the system, or to find and fix pre-existing issues


Auto-apply all suggested fixes


Surface, but do not prompt for autofixes


List of comma-separated linters to run. Specify --filter=-linter to disable a linter.


Run check on a sampling of all files in the repo



Do not show progress while running


Only show progress every 30s while running (useful for CI jobs). Implied by --ci.


number of concurrent jobs (does not affect background linting)


Output help information

Advanced Trunk Check Features

Options & FlagsExplanation


Explicitly set the root of the repository to run against


Specify the upstream branch used to calculate new vs existing issued.


Supports running trunk check from inside a git hook. Options are manual (default), git-push, git-commit. Controls whether the check returns early and its interactivity.


Output results in specified format: text (default) or json


Write json results to specified file



--filter argument allows you to restrict trunk check to a subset of the linters enabled in your repository.

For example, to run eslint and isort on the entire repo:

trunk check --all --filter=eslint,isort

Alternatively, to run every linter except clang-tidy and shellcheck:

trunk check --all --filter=-clang-tidy,-shellcheck


--sample=N will attempt to run every enabled linter against the requested number of files. The goal of the sample flag is to test the setup of the linters in your repository as well as any specific configuration they might honor.

The sample command will attempt to run each linter N times, but may run fewer if not enough applicable files exist in your set of files to lint. --sample=N can be combined with any other set of options for trunk check.

For example, to run prettier against 10 different prettier supported files:

trunk check --sample=10 --filter=prettier

Alternatively, to run every linter at most 5 times against its supported files:

trunk check --sample=5

Last updated