Global flags
Flags that apply to every go-udap subcommand
Every flag below can appear before OR after the subcommand —
go-udap -v read MAC and go-udap read -v MAC are equivalent.
| Flag | Default | Purpose |
|---|---|---|
--timeout DURATION | 2s | Operation timeout, e.g. 2s, 30s, 2m |
--verbose, -v | off | Debug logging to stderr. Also surfaces soft-fail warnings (e.g. get_ip timeout in discover --info) that are silent by default |
--bind-interface NAME | — | Bind discovery (and all subsequent operations) to one named network interface. See interfaces for valid names. Mutually exclusive with --all-interfaces. Not supported on Windows — the flag is hidden from --help there |
--all-interfaces | off | Fan out discovery across every usable network interface. Useful on multi-homed hosts. Mutually exclusive with --bind-interface. Not supported on Windows |
--retries N | 0 | Re-transmit each UDAP send N additional times back-to-back. Useful on lossy links (ad-hoc Wi-Fi). --retries 2 matches the squeezeplay reference triple-send |
--format FORMAT, -o | text | Output format for commands that write data: text, json or csv. See Output formats |
--json | off | Shorthand for --format json. Can't be combined with --format |
--version | — | Print version and exit. Not a global flag: give it on its own, as go-udap --version |
--build-info | — | Print version and build metadata, then exit. Like --version, root only |
--help, -h | — | Print help |
Output formats
--format/-o selects how a command writes its result to stdout:
text (the default), json or csv. --json is shorthand for
--format json. Names must be lowercase and exact; anything else is a
usage error (exit 2). Giving --json together with --format is a
usage error, even when they agree.
Only stdout changes. Errors, warnings, progress and logs stay as plain text on stderr, and the exit code still reports failure.
- JSON is compact: one value per invocation and a trailing
newline. A list is a bare array and anything else is an object.
Every key is always present, with
nullfor an absent value. - CSV follows RFC 4180, always starts with a header row, and
writes
nullas an empty cell. - Empty results give
[]for a list or{}for a parameter map in JSON, and the header row alone in CSV.
Commands that support the format flags: discover (with or without
--info), info, getip, interfaces, read, get, set,
--version and --build-info. A format flag on a command that writes
no data output, such as reboot, is a usage error (exit 2).
--help always wins: go-udap reboot --json --help prints help.
JSON keys and CSV columns are a stable contract, documented on each command's page. Removing or renaming one is a breaking change and only happens in a major version. Adding one is not breaking.
--version
$ go-udap --version
go-udap 3.0.0
$ go-udap --version --json
{"name":"go-udap","version":"3.0.0"}
$ go-udap --version -o csv
name,version
go-udap,3.0.0--build-info
Version plus build metadata read from the binary: commit, commit time,
whether the working tree was modified, Go version, OS and
architecture. A field is null when the build didn't record it, for
example a go run build has no commit. The text form omits absent
fields.
$ go-udap --build-info
go-udap 3.0.0
Commit: db37553ed89bdfcf9bad1781232a338c4c3cc0d9
Commit time: 2026-10-09T13:43:01Z
Modified: false
Go version: go1.27.2
OS: darwin
Arch: arm64JSON keys, in order: name, version, commit, commit_time,
modified (a boolean), go_version, os, arch. CSV uses the same
names as its header row.
--verbose with --version or --build-info is a usage error (exit 2).
Multi-interface behaviour (--bind-interface / --all-interfaces)
Discovery only emits broadcasts on the kernel's default-route NIC by default. On a multi-homed laptop (Wi-Fi + Ethernet both up), if the Squeezebox is on the non-default subnet you'll see zero devices.
--bind-interface NAME forces UDAP traffic out a specific NIC via
IP_BOUND_IF (macOS) / SO_BINDTODEVICE (Linux). --all-interfaces
sends concurrently on every NIC.
The singular form is spelled --bind-interface (not --interface)
because --interface 0|1 is also a per-parameter flag on set —
it configures the device's NVRAM interface byte (0 = wireless,
1 = wired). Two unrelated concepts share the word, so the local-NIC
binding flag gets the more specific name.
See How to discover on a multi-NIC laptop for usage, and Multi-NIC discovery for the underlying mechanics.