Install the CLI
Install the Trunk CLI to start automating your code quality checks.
bash
bash (no prompts)
brew
npm
pnpm
yarn
curl https://get.trunk.io -fsSL | bash
curl https://get.trunk.io -fsSL | bash -s -- -y
brew install trunk-io
npm install -D @trunkio/launcher
pnpm add -D @trunkio/launcher
yarn add -D @trunkio/launcher
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
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
To allow your teammates to use
trunk
without installing anything, the launcher can be committed directly into your repo:curl -LO https://trunk.io/releases/trunk
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!
Last modified 1mo ago