Skip to content

Command Reference

Every Barn command with syntax, all local options, defaults, examples, and version availability.

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 the Barn 1.5.0. Its command names and flags remain compatible with 1.4.0. Release notes

LabelAvailabilityBehavior
1.1.0Options available across 1.1.0–1.5.01.1.0 used 2 vCPUs / 4 GiB by default and accepted CPU/memory resize through the inventory
1.2.0Added in 1.2.0Resource 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.0Added in 1.3.0barn time manual, startup, and scheduled guest clock synchronization; shorthand family and architecture-suffixed image aliases (el10a, d13x); embedded catalog 2026112101; macOS 27.2.1 base and macOS network setup/repair fix
1.4.0Added in 1.4.0barn image update, catalog signing key rotation, Debian 13.8 on both architectures, and immediate power-off during Linux purge
1.5.0Changed in 1.5.0New labs use d13. repo build can infer image metadata from filenames, and official catalogs use catalog.json.sig.

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 release acceptance.

Command index

TaskCommands and detailed reference
Preparesetup, init, validate, doctor
Plan and createplan, up
Start and stopstart, stop, restart, reload
Change and inspectresize, recreate, status
Deletedestroy, purge
Access Linux guestsssh, exec, logs, provision, ssh-config
Publish host nameshosts install, hosts uninstall
Synchronize clockstime status, sync, auto
Refresh catalogupdate, image sync, image reset
Manage Linux imagesimage list, info, pull, update (1.4.0), import, prune
Maintain a repositoryrepo scan, build, verify
Host networknetwork status, install, uninstall
Native macOS VMsmac ls, up, start, stop, restart, configure, recreate, destroy
Mac accessmac open, ssh, exec, password, ssh-config, logs
Mac preparationmac setup, doctor, image ls, image update, image prune
CLI utilitiesversion, completion, help

Global options

barn [--json|--yaml] [-v|--verbose] COMMAND [arguments] [local options]
OptionMeaning
-h, --helpHuman-readable help for the selected command; exits 0
--jsonStructured JSON on stdout; progress and diagnostics stay on stderr
--yamlStructured YAML on stdout; mutually exclusive with --json
-v, --verboseBounded diagnostics on stderr
--versionRoot-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

barn
barn --help
barn help resize
barn image pull --help
barn --json

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.

Table reader