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:
| Platform | Architecture | Download |
|---|---|---|
| Linux | AMD64 | Download |
| Linux | ARM64 | Download |
| macOS | Intel | Download |
| macOS | Apple Silicon | Download |
| Windows | AMD64 | Download |
Setup
bash
# Extract and install
unzip pocketalert-*.zip
sudo mv pocketalert /usr/local/bin/
chmod +x /usr/local/bin/pocketalertpowershell
# Extract the archive and add to PATH
# Or run directly from the extracted directory
.\pocketalert.exe --helpAuthentication
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 logoutCommands
Profile
View your profile information:
bash
pocketalert profileMessages
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 allQuick 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 listGet 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 listGet Device Details get
bash
pocketalert devices get <tid>Delete a Device delete
bash
pocketalert devices delete <tid>Webhooks
List Webhooks list
bash
pocketalert webhooks listGet 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 allDelete a Webhook delete
bash
pocketalert webhooks delete <tid>API Keys
List API Keys list
bash
pocketalert apikeys list
# or
pocketalert keys listCreate 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 configSet 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)"
fiGitHub 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 settingsHelp
Get help for any command:
bash
pocketalert --help
pocketalert messages --help
pocketalert messages send --helpSecurity
| Aspect | Details |
|---|---|
| Storage | API keys stored in ~/.pocketalert/config.json with permissions 600 |
| Directory | Config directory created with permissions 700 |
| Transport | All tokens transmitted via HTTPS |
| Header | API key sent in the Token header |
