Command Reference
3 minute read
Find a command below for its arguments, complete local option table, examples, and effects. This reference follows the command-index and command-family organization of PIG. Barn’s CLI contracts describe structured output and exit codes; Configuration defines inventory fields.
Version baseline
This reference covers Barn 1.4.0, including the new barn image update command and its five options. Release source
| Label | Availability | Behavior |
|---|---|---|
| 1.1.0 | Options available across 1.1.0–1.4.0 | 1.1.0 used 2 vCPUs / 4 GiB by default and accepted CPU/memory resize through the inventory |
| 1.2.0 | Added in 1.2.0 | Resource flags and environment overrides, vm_scale, root-disk growth, lifecycle --parallel, vm_hosts, and hosts install -f; defaults are 1 vCPU / 2 GiB |
| 1.3.0 | Added in 1.3.0 | barn time manual, startup, and scheduled guest clock synchronization; shorthand family and architecture-suffixed image aliases (el10a, u24x); embedded catalog 2026112101; macOS 27.2.1 base and macOS network setup/repair fix |
| 1.4.0 | Added in 1.4.0 | barn image update, catalog signing key rotation, Debian 13.8 on both architectures, and immediate power-off during Linux purge |
To preserve the 1.1.0 resource defaults when upgrading from 1.1.0, set vm_cpu: 2 and vm_mem: 4GiB explicitly and inspect barn plan. Existing applied VMs keep their resources until a resource-changing operation is requested. Use barn version and barn COMMAND --help to check an installed build. See the release notes and validation history.
Command index
| Task | Commands and detailed reference |
|---|---|
| Prepare | setup, init, validate, doctor |
| Plan and create | plan, up |
| Start and stop | start, stop, restart, reload |
| Change and inspect | resize, recreate, status |
| Delete | destroy, purge |
| Access Linux guests | ssh, exec, logs, provision, ssh-config |
| Publish host names | hosts install, hosts uninstall |
| Synchronize clocks | time status, sync, auto |
| Refresh catalog | update, image sync, image reset |
| Manage Linux images | image list, info, pull, update, import, prune |
| Maintain a repository | repo scan, build, verify |
| Host network | network status, install, uninstall |
| Native macOS VMs | mac ls, up, start, stop, restart, configure, recreate, destroy |
| Mac access | mac open, ssh, exec, password, ssh-config, logs |
| Mac preparation | mac setup, doctor, image ls, image update, image prune |
| CLI utilities | version, completion, help |
Global options
| Option | Meaning |
|---|---|
-h, --help |
Human-readable help for the selected command; exits 0 |
--json |
Structured JSON on stdout; progress and diagnostics stay on stderr |
--yaml |
Structured YAML on stdout; mutually exclusive with --json |
-v, --verbose |
Bounded diagnostics on stderr |
--version |
Root-command shortcut to display build identity; use barn version --json for a structured report |
Global output options can appear before or after a subcommand, but must precede the remote-command -- separator used by ssh and exec. -f, -I, -A, -p, and --yes are local options: consult the selected command’s table. -f means follow for logs; -n means line count for mac logs. Long boolean options accept =true or =false.
BARN_OUTPUT and BARN_VERBOSE set presentation defaults. BARN_HOME selects private state (default ~/.barn); use an absolute path when changing directories. Linux and Mac machines share that data root but have independent lifecycles. See environment variables and exit codes.
barn and help
With no arguments, text mode prints complete help and exits 0; JSON/YAML mode returns suggested actions[]. Explicit help always prints human-readable text. Groups image, repo, network, hosts, time, time auto, and mac image require a subcommand and exit 2 without one. The mac group is the exception: it defaults to mac ls. It is hidden from root help on Linux and Intel Macs, while explicit Mac help remains available.
Short aliases are scoped to their parent. barn im ls is barn image list; barn mac st is barn mac ls. The per-command pages list each alias. There is no rm alias for purge.