# @trunkio/launcher

> Trunk CLI tool

Latest version **1.3.4** (published 2024-11-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install @trunkio/launcher
pnpm add @trunkio/launcher
yarn add @trunkio/launcher
bun add @trunkio/launcher
```

Provides the command `trunk`.

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.4 |
| Published | 2024-11-06 |
| First published | 2022-03-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=18.0.0 |
| Dependencies | 3 |
| Unpacked size | 56.6 KB |
| Known vulnerabilities | 0 (+12 in 1 direct dependencies) |
| Install scripts | no |
| Author | Trunk Technologies |
| Maintainers | elischleifer, lauritrunk, cclearwater, dapirian |
| Keywords | actionlint, ansible-lint, autopep8, bandit, black, brakeman, buf, buildifier, cfnlint, clang-format, clang-tidy, clippy, detekt, eslint, flake8, formatters, formatting, gitleaks, gofmt, golangci-lint, hadolint, hook, husky, isort, ktlint, markdownlint, megalinter, metalinter, precommit, prettier, pylint, rubocop, rufo, rustfmt, semgrep, shellcheck, shfmt, sql-formatter, standard, standardrb, superlinter, taplo, terraform, terraform-fmt, terraform-validate, tflint, trunk, yapf |

## Links

- npm: https://www.npmjs.com/package/@trunkio/launcher
- Homepage: https://trunk.io
- npm.io page: https://npm.io/package/@trunkio/launcher

## Dependencies (3)

- [tar](https://npm.io/package/tar.md) ^6.2.0
- [yaml](https://npm.io/package/yaml.md) ^2.2.0
- [semver](https://npm.io/package/semver.md) ^7.5.4

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 1.3.4 (latest) — 2024-11-06
- 1.3.3 — 2024-11-04
- 1.3.2 — 2024-09-07
- 1.3.1 — 2024-04-11
- 1.3.0 — 2024-01-23
- 1.2.7 — 2023-08-08
- 1.2.6 — 2023-07-24
- 1.2.5 — 2023-07-22
- 1.2.4 — 2023-04-14
- 1.2.3 — 2022-11-11
- 1.2.2 — 2022-10-20
- 1.2.1 — 2022-09-01
- 1.2.0 — 2022-08-29
- 1.1.1 — 2022-05-05
- 1.1.0 — 2022-04-28
- … 8 more at https://npm.io/package/@trunkio/launcher/versions

## README

<!-- trunk-ignore(markdownlint/MD041) -->
<p align="center">
  <a href="https://docs.trunk.io">
    <img height="128" src="https://static.trunk.io/assets/vscode_icon.png" />
  </a>
</p>
<h2 align="center">Trunk</h2>
<p align="center">
  <a href="https://npmcharts.com/compare/@trunkio/launcher?minimal=true">
    <img src="https://img.shields.io/npm/dm/@trunkio/launcher.svg">
  </a>
  <a href="https://marketplace.visualstudio.com/items?itemName=Trunk.io">
    <img src="https://img.shields.io/visual-studio-marketplace/i/Trunk.io?logo=visualstudiocode"/>
  </a>
  <a href="https://slack.trunk.io">
    <img src="https://img.shields.io/badge/slack-slack.trunk.io-blue?logo=slack"/>
  </a>
  <a href="https://docs.trunk.io">
    <img src="https://img.shields.io/badge/docs.trunk.io-7f7fcc?label=docs&logo=readthedocs&labelColor=555555&logoColor=ffffff"/>
  </a>
</p>

> 🎉 Trunk is in beta. We'd appreciate your feedback - stop by the
> [Trunk Community Slack](https://slack.trunk.io) and let us know what you think. Thanks!

Trunk is a blazingly fast meta code checker and formatter with extraordinary features like caching,
preexisting issue detection, a daemon, and a language server. It's managed completely via
config-as-code, so you can easily pin your repo to specific versions of your linters, formatters,
and static analyzers.

Don't install a dozen different linter and formatting plugins, just use Trunk. Level up your code
quality and consistency today.

## Get Started

1. Install Trunk → `npm install @trunkio/launcher` ([docs](https://docs.trunk.io))
1. Setup Trunk in your repo → `npm exec trunk init` ([docs](https://docs.trunk.io))
1. Take Trunk for a spin → `npm exec trunk check --sample`

That's it!

## Prereqs

None! Trunk manages linters and formatters for you via pinned versions in your repo's
`.trunk/trunk.yaml` file. You don't need to install any linters or configure the extension in any
way. We cache linters, formatters, and runtimes in `~/.cache/trunk`. Using a linter distributed as a
go module but you're not a go user? Don't worry about it, we handle it all 😉.

## Linters / Formatters

We integrate new linters every release. Stop by on [slack](https://slack.trunk.io) and let us know
what you'd like next!

| Language        | Linters                                                                       |
| --------------- | ----------------------------------------------------------------------------- |
| All             | `gitleaks`                                                                    |
| Ansible         | `ansible-lint`                                                                |
| Bash            | `shellcheck`, `shfmt`                                                         |
| Bazel, Starlark | `buildifier`                                                                  |
| C/C++           | `clang-format`, `clang-tidy`                                                  |
| Cloudformation  | `cfnlint`                                                                     |
| Docker          | `hadolint`                                                                    |
| GitHub          | `actionlint`                                                                  |
| Go              | `gofmt`, `golangci-lint`, `semgrep`                                           |
| HAML            | `haml-lint`                                                                   |
| Java            | `semgrep`                                                                     |
| JS/TS           | `eslint`, `prettier`, `semgrep`                                               |
| Kotlin          | `detekt`, `detekt-explicit`, `ktlint`                                         |
| Markdown        | `markdownlint`                                                                |
| Protobuf        | `buf-breaking`, `buf-lint`                                                    |
| Python          | `autopep8`, `bandit`, `black`, `flake8`, `isort`, `pylint`, `semgrep`, `yapf` |
| Ruby            | `brakeman`, `rubocop`, `rufo`, `semgrep`, `standardrb`                        |
| Rust            | `clippy`, `rustfmt`                                                           |
| SQL             | `sql-formatter`                                                               |
| Terraform       | `terraform`, `tflint`                                                         |
| TOML            | `taplo`                                                                       |

## Linting and formatting principles

- Autoformat every file. _Every_ file.
- Every file in your repo should have at least one tool checking its validity
- You should always get the same results locally as on CI

## Features

### Configuration

Trunk manages all configuration as code in your repo's `.trunk/trunk.yaml` file. When you first
`trunk init`, we scan your repo for which linters and formatters are applicable to you and set up an
initial `.trunk/trunk.yaml` file for you to use. See the [docs](https://docs.trunk.io) for more
details.

### Formatting

#### Don't install 15 formatters, just use trunk

Ever hit one of these problems?

- Struggling to figure out why you need a Go or Ruby installation to run a specific formatter
- Devs on your team all get slightly different formatting results because you're running different
  versions of the formatters
- Your formatting doesn't match what your CI lint job is expecting because you're running a
  different version of a formatter locally

That's what formatting via Trunk solves. Everyone on your team is guaranteed to get the same
results, because we always run the same version of each formatter/linter on everyone's machine,
including in your CI lint job.

## Extras: VSCode Extension & GitHub Action

1. Use a single extension for all your linting and formatting →
   [Trunk VSCode Extension](https://marketplace.visualstudio.com/items?itemName=Trunk.io)
1. Protect lint and format issues from leaking into main →
   [Trunk GitHub Action](https://github.com/marketplace/actions/trunk-check)

## How versioning works

After you `trunk init`, `trunk.yaml` will contain a pinned version of Trunk to use for your repo.
When you run trunk, it will automatically detect which version you should be running for a
particular repo and, if needed, download it, then run it. The trunk VSCode extension works the same
way: regardless of what repo you're in, the underlying version of trunk it runs is based on the
pinned version in your `trunk.yaml` file. Config-as-code 👍.

This means that **everyone working in a repo, using the `trunk` cli, the VSCode extension, or when
running on CI, all get the same results** because they're running the same version of trunk and the
same versions of all the linters/formatters. No more "doesn't happen on my machine". When you want
to upgrade to a newer version, just run `trunk upgrade` and commit the updated `trunk.yaml`.

## Development Status

We release new versions about every other week.

## Feedback

For support and feedback, reach out on our [Trunk Community slack](https://slack.trunk.io). Thanks!
❤️

---
_Source: https://npm.io/package/@trunkio/launcher · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
