Running locally
How to run Companion Hub from a source checkout β for contributing, or for testing changes before they ship.
CI-Hub uses pnpmΒ , not Bun. The repository declares
packageManager: pnpm@11.5.1 and ships only pnpm-lock.yaml. This docs site
uses Bun; Hub does not. Running bun install in a Hub checkout will not give
you a working tree.
Prerequisites
- Docker with the Compose plugin β verify with
docker compose version. See Install Docker if you need it. - Node.js 22 or later β Hub declares
engines.node: >=22 - pnpm 11 or later β
engines.pnpm: >=11
The simplest way to get the right pnpm is Corepack, which reads the pinned version out of the repositoryβs packageManager field:
corepack enableGet the code
Fork CI-HubΒ , clone your fork, then:
pnpm installStart the stack
Run the wizard
./bin/cihub.cjs wizardOn a fresh checkout there is no environment file yet, so the wizard enters first-run mode: it shows a step tracker, checks Docker is available, runs setup and registration, then launches the Hub.
./bin/cihub.cjs is the CLI as declared in the repositoryβs package.json.
It runs your working-tree TypeScript directly β see Running the CLI
locally.
Open the dashboard
| Surface | URL |
|---|---|
| Hub | http://localhost:5002 |
| Frontend dev server (Vite) | http://localhost:9091 |
Doing it by hand instead
If youβd rather not use the wizard, the same result in three steps:
cp .env.example .env.localcihub setup localcihub up localcihub up local brings up infrastructure and then runs the backend and frontend from source β no Docker image rebuild between edits.
Environments
Each environment reads its own file at the repository root:
| Environment | File |
|---|---|
local | .env.local |
dev | .env.dev |
staging | .env.staging |
prod | .env.prod |
Most commands take the environment as an argument β cihub up local, cihub setup local, cihub wizard staging. Omitted, it defaults to local.
.env.example is a template, not a working config. At minimum set
ROOT_FOLDER_HOST (absolute path for persistent data) and
JWT_SECRET (openssl rand -hex 32).
Day to day
cihub status # containers, resolved config, portscihub down # stop the stackcihub reset local --yes # wipe local runtime state for a clean-slate runSee the CLI Reference for the full command set.
Running tests
pnpm test # unit tests, plus the CLI suitepnpm test:integrationpnpm test:e2epnpm test:cli # CLI and TUI presentation testsWorking on the CLI itself? Running the CLI locally covers the tighter iteration loop.