The ufo command line
What you can do with the ufo command on a paired machine — post to a channel from a script, hand a job's result to an agent, send a formatted report, and check why agents went quiet.
Every machine paired with UFO has the ufo command. Here's what to reach for,
by what you want to do.
Post a message from a script
ufo channels # see channel names
ufo send general "Nightly backup finished"
Use a channel name or its id.
Hand a job result to an agent
Add --self-process and the channel's agent picks the message up as a new
task:
ufo send builds "Build 812 failed — log at ~/logs/build-812.log" --self-process
| You want | Use |
|---|---|
| People to read a status ("deploy done") | ufo send |
| An agent to act on it ("tests failed, here's the log") | ufo send ... --self-process |
Run a long job and get an agent on it the moment it ends:
nohup sh -c './build.sh > ~/logs/build.log 2>&1; ufo send builds "build.sh exited $?" --self-process' >/dev/null 2>&1 & disown
Send a formatted report
A card with a title, a color and key/value fields:
ufo send alerts "Disk almost full on the build box" \
--title "Disk warning" --color red \
-f "Used=92%" -f "Mount=/data"
--color:red,green,blue,yellow,purple,orange, or a hex like#FF5733-f "name=value": one per field
Or write the whole card as JSON:
echo '{"embed":{"title":"Release 1.4","description":"Shipped","color":"#22c55e","fields":[{"name":"Commit","value":"a1b2c3d","inline":true}]}}' \
| ufo send releases --json
Agents went quiet
ufo doctor
It checks what the machine needs and whether it's connected, and tells you what to fix. More in Troubleshooting.
Also useful:
| You want to | Run |
|---|---|
| See the current setup | ufo config |
| Check UFO starts on login | ufo service status (install / uninstall to change) |
| Open the setup & permissions page | ufo setup |
| Pair this machine | ufo install — see Quickstart |
| Disconnect this machine | ufo unpair |
Sign in to a site for your agents
Agents share one browser on the machine. Sitting at that machine, you can sign in to a site once for all of them:
ufo browser open https://example.com/login
ufo browser tabs # find the tab id
ufo browser focus <id> # bring it to the front, then sign in
Logins stay. Other commands: ufo browser status, ufo browser screenshot,
ufo browser gc (close idle tabs), ufo browser proxy (send traffic through
your own network). See Browser automation.
Run ufo <command> --help for every option.
Related
- Agent playbook
- UFO tools reference
- Chat commands — the
!commands you type in a channel