CLI reference: the bosun's calls
The hook, the helm and the harbour-master all muster the self-same crew. Run the same configured steps locally, in Git hooks, and in CI.
| What ye're after | The call |
|---|---|
| Rig a ship (set up a project) | hk init and hk install |
| Inspect or mend the cargo (check or fix code) | hk check and hk fix |
| Pipe up a named hook (run a named hook) | hk run |
| Look over the charts (inspect configuration) | hk config and hk validate |
| Put a hand through its drills (test a step definition) | hk test |
| Bring a clockwork hand aboard (integrate a coding agent) | hk agent and hk mcp |
| Open the ship's tool chest (use included file checks) | hk util |
New aboard, sailor? Get under way with getting started, a setup from stem to stern. Each call's own flags are listed on its page; the flags below fly on every call.
How to hail it: hk [FLAGS] <SUBCOMMAND>
Version: 2.4.0
Flags flown on every call
--cd <DIRECTORY>— Run as if hk was started in this directory-j --jobs <JOBS>— Number of jobs to run in parallel: how many hands haul at once-p --profile <PROFILE>— Profiles to enable or disable, the watches ye call up or stand down. Prefix a profile with ! to disable it, e.g. --profile slow --profile !fast-s --slow— Shorthand for --profile=slow: call up the slow watch-v --verbose— Enable verbose (debug) output, a fuller ship's log. Pass it twice for trace output-n --no-progress— Disable progress output, keeping it off the deck-q --quiet— Quiet on deck: suppress non-essential output (info messages, progress indicators). Diagnostics for failed steps are still shown--silent— Silent running: suppress all output except errors. Warnings are suppressed too--trace— Enable tracing spans and performance diagnostics: every leg of the passage, traced and timed--json— Output in JSON format, for machines to read
Flags to fly
--format <FORMAT>— Select human or machine-readable execution output: for a sailor's eyes, or for machines to readChoose from:
human,json,jsonlUnless ye say otherwise:
human-h --help— Print help, for when ye've lost yer bearings-V --version— Print the version aboard
Lesser calls
hk agent <SUBCOMMAND>hk agent hooks <--target <TARGET>>hk agent instructions <--target <TARGET>>hk agent mcp <--target <TARGET>>hk builtinshk cache clearhk check [FLAGS] [FILES]…hk completion [--install] [--force] <SHELL>hk config <SUBCOMMAND>hk config dump [--format <FORMAT>]hk config explain <KEY>hk config get <KEY>hk config sourceshk fix [FLAGS] [FILES]…hk init [FLAGS]hk install [FLAGS]hk mcp [--root <PATH>]hk migrate <SUBCOMMAND>hk migrate pre-commit [FLAGS]hk run [FLAGS] [FILES]… <SUBCOMMAND>hk run commit-msg [FLAGS] <COMMIT_MSG_FILE> [FILES]…hk run post-checkout [FLAGS] <ARGS>…hk run post-commit [FLAGS] [FILES]…hk run post-merge [FLAGS] <IS_SQUASH> [FILES]…hk run post-rewrite [FLAGS] <COMMAND> [FILES]…hk run pre-commit [FLAGS] [FILES]…hk run pre-push [FLAGS] [ARGS]…hk run pre-rebase [FLAGS] <ARGS>…hk run prepare-commit-msg [FLAGS] <ARGS>…hk sponsorshk test [FLAGS]hk uninstall [--global]hk util <SUBCOMMAND>hk util check-added-large-files [--maxkb <MAXKB>] <FILES>…hk util check-byte-order-marker [-d --diff] <FILES>…hk util check-case-conflict <FILES>…hk util check-conventional-commit [--allowed-types <ALLOWED_TYPES>] <COMMIT_MSG_FILE>hk util check-executables-have-shebangs <FILES>…hk util check-merge-conflict [--assume-in-merge] <FILES>…hk util check-shebang-scripts-are-executable <FILES>…hk util check-symlinks <FILES>…hk util destroyed-symlinks [FILES]…hk util detect-private-key <FILES>…hk util end-of-file-fixer [-d --diff] [-f --fix] <FILES>…hk util fix-byte-order-marker <FILES>…hk util fix-smart-quotes [--check] [-d --diff] <FILES>…hk util forbid-submodules [PATHS]…hk util format-diff [--no-stdin] <FILES>… <-- COMMAND>…hk util mixed-line-ending [-d --diff] [-f --fix] <FILES>…hk util no-commit-to-branch [--branch <BRANCH>]hk util python-check-ast <FILES>…hk util python-debug-statements <FILES>…hk util sarif-diff [--findings-exit-code <CODE>] <-- COMMAND>…hk util trailing-whitespace [-d --diff] [-f --fix] <FILES>…hk validatehk version
Further charts
Getting started: get under way · Troubleshooting: the ship's log
