PushNotifications.org Web Push command line interface

The downloadable Python client has no third-party dependencies. It calls the authenticated REST API, keeps the token in an environment variable, formats JSON for review, and creates drafts rather than sending automatically.

Download and protect your token

Python 3.10 or later is recommended. Store the token in your shell's secret environment, make the script executable, and verify the account overview before changing any campaign.

Setupchmod 700 pushnotifications-cli.py export PUSHNOTIFICATIONS_TOKEN='pn_your_token' ./pushnotifications-cli.py overview

Inspect account data

Read-only commands./pushnotifications-cli.py sites ./pushnotifications-cli.py campaigns --status scheduled ./pushnotifications-cli.py campaign 123 ./pushnotifications-cli.py overview

The sites result supplies the numeric ID needed by campaign creation. Results are JSON so they can be reviewed directly or passed to a controlled local script.

Create a draft without sending

Draft command./pushnotifications-cli.py create-draft \ --site 42 \ --title 'The November guide is ready' \ --body 'Read the guide and save its checklist.' \ --url 'https://example.com/guides/november'

This command always requests draft status. Review and schedule the result in the dashboard or with an explicit authenticated API call.

Keep terminal automation reviewable

  • Do not put the bearer token in command arguments, shared shell history, logs, or source control.
  • Resolve the intended website ID before creating a draft.
  • Keep destinations on the verified site and use public HTTPS URLs.
  • Never treat a successful draft response as proof that a message was delivered.
  • Revoke exposed tokens from API & MCP settings.

Read the REST API reference for every field or connect an AI client through the typed MCP server.