Install the CLI

Install the Trunk CLI to start automating your code quality checks.
If you use VSCode, click here to install our VSCode extension. Read more about it here.

Install the CLI

bash (no prompts)
curl -fsSL | bash
curl -fsSL | bash -s -- -y
brew install trunk-io
npm install -D @trunkio/launcher
pnpm add -D @trunkio/launcher
yarn add -D @trunkio/launcher
For more details, see Installing the CLI.

Initialize trunk

From the root of a git repo, run:
trunk init
This will scan your repository and create a .trunk/trunk.yaml which enables all the linters, formatters, and security analyzers that Trunk Check recommends. For more details, see here.
Security-conscious users may want to also record the signature of the CLI, which the Trunk Launcher will use to verify the CLI's provenance:
trunk init --lock

Run trunk check --sample

trunk check by default only checks the changes you've made in your branch, ignoring issues in the default branch. This means that if you haven't made any changes, trunk check will come back empty, so to get a sense of what trunk check can do, we suggest running:
trunk check --sample 5
For more information on the sample flag see here

(optional) Install the VSCode Extension

(optional) Commit the launcher

To allow your teammates to use trunk without installing anything, the launcher can be committed directly into your repo:
curl -LO
chmod +x ./trunk
git commit ./trunk -m "Commit Trunk to our repo"
This makes it much easier for you to share Trunk with your colleagues!