Install build tools for your platform
CostHQ’s SQLite driver compiles a small native module during installation. Install the correct build tools for your operating system before proceeding.
If prebuilt binaries are available for your platform and Node.js version, npm downloads them directly and skips compilation entirely.
| Platform | Command |
|---|---|
| Ubuntu / Debian | sudo apt-get install -y build-essential python3 |
| macOS | xcode-select --install |
| Windows | npm install -g windows-build-tools |
| Alpine | apk add build-base python3 |
Install CostHQ globally
Run the global install command. This installs the
costhq and cs binaries on your PATH.Binaries Installed
Installingcosthq places two binaries on your system:
| Binary | Purpose |
|---|---|
costhq | Main CLI — all session and tracking commands |
cs | Alias for costhq |
cs for day-to-day work.
Custom Database Path
By default, CostHQ stores all session data in~/.costhq/sessions.db. Set the COSTHQ_DATA_DIR environment variable to use a different location — useful for test isolation or keeping separate databases per project.
Data Location Reference
| Platform | Default path |
|---|---|
| macOS / Linux | ~/.costhq/sessions.db |
| Windows | C:\Users\<username>\.costhq\sessions.db |