Agent command reference

Every command, option and example of the zero-agent command line tool for servers, VMs and containers.

Commands

CommandWhat it does
joinStay connected as a daemon. Save incoming files and send what appears in the outbox. Reconnects by itself.
send FILE…Send files or folders (folders are zipped) to devices, then exit. Exit status is non-zero if anything failed.
devicesPrint the devices in the network, their state and what this machine can reach, then exit.
versionPrint the agent version.

Options

Every option can also be given as an environment variable, which is how the service and Docker setups work.

OptionEnvironment variableMeaning
--serverZERO_SERVERServer address, e.g. https://files.example.com (required).
--inviteZERO_INVITEInvite key from Add device. Recommended for servers: no approval needed.
--code, --passwordZERO_CODE, ZERO_PASSWORDJoin with the six-digit code instead. The host must approve a new device.
--nameZERO_NAMEName shown on the map (default: hostname).
--kindZERO_KINDserver, vm, cloud, database, terminal, container or computer.
--dirZERO_DIRWhere received files go (join).
--acceptZERO_ACCEPTauto (default), ask or none.
--outboxZERO_OUTBOXDirectory to watch; contents are sent, then moved to .sent/ (join).
--toZERO_TODestination device name(s), comma separated, or all.
--state-dirZERO_STATE_DIRWhere the agent keeps its identity (default ~/.zero-agent).
--waitHow long to wait to be admitted (send, devices). Default 60s.

Examples

# Stay connected, receive into /srv/inbox, push everything from /srv/outbox to the laptop
zero-agent join --server https://api.zero-portal.com --invite 'bhi_…' --name build-1 \
  --dir /srv/inbox --outbox /srv/outbox --to laptop

# Receive only (never send)
zero-agent join --server https://api.zero-portal.com --invite 'bhi_…' --accept auto --dir ./in

# See who is there
zero-agent devices --server https://api.zero-portal.com --invite 'bhi_…'

# Send a folder to two named devices
zero-agent send --server https://api.zero-portal.com --invite 'bhi_…' --to web-1,web-2 ./release