$_

PingBase CLI

Manage monitors and alert channels from your terminal

All plans npm install

Installation

npm install -g pingbase-cli

Or use it without installing via npx:

npx pingbase-cli --help

Authentication

Get your API key from Settings → API Keys in the dashboard, then configure the CLI:

pingbase config set api-key YOUR_API_KEY

The key is stored in ~/.pingbase/config.json. You can also pass it per-command with --api-key or set the PINGBASE_API_KEY environment variable.

Commands

List monitors

pingbase monitors list

# Output:
# ID             NAME              URL                         STATUS  INTERVAL
# mon_abc123     Production API    https://api.yourapp.com     UP      1m
# mon_def456     Website           https://yourapp.com         UP      5m
# mon_ghi789     Admin panel       https://admin.yourapp.com   DOWN    1m

Create a monitor

pingbase monitors create \
  --name "Production API" \
  --url https://api.yourapp.com \
  --interval 1 \
  --alert-on-status-code 200

Pause / resume a monitor

pingbase monitors pause mon_abc123
pingbase monitors resume mon_abc123

View monitor status

pingbase monitors status mon_abc123

# Shows current status, last check time, response time,
# uptime percentage (24h / 7d / 30d), and recent incidents.

Delete a monitor

pingbase monitors delete mon_abc123

Manage alert channels

# List channels
pingbase channels list

# Add a Slack channel
pingbase channels add \
  --type slack \
  --name "Engineering Alerts" \
  --webhook-url https://hooks.slack.com/services/...

# Add a Discord channel
pingbase channels add \
  --type discord \
  --name "Ops Discord" \
  --webhook-url https://discord.com/api/webhooks/...

Use in shell scripts

Common pattern: pause all monitors during a maintenance window, then resume.

#!/bin/bash
set -e

echo "Starting maintenance..."
pingbase monitors pause mon_abc123 mon_def456

# ... do your maintenance work ...

echo "Maintenance complete. Resuming monitors."
pingbase monitors resume mon_abc123 mon_def456

Want to explore the full API?

The CLI wraps the PingBase REST API. Every CLI command maps to an API endpoint.

API Reference →