Documentation Index
Fetch the complete documentation index at: https://docs.rootly.com/llms.txt
Use this file to discover all available pages before exploring further.
Early PreviewThe Rootly CLI is currently in early preview. Features may change and some functionality may be limited. We welcome feedback and bug reports on GitHub.
The Rootly CLI is a command-line interface for managing Rootly resources directly from your terminal. Built for engineers who prefer working in the terminal, it provides fast access to incidents, alerts, services, teams, and on-call schedules.
Features
- Incidents: Full CRUD operations with filtering by status, severity, and more
- Alerts: Create, acknowledge, and resolve alerts with source tracking
- Services & Teams: Manage your service catalog and team structure
- On-Call: Query schedules, view shifts, and see who is on-call right now
- Pulses: Track events and wrap command execution with automatic pulse recording
- Multiple Output Formats: Table, JSON, YAML, and Markdown
- TTY-Aware Output: Table format in terminal, JSON when piped
- Shell Completions: Bash, Zsh, Fish, and PowerShell
- Pagination & Filtering: Server-side filtering with paginated results
Installation
Using Homebrew (macOS/Linux)
brew install rootlyhq/tap/rootly-cli
Using Go
go install github.com/rootlyhq/rootly-cli/cmd/rootly@latest
Download Binary
Download the latest release from GitHub Releases.
Available for Linux (amd64/arm64), macOS (Intel/Apple Silicon), and Windows (amd64).
Quick Start
-
Set your API key:
export ROOTLY_API_TOKEN="your-api-key"
-
List your incidents:
-
Get incident details:
rootly incidents get INC-123
Configuration
Set your API token via environment variable or config file:
# Environment variable (recommended for CI/scripts)
export ROOTLY_API_TOKEN="your-api-key"
Or create a config file at ~/.rootly-cli/config.yaml:
api_token: "your-api-key"
endpoint: "api.rootly.com" # Optional, defaults to api.rootly.com
Getting an API Key
- Log in to your Rootly account
- Navigate to Settings > API Keys
- Create a new API key with appropriate permissions
Commands
Incidents
# List incidents
rootly incidents list
# List with filters
rootly incidents list --status=started --severity=critical
# Get incident details
rootly incidents get INC-123
# Create a new incident
rootly incidents create --title="Database outage" --severity=critical
# Update an incident
rootly incidents update INC-123 --status=mitigated
# Delete an incident
rootly incidents delete INC-123
Alerts
# List alerts
rootly alerts list
# Get alert details
rootly alerts get ALR-123
# Create a new alert
rootly alerts create --summary="High CPU usage" --source=datadog
# Acknowledge an alert
rootly alerts ack ALR-123
# Resolve an alert
rootly alerts resolve ALR-123 --message="Issue fixed"
Services
# List services
rootly services list
# Get service details
rootly services get api-gateway
# Create a service
rootly services create --name="api-gateway"
# Update a service
rootly services update api-gateway --description="Main API gateway"
# Delete a service
rootly services delete api-gateway
Teams
# List teams
rootly teams list
# Get team details
rootly teams get engineering
# Create a team
rootly teams create --name="Platform"
# Update a team
rootly teams update engineering --color="#FF5733"
# Delete a team
rootly teams delete engineering
On-Call
# List on-call schedules
rootly oncall list
# View upcoming shifts (next 7 days)
rootly oncall shifts
# View shifts for next 14 days
rootly oncall shifts --days=14
# See who is on-call right now
rootly oncall who
# Filter shifts by schedule
rootly oncall shifts --schedule="Primary On-Call"
Pulses
# Send a pulse event
rootly pulse create "Deploy v1.2.3"
# With labels and services
rootly pulse create "Deploy v1.2.3" --labels="version=1.2.3,team=backend" --services=api-gateway
# Wrap a command and automatically record timing and exit code
rootly pulse run -- make deploy
# Wrap with summary and metadata
rootly pulse run --summary="Deploy to prod" --services=api-gateway --labels="env=prod" -- make deploy
The pulse run variant automatically captures the wrapped command’s exit code as a label (exit_status).
| Flag | Short | Env Variable | Description |
|---|
--labels | -l | ROOTLY_LABELS | Key=value pairs, comma-separated |
--services | -s | ROOTLY_SERVICES | Service slugs or IDs, comma-separated |
--environments | -e | ROOTLY_ENVIRONMENTS | Environment slugs or IDs, comma-separated |
--source | | ROOTLY_SOURCE | Source identifier (default: cli) |
--refs | -r | ROOTLY_REFS | Reference key=value pairs, comma-separated |
--summary | | ROOTLY_SUMMARY | Summary (alternative to positional argument) |
The CLI supports multiple output formats via the --format flag:
| Format | Description |
|---|
table | Human-readable table (default in terminal) |
json | JSON output (default when piped) |
yaml | YAML output |
markdown | Markdown table |
# Table (default in terminal)
rootly incidents list
# JSON (default when piped, or explicit)
rootly incidents list --format=json
# Pipe JSON to jq for processing
rootly incidents list --format=json | jq '.[].title'
# YAML
rootly incidents get INC-123 --format=yaml
# Markdown
rootly incidents list --format=markdown
# Pagination
rootly incidents list --limit=50 --page=2
# Filtering
rootly incidents list --status=started --severity=critical
rootly alerts list --source=datadog
rootly services list --name=api
# Sorting
rootly incidents list --sort=created_at --order=desc
Global Flags
| Flag | Description |
|---|
--api-token | Rootly API token (env: ROOTLY_API_TOKEN) |
--endpoint | Rootly API endpoint (default: api.rootly.com) |
--format | Output format: table, json, yaml, markdown (default: table) |
--no-color | Disable colored output |
--help | Show help for any command |
Shell Completions
Generate shell completion scripts for tab-completion support:
# Bash
rootly completion bash > /etc/bash_completion.d/rootly
# Zsh
rootly completion zsh > "${fpath[1]}/_rootly"
# Fish
rootly completion fish > ~/.config/fish/completions/rootly.fish
# PowerShell
rootly completion powershell > rootly.ps1
Feedback & Support