This guide covers advanced configuration, CLI flags, merging mechanics, and diagnostic features in halo.
Runs the full diagnostic suite to validate local system state against declared Docker topologies, environment variables, port availability, container health, and volume permissions.
halo check(Executing halo with no subcommand defaults to halo check)
Automatically mitigates detected configuration, permission, and directory structure issues without requiring manual file system adjustments.
halo fixCopies or merges missing configuration keys from .env.example into .env. Automatically flags missing placeholder values that require developer input before execution.
halo initInspects host system prerequisites:
- Docker CLI & Compose v2: Verifies if Docker Compose v2 is installed.
- Docker Engine Version: Inspects running Docker Engine API version.
- Required CLI Tools: Checks for
git,make, anddockerin system$PATH. - System Memory limits: Queries total host memory and compares it against memory limit sum declared under
deploy.resources.limits.memoryin services. - Free Disk Space: Queries free space on the current drive and warns if under 2.0 GiB.
halo doctorCaptures a baseline state snapshot of the local environment (including files, environment variables, ports, and active container states) and writes it to .halo-snapshot.json (or a specified output path).
halo snapshot
# Or save to custom file path:
halo snapshot baseline.jsonCompares current environment state against a previously captured snapshot (.halo-snapshot.json or specified file path) and reports any environment drift (modified files, altered environment variables, or port/container changes). Returns exit code 2 if differences are detected.
halo diff
# Or compare against custom snapshot file:
halo diff baseline.jsonPrints the binary version, build commit SHA, and Go runtime details.
halo versionSpecifies one or more explicit docker-compose files to load. This flag can be repeated to load multiple files. When this flag is provided, automatic file discovery (including docker-compose.override.*) is disabled.
halo check \
--compose-file docker-compose.yml \
--compose-file docker-compose.override.ymlWhen multiple files are provided, halo merges them left-to-right, where each subsequent file overrides or extends the previous one.
| Field | Behaviour |
|---|---|
image, container_name, entrypoint, command |
Override — latter value replaces former if non-empty |
environment |
Merge — latter keys override former keys; new keys are appended |
ports |
Append — all port entries from all files are combined |
volumes |
Override by target path — if a latter file defines a volume with the same container target path, it replaces the former entry. |
secrets, configs, root-level volumes |
Override — latter definition replaces former by name |
Given these two files:
# docker-compose.yml
services:
app:
image: myapp:latest
environment:
- DB_HOST=localhost
ports:
- "8080:80"
volumes:
- ./data:/app/data# docker-compose.override.yml
services:
app:
image: myapp:dev
environment:
- DB_HOST=db
- DEBUG=true
ports:
- "9229:9229"
volumes:
- ./data-dev:/app/dataAfter merging, the effective configuration is:
services:
app:
image: myapp:dev # overridden
environment:
DB_HOST: db # overridden
DEBUG: "true" # appended
ports:
- "8080:80" # kept
- "9229:9229" # appended
volumes:
- ./data-dev:/app/data # overrode /app/data mount--config-dir, -c <path>: Sets the root directory wherehaloauto-discovers configuration files (.env,docker-compose.yml,docker-compose.override.yml). Defaults to..--env-file, -e <path>: Specifies an explicit path to the.envfile, overriding the auto-discovery path.
--interactive, -i: Requires user confirmation before applying mitigations to the host system.--dry-run, -d: Previews mitigations or state snapshot operations without modifying the filesystem.--quiet, -q: Suppresses standard output.--verbose, -v: Enables debug logs, including raw system error reports.--watch, -w: Live-monitors configuration files. Clears the terminal and instantly re-runs diagnostics upon any update or deletion.
Controls format of diagnostic reports. Accepts text (default) or json.
- Text format (default) — human-readable, ANSI-coloured checklist. Colors automatically suppress when piped or when
NO_COLORis set. - JSON format — single-line minified JSON payload to
stdout, ideal for scripts or Git hooks:{"status":"healthy","duration_ms":38,"checks":[{"group":"Environmental Alignment","name":"Variables Check","status":"passed"}]}
When no flags are specified, halo resolves configuration files from --config-dir in this order:
- Primary compose file: Prefers
docker-compose.ymloverdocker-compose.yaml. - Override file: Automatically merges
docker-compose.override.yml(or.yaml) on top of the primary if it exists. - Env file: Loaded from
<config-dir>/.env.
When checking port collisions, halo excludes ports bound by the service's own active containers using standard Docker Compose metadata labels (com.docker.compose.project and com.docker.compose.service). Standalone containers run without these labels (e.g. via raw docker run) will always be flagged as port collisions.