https://github.com/rootlyhq/rootly-cli
CLI for managing Rootly incidents, alerts, services, teams, and on-call schedules
https://github.com/rootlyhq/rootly-cli
cli devops golang incident-management oncall rootly
Last synced: about 2 months ago
JSON representation
CLI for managing Rootly incidents, alerts, services, teams, and on-call schedules
- Host: GitHub
- URL: https://github.com/rootlyhq/rootly-cli
- Owner: rootlyhq
- License: mit
- Created: 2026-02-17T14:27:41.000Z (2 months ago)
- Default Branch: master
- Last Pushed: 2026-02-18T05:10:43.000Z (about 2 months ago)
- Last Synced: 2026-02-18T07:32:41.008Z (about 2 months ago)
- Topics: cli, devops, golang, incident-management, oncall, rootly
- Language: Go
- Homepage: https://rootly.com
- Size: 379 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-sre-tools - Rootly CLI - Open-source CLI to manage Rootly incidents, alerts, services, teams, and on-call schedules from the terminal. (Incident Management / Incident Response / IT Alerting / On-Call / Container Orchestration)
README
# Rootly CLI
A command-line interface for managing Rootly incidents, alerts, services, teams, and on-call schedules from the terminal.



## Features
- Full CRUD for incidents, alerts, services, and teams
- On-call schedule queries (list schedules, view shifts, who's on-call)
- Alert action shortcuts (`rootly alerts ack`, `rootly alerts resolve`)
- Multiple output formats: table, JSON, YAML, markdown
- TTY-aware output (table in terminal, JSON when piped)
- Shell completions for bash, zsh, fish, and PowerShell
- Confirmation prompts for destructive operations
- Pagination and server-side filtering
## Installation
### Homebrew (macOS/Linux)
```bash
brew install rootlyhq/tap/rootly-cli
```
### Go Install
```bash
go install github.com/rootlyhq/rootly-cli/cmd/rootly@latest
```
### Download Binary
Download the latest release from the [Releases](https://github.com/rootlyhq/rootly-cli/releases) page.
Available for Linux (amd64/arm64), macOS (Intel/Apple Silicon), and Windows (amd64).
### Build from Source
```bash
git clone https://github.com/rootlyhq/rootly-cli.git
cd rootly-cli
make build
./bin/rootly
```
## Configuration
Set your API token via environment variable or config file:
```bash
# Environment variable (recommended for CI/scripts)
export ROOTLY_API_TOKEN="your-api-key"
# Or config file at ~/.rootly-cli/config.yaml
```
Config file format (`~/.rootly-cli/config.yaml`):
```yaml
api_key: "your-api-key"
api_host: "api.rootly.com" # Optional, defaults to api.rootly.com
```
### Getting an API Key
1. Log in to your Rootly account
2. Navigate to **Settings** > **API Keys**
3. Create a new API key with appropriate permissions
## Usage
```bash
# Incidents
rootly incidents list
rootly incidents list --status=started --severity=critical
rootly incidents get
rootly incidents create --title="Database outage" --severity=critical
rootly incidents update --status=mitigated
rootly incidents delete
# Alerts
rootly alerts list
rootly alerts get
rootly alerts create --summary="High CPU usage" --source=datadog
rootly alerts ack
rootly alerts resolve
# Services
rootly services list
rootly services get
rootly services create --name="api-gateway"
rootly services update --description="Main API gateway"
rootly services delete
# Teams
rootly teams list
rootly teams get
rootly teams create --name="Platform"
rootly teams update --color="#FF5733"
rootly teams delete
# On-Call
rootly oncall list # List schedules
rootly oncall shifts # View upcoming shifts
rootly oncall shifts --days=14 # Next 14 days
rootly oncall who # Who's on-call right now
```
### Output Formats
```bash
# Table (default in terminal)
rootly incidents list
# JSON (default when piped, or explicit)
rootly incidents list --format=json
rootly incidents list --format=json | jq '.[] | .title'
# YAML
rootly incidents get --format=yaml
# Markdown (for documentation or LLM consumption)
rootly incidents list --format=markdown
```
### Pagination & Filtering
```bash
# 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
```
### Shell Completions
```bash
# 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
```
## Development
### Prerequisites
- Go 1.24+
- Make
### Build & Test
```bash
make build # Build binary
make test # Run tests
make lint # Run linter
make check # Format, lint, and test
make coverage # Tests with coverage report
```
### Release
Releases are automated via GoReleaser when a new tag is pushed:
```bash
make release-patch # v0.1.0 -> v0.1.1
make release-minor # v0.1.0 -> v0.2.0
make release-major # v0.1.0 -> v1.0.0
```
## License
MIT License - see [LICENSE](LICENSE.txt) for details.