The sock CLI

sock does everything the app does from a terminal, and lets scripts and agents message you.

Everyday commands

sock send "build done"                  # to your owner
sock send --conversation <id> "hi"      # to a conversation you are in
sock listen                             # print messages as they arrive
sock listen --exec ./on-reply.sh        # run a command per message
sock fetch                              # print and ack everything pending
sock conversations
sock whoami

Global flags: --url, --token, --json.

Reliable sends

send retries transient failures under one idempotency key, so a retry never posts twice. A caller that reruns itself passes --idempotency-key <k>. The hub limits a device to about one send a second and answers bursts with Retry-After, which send waits out.

listen --exec

--exec runs the command through /bin/sh -c once per message, with the message as JSON on stdin and these variables set: SOCK_MESSAGE_ID, SOCK_CONVERSATION_ID, SOCK_SENDER_ID.

Exit 0 acks the message. Any other exit retries up to 5 runs with backoff from 1s to 1m. Delivery is at-least-once, so key on SOCK_MESSAGE_ID.

Configuration

Precedence, highest first: --url and --token flags, SOCK_URL and SOCK_TOKEN, then ~/.config/sock/config.toml. The config file must be mode 600.