Skip to main content

Module cli

Module cli 

Source
Expand description

Running a local command and reading its failure.

The interesting part is the reading. tailscale reports everything through a non-zero exit code and a line of English on standard error, so this is where that line becomes one of the error codes an agent can act on. Getting it wrong is not cosmetic: needs_operator tells the caller to run one command and try again, while unsupported_version tells it to stop asking.

Functions§

command_failure
The command ran and refused. Work out what kind of refusal it was.
probe_identity
Read who this node is from tailscale status --json.
probe_node
Who this node is and what it calls its peers, from one reading of status.
probe_version
Read the version out of tailscale version.
run
Run a command, and turn anything other than a clean exit into a tool error.
run_text
Run a command and hand back its standard output as text, failures aside.
run_tolerant
Run a command whose refusal may be an ordinary answer.
version_permits
Whether a tool’s stated minimum is met by the CLI we found.