Agent command reference
Every command, option and example of the zero-agent command line tool for servers, VMs and containers.
Commands
| Command | What it does |
|---|---|
| join | Stay 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. |
| devices | Print the devices in the network, their state and what this machine can reach, then exit. |
| version | Print the agent version. |
Options
Every option can also be given as an environment variable, which is how the service and Docker setups work.
| Option | Environment variable | Meaning |
|---|---|---|
| --server | ZERO_SERVER | Server address, e.g. https://files.example.com (required). |
| --invite | ZERO_INVITE | Invite key from Add device. Recommended for servers: no approval needed. |
| --code, --password | ZERO_CODE, ZERO_PASSWORD | Join with the six-digit code instead. The host must approve a new device. |
| --name | ZERO_NAME | Name shown on the map (default: hostname). |
| --kind | ZERO_KIND | server, vm, cloud, database, terminal, container or computer. |
| --dir | ZERO_DIR | Where received files go (join). |
| --accept | ZERO_ACCEPT | auto (default), ask or none. |
| --outbox | ZERO_OUTBOX | Directory to watch; contents are sent, then moved to .sent/ (join). |
| --to | ZERO_TO | Destination device name(s), comma separated, or all. |
| --state-dir | ZERO_STATE_DIR | Where the agent keeps its identity (default ~/.zero-agent). |
| --wait | How 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