Skip to Content
DocumentationContributingRunning the CLI locally

Running the CLI locally

The cihub CLI ships with Companion Hub. This page covers running it from a source checkout while you work on it β€” for everyday use of the packaged binary, see the CLI Reference.

Set up your checkout first β€” Running locally covers cloning, dependencies, and environment.

How cihub runs from source

The cihub binary is declared in the repository root package.json as bin: { "cihub": "./bin/cihub.cjs" }. That entry point launches scripts/start.ts through tsx, so it always runs your working-tree TypeScript β€” there is no build step between an edit and the next invocation.

That means a checkout gives you a working cihub as soon as dependencies are installed:

pnpm install
./bin/cihub.cjs --help

CI-Hub uses pnpm (packageManager: pnpm@11.5.1, Node 22+). It is not the same toolchain as this docs site.

The iteration loop

Use this loop when changing CLI or wizard behaviour:

Clear local runtime state

cihub reset local --yes

Gives you a clean slate, so first-run detection behaves the way a new user would see it.

Bring the stack up from source

cihub up local

Starts infrastructure, then runs the backend and frontend from source β€” no Docker image rebuild between edits.

Exercise the interactive flow

cihub wizard

Runs the full first-time setup experience, which is where most CLI and TUI changes actually show up.

Run the CLI test suite

pnpm run test:cli

Vitest suite covering the banner, step renderer, first-run detection, argument validation, wizard selectors, and help output.

Building the standalone binary

To produce the packaged executable that ships inside the desktop app:

pnpm run build:cli

Hub’s own docs/CLI.md is the authoritative reference for CLI internals and is kept alongside the code.

Last updated on