Commands Reference

Complete reference for all hx CLI commands.

Command Categories

Build Commands

Commands for building, running, and testing your project.

CommandDescription
buildCompile the project
runBuild and run the executable
testRun the test suite
benchRun benchmarks
checkType check without compiling
replStart interactive GHCi session
docGenerate documentation

Project Management

Commands for creating and managing projects.

CommandDescription
newCreate a new project
initInitialize hx in existing project
addAdd dependencies
removeRemove dependencies
updateUpdate dependencies

Dependency Management

Commands for managing dependencies and lockfiles.

CommandDescription
lockGenerate/update lockfile
syncSync dependencies from lockfile
outdatedCheck for outdated dependencies

Toolchain Management

Commands for managing the Haskell toolchain.

CommandDescription
toolchainManage GHC, Cabal, and other tools
bhc-platformManage BHC Platform curated snapshots

Utilities

Additional utility commands.

CommandDescription
cleanRemove build artifacts
fmtFormat Haskell code
lintRun linter
watchWatch mode for auto-rebuild
doctorDiagnose environment issues

Global Options

These options are available for all commands:

-v, --verbose     Enable verbose output
-q, --quiet       Suppress non-essential output
    --color       Control color output [always, auto, never]
    --no-color    Disable colored output
-h, --help        Print help information
-V, --version     Print version information

Exit Codes

CodeMeaning
0Success
1General error
2Usage error (invalid arguments)
3Configuration error
4Toolchain error
5Build/test failure