Commands Reference
Complete reference for all hx CLI commands.
Command Categories
Build Commands
Commands for building, running, and testing your project.
| Command | Description |
|---|---|
| build | Compile the project |
| run | Build and run the executable |
| test | Run the test suite |
| bench | Run benchmarks |
| check | Type check without compiling |
| repl | Start interactive GHCi session |
| doc | Generate documentation |
Project Management
Commands for creating and managing projects.
| Command | Description |
|---|---|
| new | Create a new project |
| init | Initialize hx in existing project |
| add | Add dependencies |
| remove | Remove dependencies |
| update | Update dependencies |
Dependency Management
Commands for managing dependencies and lockfiles.
| Command | Description |
|---|---|
| lock | Generate/update lockfile |
| sync | Sync dependencies from lockfile |
| outdated | Check for outdated dependencies |
Toolchain Management
Commands for managing the Haskell toolchain.
| Command | Description |
|---|---|
| toolchain | Manage GHC, Cabal, and other tools |
| bhc-platform | Manage BHC Platform curated snapshots |
Utilities
Additional utility commands.
| Command | Description |
|---|---|
| clean | Remove build artifacts |
| fmt | Format Haskell code |
| lint | Run linter |
| watch | Watch mode for auto-rebuild |
| doctor | Diagnose 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 informationExit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error |
| 2 | Usage error (invalid arguments) |
| 3 | Configuration error |
| 4 | Toolchain error |
| 5 | Build/test failure |