
Installing PagerDuty CLI: A Complete Guide
How to Install PagerDuty CLI
The PagerDuty Command Line Interface (CLI) is an invaluable tool for managing incidents, notifications, and user settings directly from your terminal. This guide will take you through the entire installation process, providing clear instructions and troubleshooting tips to ensure a smooth setup.
Prerequisites
Before installing the PagerDuty CLI, ensure that you have the following prerequisites satisfied:
- Node.js: The PagerDuty CLI is a Node.js package, so you need to have Node.js (Official site) installed on your system, preferably version 10 or later.
- npm: Node Package Manager (npm) should be installed with Node.js to manage the CLI package installation.
- API Key: You will need a PagerDuty API key, which can be generated from your PagerDuty user account.
Installation Steps
- Install Node.js: If Node.js is not installed, download and install it from the official Node.js website (Official site).
- Open Terminal: Access your command line interface, such as Terminal on macOS and Linux or Command Prompt/PowerShell on Windows.
- Install the CLI: Execute the following command to install the PagerDuty CLI globally:
- Verify Installation: Confirm successful installation by checking the version:
npm install -g @pagerduty/pd-cli
pd --version
Configuration
After installation, configure the PagerDuty CLI with your API key:
pd configure set api-key YOUR_API_KEY
Replace YOUR_API_KEY
with the API key retrieved from your PagerDuty account.
Troubleshooting
- Unexpected Token Error: Ensure you have installed a compatible Node.js version.
- Permission Denied: If facing permission issues on macOS or Linux, prepend
sudo
to the npm command. - Command Not Found: Ensure the CLI path is added to your system PATH variable.
Summary Checklist
- Verify Node.js installation.
- Install PagerDuty CLI using npm.
- Configure the CLI with your API key.
- Troubleshoot any installation issues using provided tips.
For enhanced incident management, integrate the PagerDuty CLI into your DevOps toolkit alongside popular tools like Sentry and Zipkin.