Skip to content

Profiles and configuration

Profile Use for Runtime model
default Web applications and services PM2 primary app, per-slot ports, optional shared Docker infrastructure
cli CLIs, libraries, packages Worktree and toolchain only; no PM2 or preview-port assumptions
ios Xcode and Swift applications xcodebuild, iOS Simulator settings, optional RocketSim flows

Choose a profile once when initializing:

Terminal window
har env init
har env init --profile cli
har env init --profile ios

The scaffold intentionally contains project-specific placeholders. Adapt:

  • dependency installation and toolchain detection;
  • primary app and process commands;
  • readiness and health endpoints;
  • infrastructure services, migrations, and seed commands;
  • base ports and slot step;
  • quick and full verification;
  • project-specific environment values.

Without --auto, HAR writes .har/ADAPT-PROMPT.md for a coding agent. With --auto, HAR calls Claude and can propose AGENT.md.

Generated harnesses can detect or explicitly configure Node.js, Python, Go, Rust, Java, Ruby, and iOS toolchains. HARNESS_INSTALL_CMD overrides the default install behavior. Resolved binaries and paths are appended to each slot’s environment file.

The web profile distinguishes:

  • shared infrastructure, such as one Docker Postgres or Redis instance;
  • per-slot state, such as agent_1 and agent_2 databases;
  • per-slot app processes and ports, calculated from base ports and HARNESS_PORT_STEP.

Launch prepares shared infrastructure first, then clones or migrates isolated slot state before starting the primary application.

Keep the slot range in .har/stages.json and harness.env aligned:

{
"agentSlots": {
"min": 1,
"max": 3
}
}

The repository, not the HAR binary, decides how much parallelism is safe.

--no-worktree is available for exceptional single-checkout workflows:

Terminal window
har env launch 1 --no-worktree

Worktrees remain the default because they separate concurrent tasks and make the session lifecycle explicit.