Skip to content

Command Line Interface

A powerful CLI tool for the PocketAlert API that allows you to manage notifications, applications, devices, webhooks, and API keys directly from your terminal.

Installation

Pre-built binaries are available for download:

PlatformArchitectureDownload
LinuxAMD64Download
LinuxARM64Download
macOSIntelDownload
macOSApple SiliconDownload
WindowsAMD64Download

Setup

bash
# Extract and install
unzip pocketalert-*.zip
sudo mv pocketalert /usr/local/bin/
chmod +x /usr/local/bin/pocketalert
powershell
# Extract the archive and add to PATH
# Or run directly from the extracted directory
.\pocketalert.exe --help

Authentication

Before using the CLI, authenticate with your API key from PocketAlert Settings.

bash
pocketalert auth <your-api-key>

The API key is stored securely in ~/.pocketalert/config.json.

To logout and remove stored credentials:

bash
pocketalert logout

Commands

Profile

View your profile information:

bash
pocketalert profile

Messages

List Messages list

bash
# List last 10 messages (default)
pocketalert messages list

# List with custom limit
pocketalert messages list --limit 50

# Sort by oldest first
pocketalert messages list --sort asc

# Filter by device
pocketalert messages list --device <device-tid>

Get Message Details get

bash
pocketalert messages get <tid>

Send a Message send

bash
pocketalert messages send --title "Alert" --message "Server is down!"
bash
pocketalert messages send -t "Deploy" -m "Build completed" -a <app-tid>
bash
pocketalert messages send -t "Alert" -m "Check server" -d <device-tid>
bash
pocketalert messages send -t "Alert" -m "System update" -d all

Quick send shortcut:

bash
pocketalert send -t "Title" -m "Message"

Delete a Message delete

bash
pocketalert messages delete <tid>

Applications

List Applications list

bash
pocketalert applications list
# or
pocketalert apps list

Get Application Details get

bash
pocketalert apps get <tid>

Create an Application create

bash
pocketalert apps create --name "My App"
bash
pocketalert apps create -n "Production" -c "#FF5733"

Delete an Application delete

bash
pocketalert apps delete <tid>

Devices

List Devices list

bash
pocketalert devices list

Get Device Details get

bash
pocketalert devices get <tid>

Delete a Device delete

bash
pocketalert devices delete <tid>

Webhooks

List Webhooks list

bash
pocketalert webhooks list

Get Webhook Details get

bash
pocketalert webhooks get <tid>

Create a Webhook create

bash
pocketalert webhooks create --name "GitHub Webhook" --message "*"
bash
pocketalert webhooks create -n "Deploy Hook" -m "Deployed %repository.name% by %sender.login%"
bash
pocketalert webhooks create -n "CI/CD" -m "*" -a <app-tid> -d all

Delete a Webhook delete

bash
pocketalert webhooks delete <tid>

API Keys

List API Keys list

bash
pocketalert apikeys list
# or
pocketalert keys list

Create an API Key create

bash
pocketalert apikeys create --name "CI Key"

Important

The token is shown only once when created. Make sure to save it!

Delete an API Key delete

bash
pocketalert apikeys delete <tid>

Configuration

View Current Configuration

bash
pocketalert config

Set Configuration Values

bash
# Change API base URL (for self-hosted instances)
pocketalert config set base_url https://your-api.example.com

# Update API key
pocketalert config set api_key <new-api-key>

Configuration File

The CLI stores configuration in ~/.pocketalert/config.json:

json
{
  "api_key": "your-api-key",
  "base_url": "https://api.pocketalert.app"
}

Quick Examples

CI/CD Pipeline Integration

bash
# In GitHub Actions, GitLab CI, etc.
pocketalert send -t "Build Complete" -m "Version $VERSION deployed to production"

Server Monitoring with Cron

bash
# Add to crontab
*/5 * * * * /usr/local/bin/pocketalert send -t "Server Health" -m "$(uptime)"

Script Integration

bash
#!/bin/bash
if ! systemctl is-active --quiet nginx; then
  pocketalert send -t "NGINX Down" -m "NGINX service is not running on $(hostname)"
fi

GitHub Webhook Setup

bash
# Create webhook that extracts push information
pocketalert webhooks create \
  --name "GitHub Push" \
  --message "Push to %repository.name%: %head_commit.message%"

# Output will show webhook URL, use it in GitHub settings

Help

Get help for any command:

bash
pocketalert --help
pocketalert messages --help
pocketalert messages send --help

Security

AspectDetails
StorageAPI keys stored in ~/.pocketalert/config.json with permissions 600
DirectoryConfig directory created with permissions 700
TransportAll tokens transmitted via HTTPS
HeaderAPI key sent in the Token header

Pocket Alert Documentation