Skip to content

CLI ​

Last updated 

The official command-line interface, spooler, github.com/spoolersh/spooler-cli, is a thin wrapper over the Go library. It is built for terminal use, scripts, and agents: data on stdout, diagnostics on stderr, documented exit codes, and -o json as a stable contract. It never prompts, never acks on its own, and never retries beyond the library's transient retries.

Installation ​

From source ​

sh
go install github.com/spoolersh/spooler-cli/cmd/spooler@latest

Prebuilt binaries ​

sh
curl -fsSL https://spooler.sh/install | sh

The script downloads the latest release archive for the machine, verifies its checksum, and puts spooler in ~/.local/bin.

Overview ​

Connection flags have environment variable twins, so the recommended way of setting --api-key is to set SPOOLER_API_KEY instead.

sh
export SPOOLER_SPOOL=default
export SPOOLER_API_KEY='<your api key or "local">'
# The local image also needs:
# 	export SPOOLER_HOST=127.0.0.1:8080
# 	export SPOOLER_NO_TLS=true
sh
spooler send --queue jobs --data 'hello, world'
spooler recv --queue jobs --lease-file lease.json
spooler ack --lease-file lease.json

recv writes the payload to stdout, byte for byte, and keeps the lease in lease.json for the settle. A recv that finds nothing within --wait exits 1. Records print as JSON, and exit codes are the contract a script branches on: 0 done, 1 nothing received, 2 usage, 4 do not retry, 8 retry later, 100 result unknown.

Further reading ​