CLI

The yard command and its subcommands.

The command is yard. The package name is staryard.

uv tool install staryard
yard --help

A terminal prints text. A pipe prints JSON. --json, --text, --no-color, --url, and --token apply to a single command. yard --version prints the version.

Config lives at ~/Library/Application Support/yard/config.json on macOS, or $XDG_CONFIG_HOME/yard/config.json. yard login writes that file.

CommandUse it when
yard / yard status [name]see the host, or one slot
yard doctorcheck the host
yard loginsave the host and token
yard initconnect this directory and create a slot
yard clone <repo>get a checkout from the host
yard logsread app, deploy, or job logs
yard deploy <name> [sha]deploy a slot now
yard run <name>run a slot now
yard deploys <name> [id]list deploys, or read one apply log
yard git <repo> <command>run git on a host repo
yard slot {list,new,show,edit,rm}manage slots
yard repo {list,new,link,rm}manage repos
yard token {list,new,rm}manage tokens
yard podman {logs,inspect}reach one container directly

Start#

yard login --url <url> --token <token>
yard init --domain <host>
yard init --trigger "every 5m"
yard init --remote https://github.com/org/app --domain <host>
yard clone <repo>

yard login saves the host and the token on this computer.

yard init creates the repo and the slot. One of --domain or --trigger is required. --remote clones that HTTP repo on the host; the slot then follows origin/main. --name sets the repo name and the slot name; --repo and --slot set them apart. --ref selects the ref; the default is main. --dir selects a directory inside the repo.

yard clone <repo> clones one branch from the host. The depth is 1. --lazy downloads a file when you open it. --full clones the whole history.

Daily#

yard
yard status <name>
yard logs --slot <name>
yard deploys <name>
yard deploys <name> <id>
yard deploy <name>
yard run <name>
yard git <name> fetch

yard and yard status print the slot table: what is up, how long, and the revision. --running hides stopped containers. yard status <name> opens one slot: route, revision, containers, recent deploys, and a log tail.

yard logs reads container logs. With no filter it reads role app. --slot, --role, and --service narrow that set; the roles are app, deploy, and job. --tail defaults to 200. --follow keeps reading one container; --cursor resumes a follow.

yard deploys <name> shows builds for one slot. The times are the image build, the start, and the total. yard deploys <name> <id> prints that deploy's apply log.

yard deploy <name> builds the ref the slot follows. yard deploy <name> <sha> deploys one revision.

yard run <name> runs a job once and prints the output, starts a down service, and says so when one is already running.

yard git <repo> <command> runs one allowed git command in the bare repo: log, show, rev-parse, ls-tree, cat-file, for-each-ref, branch, remote, fetch, and gc. fetch fetches origin; a slot on origin/<branch> deploys when the tip moves.

yard doctor checks podman, the yard network, the apply image, Caddy and its routes, DNS, certificates, disk, env files, and the hook token. It exits 1 when a check fails.

Slots#

yard slot list
yard slot new <name> --repo <repo>
yard slot new <name> --repo <repo> --trigger "every 1h"
yard slot show <name>
yard slot edit <name>
yard slot rm <name>

yard slot new creates a slot for one repo and one ref. --ref selects the branch, --dir a subdirectory, --domain the public host. --trigger makes a job slot: push, manual, or every <duration>.

yard slot show <name> prints the slot file.

yard slot edit <name> opens the slot file in $EDITOR. --set KEY VALUE sets one field or env value; an empty value removes it. An edit of REF, DIR, or an env value runs a deploy.

yard slot rm <name> removes a slot and its containers.

More#

yard repo list
yard repo new <name>
yard repo link <repo>
yard repo rm <name>
yard token list
yard token new <name>
yard token rm <name>
yard podman logs <container>
yard podman inspect <container>

yard repo new creates a repo on the host. --remote clones that address instead; --force replaces a leftover directory.

yard repo link <repo> adds the yard remote to this directory.

yard repo rm <name> removes a repo from the host.

yard token new <name> prints a token once. yard token rm <name> removes it.

yard podman logs <container> reads one container by its Podman name. yard podman inspect <container> prints its inspect JSON.

yard <command> --help prints the flags for that command.