Skip to main content

CLI

Use the CLI to initialize your harness, add bundles, and verify project health. Start with the quick workflow below, then use the reference section for exact commands and flags.

Quick workflow (first 10 minutes)

1) Initialize baseline
2) Add one bundle
3) Verify harness health
4) Confirm installed bundles

Global usage

The commands below assume you already installed the CLI globally. If you did not, prepend commands with npx @harness-kit/cli@beta.

Show all commands
Show installed CLI version

Category mapping (important)

Bundle docs pages are grouped by workflow, stack, and techstack for browsing. CLI list --category uses install-role categories from the registry.

  • Docs categories: workflow, stack, techstack
  • CLI categories: git-workflow, workflow-preset, memory, browser, search, scrape, mcp-tool
Example valid category filter

Command reference

init

Initialize Harness Kit in the current project and run the setup wizard.

Run setup wizard

Flags: No command-specific flags currently.

add <bundle>

Add a bundle to the current harness and install its artifacts.

Add bundle by slug

Flags:

  • --role <role>: override default bundle role.
  • -y, --yes: skip re-install confirmation prompt.
  • --interactive-skills: run skills setup interactively (instead of default non-interactive mode).

list

List available bundles, optionally filtered by category or installed state.

Filter by category
Show installed bundles only

Flags:

  • --category <cat>: filter by category.
  • --installed: show only installed bundles.

status

Audit harness health: bundle drift, required core files, and environment variable readiness.

Run health audit

Flags: No command-specific flags currently.

activate

Run idempotent post-install activations for installed bundles (for example Git hook activation).

Run activation steps

Flags: No command-specific flags currently.

budget

Measure context-window token cost of installed harness-managed files.

Human-readable budget report
Machine-readable JSON output
Override context window for calculation

Flags:

  • --json: output JSON report.
  • --context-window <tokens>: override context window used for budget math.

Recommended workflow

  1. Run init once to scaffold baseline files and defaults.
  2. Add bundles incrementally with add so each change set stays reviewable.
  3. Use status after each update to verify expected artifacts are in sync.

Usage tips

  • Prefer npx @harness-kit/cli@beta if you want the newest CLI without global upgrades.
  • Use @harness-kit/cli through npx, or install globally first if you want to run plain harness-kit <command>.
  • Keep bundle additions small and commit after each logical setup step.
  • If category filters fail, verify you are using CLI category names, not docs grouping names.