{
"name": "trunk",
"description": "An all-in-one tool for scalably checking, formatting, and monitoring code",
"subcommands": [
{
"name": "init",
"description": "Setup trunk in this repo",
"options": [
{
"names": [
"--lock"
],
"description": "Add sha256s to trunk.yaml for additional verification"
},
{
"names": [
"--check-sample"
],
"description": "Run `trunk check sample` without prompting"
},
{
"names": [
"--nocheck-sample"
],
"description": "Do not run `trunk check sample` post-init"
},
{
"names": [
"--force"
],
"description": "Overwrite existing trunk.yaml"
}
]
},
{
"name": "check",
"description": "Universal code checker",
"subcommands": [
{
"name": "upgrade",
"description": "Upgrade all linters to latest versions",
"args": [
{
"name": "linters",
"description": "Linter(s) to upgrade (upgrades all if none specified)",
"is_variadic": true
}
]
},
{
"name": "download",
"description": "Download all files needed for trunk to work offline",
"args": [
{
"name": "tools",
"description": "Tool(s) to download (if omitted, downloads all configured tools)",
"is_variadic": true
}
]
},
{
"name": "enable",
"description": "Enable linters",
"args": [
{
"name": "linters",
"description": "Linter(s) to enable",
"is_variadic": true
}
]
},
{
"name": "disable",
"description": "Disable linters",
"args": [
{
"name": "linters",
"description": "Linter(s) to disable",
"is_variadic": true
}
]
}
],
"options": [
{
"names": [
"-y",
"--fix"
],
"description": "Automatically apply all fixes without prompting"
},
{
"names": [
"-a",
"--all"
],
"description": "Run on all files instead of only changed files"
},
{
"names": [
"-n",
"--no-fix"
],
"description": "Don't automatically apply fixes"
},
{
"names": [
"--include-existing-autofixes"
],
"description": "Show autofixes for existing issues"
},
{
"names": [
"--force"
],
"description": "Run on all files, even if ignored"
},
{
"names": [
"--diff"
],
"description": "Diff printing mode",
"takes_arg": true,
"arg": {
"name": "mode",
"suggestions": [
"none",
"compact",
"full"
]
}
},
{
"names": [
"--filter"
],
"description": "Filter the set of executed linters and/or the returned codes; use a leading '-' to exclude a linter or code",
"takes_arg": true,
"arg": {
"name": "linter or code",
"is_variadic": true
}
},
{
"names": [
"--exclude"
],
"description": "Shorthand for an inverse --filter",
"takes_arg": true,
"arg": {
"name": "linter or code",
"is_variadic": true
}
},
{
"names": [
"-j",
"--jobs"
],
"description": "Number of concurrent jobs (does not affect background linting)",
"takes_arg": true,
"arg": {
"name": "number"
}
},
{
"names": [
"--sample"
],
"description": "Run each linter on N files (implies --no-fix and --all if no paths are given)",
"takes_arg": true,
"arg": {
"name": "N"
}
},
{
"names": [
"--upstream"
],
"description": "Upstream branch used to compute changed files (autodetected by default)",
"takes_arg": true,
"arg": {
"name": "branch"
}
}
],
"args": [
{
"name": "paths",
"is_variadic": true,
"template": "filepaths"
}
]
},
{
"name": "fmt",
"description": "Universal code formatter",
"options": [
{
"names": [
"-a",
"--all"
],
"description": "Run on all files instead of only changed files"
},
{
"names": [
"-n",
"--no-fix"
],
"description": "Don't automatically apply fixes"
},
{
"names": [
"--include-existing-autofixes"
],
"description": "Show autofixes for existing issues"
},
{
"names": [
"--force"
],
"description": "Run on all files, even if ignored"
},
{
"names": [
"--diff"
],
"description": "Diff printing mode",
"takes_arg": true,
"arg": {
"name": "mode",
"suggestions": [
"none",
"compact",
"full"
]
}
},
{
"names": [
"--filter"
],
"description": "Filter the set of executed linters and/or the returned codes; use a leading '-' to exclude a linter or code",
"takes_arg": true,
"arg": {
"name": "linter or code",
"is_variadic": true
}
},
{
"names": [
"--exclude"
],
"description": "Shorthand for an inverse --filter",
"takes_arg": true,
"arg": {
"name": "linter or code",
"is_variadic": true
}
},
{
"names": [
"-j",
"--jobs"
],
"description": "Number of concurrent jobs (does not affect background linting)",
"takes_arg": true,
"arg": {
"name": "number"
}
},
{
"names": [
"--sample"
],
"description": "Run each linter on N files (implies --no-fix and --all if no paths are given)",
"takes_arg": true,
"arg": {
"name": "N"
}
},
{
"names": [
"--upstream"
],
"description": "Upstream branch used to compute changed files (autodetected by default)",
"takes_arg": true,
"arg": {
"name": "branch"
}
}
],
"args": [
{
"name": "paths",
"is_variadic": true,
"template": "filepaths"
}
]
},
{
"name": "upgrade",
"description": "Upgrade trunk to the latest release"
},
{
"name": "git-hooks",
"description": "Git hooks",
"subcommands": [
{
"name": "install",
"description": "Install trunk git hooks"
}
]
},
{
"name": "cache",
"description": "Cache management",
"subcommands": [
{
"name": "clean",
"description": "Clean the cache",
"options": [
{
"names": [
"--all"
],
"description": "Delete all files (including results cache)"
},
{
"names": [
"-n",
"--dry-run"
],
"description": "Print all directories that would be cleaned out without running deletion"
}
]
}
]
},
{
"name": "print-config",
"description": "Print the resolved trunk config"
},
{
"name": "daemon",
"description": "Daemon management",
"subcommands": [
{
"name": "launch",
"description": "Start the trunk daemon if its not already running"
},
{
"name": "shutdown",
"description": "Shutdown the trunk daemon if it is running"
},
{
"name": "status",
"description": "Report daemon status"
}
]
}
],
"options": [
{
"names": [
"-h",
"--help"
],
"description": "Usage information"
},
{
"names": [
"--version"
],
"description": "The version"
},
{
"names": [
"-m",
"--monitor"
],
"description": "Enable the trunk daemon to monitor file changes in your repo",
"takes_arg": true,
"arg": {
"name": "value",
"suggestions": [
"true",
"false"
]
}
},
{
"names": [
"--ci"
],
"description": "Run in continuous integration mode"
},
{
"names": [
"-o",
"--output"
],
"description": "Output format",
"takes_arg": true,
"arg": {
"name": "format",
"suggestions": [
"text",
"json"
]
}
},
{
"names": [
"--no-progress"
],
"description": "Don't show progress updates"
},
{
"names": [
"--ci-progress"
],
"description": "Show updates every 30 seconds without clearing terminal screen (implicit with --ci)"
},
{
"names": [
"--action_timeout"
],
"description": "How long actions (downloads, lint runs, etc.) have to time out, with units (s, ms, etc)",
"takes_arg": true,
"arg": {
"name": "timeout"
}
},
{
"names": [
"-v",
"--verbose"
],
"description": "Output details about what's happening under the hood"
}
]
}