A simple tool for interacting with the Pushover API.
This tool is highly incomplete in terms of Pushover API endpoints (see below), and is likely to remain so for the foreseeable future.
At the moment, only the following are supported:
- Message API: See the
messagesubcommand. - Receipt API: See the
receiptsubcommand. - Validate API: See the
validatesubcommand.
These alone have been sufficient to meet the vast majority of my intended use cases (e.g., completion / failure notification for long-running or unattended operations).
The tool expects the Pushover API token to be provided via a JSON format file,
containing a single object with a "token" field, e.g.
{
"token": "<YOUR TOKEN>"
}The path to the token file is specified with the token_path flag.
Verify that the user / group key $USER is valid, emitting one of either "OK"
or "INVALID" to stdout:
pushover-tool -token_path ~/.config/pushover/token.json validate \
-user $USERSend a normal-priority message to $USER:
pushover-tool -token_path ~/.config/pushover/token.json message \
-message "This is fine" -user $USERSend an emergency-priority message to $USER and print the message receipt ID
to stdout:
pushover-tool -token_path ~/.config/pushover/token.json message \
-message "My pants are on fire" -user $USER -emergencyWait for the message associated with $RECEIPT to be acknowledged, for up to
2m (polling every 10s):
pushover-tool -token_path ~/.config/pushover/token.json -timeout 2m receipt \
-receipt $RECEIPT -interval 10sNote that if the -message or -receipt flags are elided from these commands,
their values will instead be read from stdin (e.g., you can pipe an emergency
message to receipt in order to await acknowledgement).