Skip to content

Quick start

This page covers the safe core loop. Every command here is read-only or local-file-only. The container runtime stays untouched until you opt into a confirmed lifecycle command at the end.

Hostwright targets one environment:

  • An Apple silicon Mac (arm64).
  • macOS 26 or later.
  • Apple container installed and working, for runtime-backed commands.
  • Container images that provide a linux/arm64 variant.

Check your host first:

Terminal window
hostwright doctor

doctor runs safe local checks only: OS version, architecture gate, Swift toolchain, whether a container executable is on PATH, manifest presence, and local resource facts. It never runs Apple container commands. See Doctor checks.

Terminal window
# 1. Create a starter manifest in the current directory.
# Never overwrites an existing file; there is no --force.
hostwright init
# 2. Validate the restricted manifest shape. No registry or runtime contact.
hostwright validate
# 3. Compute the deterministic, non-mutating plan.
# Prints a plan hash, typed issues, and planned actions.
hostwright plan
# 4. Machine-readable output for scripts, if you want it.
hostwright plan --output json

plan does not inspect Apple container by default and does not claim any resource is running or healthy. It is a manifest-level dry run with a deterministic hash. See Reconciliation.

The checked-in example at examples/single-service/hostwright.yaml:

version: 2
project: single-service
services:
web:
image: docker.io/library/nginx:1.27
ports:
- "8080:80"
health:
command: ["curl", "-f", "http://localhost:8080/"]
interval: 30s
restart:
policy: on-failure

Every field is described in the hostwright.yaml reference.

State-backed commands use a state database resolved from --state-db, then HOSTWRIGHT_STATE_DB, then the default at ~/Library/Application Support/Hostwright/state/state.sqlite. Use the default, or pass an explicit path:

Terminal window
hostwright status
hostwright logs web --state-db /tmp/hostwright.sqlite

status observes Apple container through the RuntimeAdapter, persists a status event and snapshot, and renders desired services against observed facts. It does not mutate anything. Run hostwright paths to see the resolved location.

Terminal window
hostwright image pull docker.io/library/nginx:1.27 --platform linux/arm64 --runtime-provider apple-cli
hostwright up --dry-run --runtime-provider apple-cli
hostwright up --confirm-plan <hash-from-the-dry-run> --runtime-provider apple-cli
hostwright status

The full flow is covered step by step in Plan a single service, and the safety reasoning in the Safety model.