A CLI for interacting with the PagerDuty API.
This tool assumes that you are a part of an account using Advanced Permissions.
- Acquire a PagerDuty developer API token.
- Create a configuration file at
$HOME/.pagerduty.yml. The file should have the following information:
---
api-token: <your token>
user-email: <your PagerDuty user email>-
Download the latest binary release and place the binary somewhere in your
$PATH. -
You should be able to run
pagerduty-clito see the available commands. -
You may wish to create an alias for the CLI as it's full name is admittedly verbose. You can add
alias pd="pagerduty-cli"to your shell's profile if you so choose.
The user-email value is required for incident write operations in the TUI
because PagerDuty uses it as the From header. Protect the configuration file
with chmod 600 ~/.pagerduty.yml. You can alternatively set
PAGERDUTY_API_TOKEN and PAGERDUTY_USER_EMAIL in the environment.
Upgrading is still a work in progress, so in the meantime, repeat step 3 from above with the latest binary. Eventually I would like this tool to upgrade itself, but I haven't yet gotten that far.
This tool, thanks to the awesome Cobra package
strives to be self-service and self-documenting. You can run
pagerduty-cli help with no additional commands to see a list of available
commands. You can see additional help for subcommands by running
pagerduty-cli help <subcommand>.
Run pagerduty-cli tui to open a full-screen terminal console for the newest
100 incidents. The console supports filtering and refreshing incidents,
viewing details and notes, acknowledging and resolving, adding notes and status
updates, reassigning, escalating, snoozing, changing urgency, and opening an
incident in the PagerDuty web UI.
The primary keyboard shortcuts are:
| Key | Action |
|---|---|
j / k, arrows |
Move through incidents or scroll the focused view |
Enter / Esc |
Focus incident details / return to the incident list |
r |
Refresh |
1 |
Open incidents (triggered and acknowledged) |
2 / 3 / 4 / 5 |
Triggered / acknowledged / resolved / all incidents |
a / x |
Acknowledge / resolve |
n / p |
Add a note / send a status update |
g / e |
Reassign / escalate |
s / u |
Snooze / toggle urgency |
o |
Open in the PagerDuty web UI |
? / q |
Show help / quit |
Without user-email (or PAGERDUTY_USER_EMAIL), the console remains available
for viewing incidents but disables write actions.
- Checkout this repository.
- Run
go build . - Run
./pagerduty-cli
-
Bump the version in
version/version.go. Commit the change tomain. -
Create a new git tag.
$ git tag -a v0.1.0 -m "First release"
$ git push origin v0.1.0
- Run
make release.