Profiles and configuration
Built-in profiles
Section titled “Built-in profiles”| 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:
har env inithar env init --profile clihar env init --profile iosAdaptation
Section titled “Adaptation”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.
Toolchains
Section titled “Toolchains”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.
Shared and per-slot resources
Section titled “Shared and per-slot resources”The web profile distinguishes:
- shared infrastructure, such as one Docker Postgres or Redis instance;
- per-slot state, such as
agent_1andagent_2databases; - 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.
Slot limits
Section titled “Slot limits”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.
Root mode
Section titled “Root mode”--no-worktree is available for exceptional single-checkout workflows:
har env launch 1 --no-worktreeWorktrees remain the default because they separate concurrent tasks and make the session lifecycle explicit.
