Documentation pages

REFERENCE

Exit codes and -y

These rules apply to every command. Use them in scripts, cron jobs and ssh sessions.

Exit codes

CodeMeaning
0Success
1The command failed. Tether prints one Error: ... line on stderr
2Usage error, such as an unknown command or option, or a missing argument

-y and prompts

  • -y, --yes answers every prompt: it confirms the action, and takes the default answer of each question
  • Without a terminal and without -y, a prompt fails with a message that names -y
  • -y never approves an Inbox item or trusts a key. Without a terminal, packages approve and reject need --expect, and machines trust needs --fingerprint
  • The one exception: tether packages approve --all -y approves the packages it lists. It still leaves machine keys, malicious packages, packages whose record fails its signature, and packages without a version or tap to name
  • -y does not pick an answer for a question that has no safe default. For example, it never picks a side of a conflict
Terminal
tether -y upgrade
tether packages approve npm:typescript --expect 5.6.3
tether machines trust work-laptop --fingerprint SHA256:...

Without a terminal

tether sync without a terminal, for example from cron or ssh, runs as the daemon does:

  • It records conflicts for tether resolve and keeps those files out of the push
  • It holds new packages and machine keys in the Inbox
  • It defers casks that need a password to the next tether sync in a terminal
  • Git commands that reach the remote stop after 5 minutes. The next sync tries again

JSON output

status, machines list, packages list and packages inbox take --json. They print one JSON value on stdout. Messages go to stderr. The flag is experimental in 2.0: field names can still change.

Colour

Tether prints no colour codes when stdout is not a terminal, such as a pipe or a file, or when NO_COLOR is set.

Machine arguments and package ids

  • A machine argument takes a machine id, or a hostname that names exactly one trusted machine or this machine. machines trust also takes the hostname of a new machine whose record a key signs. A name that matches no machine is an error
  • A package id is manager:name, such as npm:typescript. Managers: brew_formulae (or brew), brew_casks (or cask), brew_taps, npm, pnpm, bun, gem, uv