pdctl is a PagerDuty CLI designed for on-call engineers who need to respond to incidents quickly from their terminal.
brew install sawmills/tap/pdctlDownload the latest binary for your platform from the Releases page.
- Extract the archive.
- Move the
pdctlbinary to a directory in yourPATH(e.g.,/usr/local/bin).
pdctl requires a PagerDuty API token to authenticate. You can generate one in your PagerDuty account settings.
Set the PAGERDUTY_TOKEN environment variable:
export PAGERDUTY_TOKEN="your-token-here"pdctl [--json] <command>pdctl whoami: Show current authenticated user.
pdctl incident list: List incidents.- Options:
--status,--service,--urgency,--limit,--since,--until. - Example:
pdctl incident list --status triggered,acknowledged --urgency high - Example with time range:
pdctl incident list --since 2024-01-01 --until 2024-01-31
- Options:
pdctl incident view <id>: View incident details.pdctl incident ack <id>: Acknowledge an incident.pdctl incident resolve <id>: Resolve an incident.pdctl incident note <id> -m "message": Add a note to an incident.pdctl incident reassign <id> --to <user_id|policy_id>: Reassign an incident.
pdctl oncall list: List current on-call users.- Options:
--schedule,--limit.
- Options:
pdctl schedule list: List all schedules.pdctl schedule view <id>: View schedule details.
pdctl service list: List services.- Options:
--limit.
- Options:
pdctl service status: Show service status summary.
pdctl user list: List users.- Options:
--limit.
- Options:
pdctl ep list: List escalation policies.- Options:
--limit.
- Options:
All commands support the --json flag for machine-readable output:
pdctl --json incident listGenerate shell completions for your preferred shell. The Zsh completions include dynamic completion for IDs (incidents, services, schedules, users, escalation policies) that fetch real data from your PagerDuty account.
pdctl completion bash > /usr/local/etc/bash_completion.d/pdctlpdctl completion zsh > /usr/local/share/zsh/site-functions/_pdctlpdctl completion fish > ~/.config/fish/completions/pdctl.fishWith Zsh completions installed, you can tab-complete:
- Incident IDs:
pdctl incident view <TAB>shows recent incidents with titles - Service IDs:
pdctl incident list --service=<TAB>shows available services - Schedule IDs:
pdctl schedule view <TAB>orpdctl oncall list --schedule=<TAB> - User/Policy IDs:
pdctl incident reassign <id> --to=<TAB>shows users and escalation policies
A companion Raycast extension is available for quick incident management from your menu bar.
- List Incidents: Search and filter incidents by status, urgency, and service
- Quick Actions: Acknowledge, resolve, add notes, and reassign incidents
- On-Call Status: View current on-call schedules
- Menu Bar Widget: See active incident count at a glance with quick actions
The Raycast extension is included in the raycast-pdctl/ directory.
cd raycast-pdctl
npm install
npm run devThis registers the extension with Raycast. You'll be prompted to configure your PagerDuty subdomain on first use.
The extension uses the same PAGERDUTY_TOKEN environment variable as the CLI. Make sure it's set in your shell profile so Raycast can access it.