# README

rootly cli
A command-line interface for rootly
đ Table of Contents
đ Getting Started
The rootly command-line tool allows you to interact with rootly in your terminal, CI environment, or anything that can run a simple program. At the moment the main purpose of the cli is to send pulses right from the command line. This is great for sending a pulse at the end of a deploy script for example. You can also send pulses based off the exit status of a given command to run.
đ Install
đ macOS
Simply run the command below:
brew install rootly-io/homebrew-tap/rootly
đ§ Linux and đĨī¸ Windows
You can grab the binary from the latest release
đ Commands
âšī¸ rootly pulse
rootly pulse
allows you to send a pulse right from the command-line. The summary for the pulse, which is required, goes at the end of the command as a normal argument.
Flag Name | Description | Examples | Required | Environment Variable |
---|---|---|---|---|
api-key | A rootly api key | --api-key "ABC123" | Yes | ROOTLY_API_KEY |
api-host | Host url for the rootly api. Default is https://api.rootly.io | --api-host "https://rootly.hello.com" | No | ROOTLY_API_HOST |
labels | Key value pair labels (separated with commas with no spaces around = ) | --labels "version=2, attempt=1" | No | ROOTLY_LABELS |
services | Services associated with the pulse (separated with commas) | --services "elasticsearch-prod" | No | ROOTLY_SERVICES |
environments | Environments associated with the pulse (separated with commas) | --environments "staging, production" | No | ROOTLY_ENVIRONMENTS |
Here are some examples:
rootly pulse-run --api-key "ABC123" Hello there
- Summary: Hello there
- Labels: None
- Services: None
- Environments: None
rootly pulse --api-key "ABC123" --environments "staging, production" --services "elasticsearch-staging, elasticsearch-prod" Hello World!
- Summary: Hello World
- Labels: None
- Services: elasticsearch-staging and elasticsearch-prod
- Environments: staging and production
rootly pulse --api-key ABC123 --environments "production" --labels "Version=2, Attempt=1" Is this thing on?
- Summary: Is this thing on?
- Labels: Version: 2 and Attempt: 1
- Services: None
- Environments: production
đ rootly pulse-run
rootly pulse-run
allows you to wrap a terminal command and send a pulse with a label of the exit code. The summary for the pulse is a flag and if no value is provided it will use the command. The command goes at the end of the command as a normal argument.
Flag Name | Description | Examples | Required | Environment Variable |
---|---|---|---|---|
api-key | A rootly api key | --api-key "ABC123" | Yes | ROOTLY_API_KEY |
api-host | Host url for the rootly api. Default is https://api.rootly.io | --api-host "https://rootly.hello.com" | No | ROOTLY_API_HOST |
summary | Summary for the pulse. Default is just the command | --summary "Deployed Website" | No | ROOTLY_SUMMARY |
labels | Key value pair labels (separated with commas with no spaces around = ) | --labels "Version=2, Attempt=1" | No | ROOTLY_LABELS |
services | Services associated with the pulse (separated with commas) | --services "elasticsearch-prod" | No | ROOTLY_SERVICES |
environments | Environments associated with the pulse (separated with commas) | --environments "staging, production" | No | ROOTLY_ENVIRONMENTS |
Here are some examples:
rootly pulse-run --api-key "ABC123" make publish
- Summary: make publish
- Labels: Exit Code: 0
- Services: None
- Environments: None
- Command:
make publish
rootly pulse-run --api-key "ABC123" --environments "staging, production" --services "elasticsearch-staging, elasticsearch-prod" echo Hello World
- Summary: echo Hello World
- Labels: Exit Code: 0
- Services: elasticsearch-staging and elasticsearch-prod
- Environments: staging and production
- Command:
echo Hello World
rootly pulse --api-key ABC123 --environments "production" --labels "version=2, attempt=1" --summary "Deploy Website" sh deploy.sh
- Summary: sh deploy.sh
- Labels: Version: 2, Attempt: 1, and Exit Code: 1
- Services: None
- Environments: production
- Command:
sh deploy.sh
đĻ Running in CI
When using the rootly CLI in a CI environment there are some useful features to make the process easier. Every single flag can use an environment variable instead. The api-key
flag for example could use the environment variable ROOTLY_API_KEY
instead. To get the environment variable for a certain flag just replace all hyphens (-
) with underscores (_
), make all letters uppercase, and add ROOTLY_
to the front.
There is also a GitHub action for rootly pulse
that makes it easy to use in a GitHub actions environment. See the rootly-io/pulse-action repository for more information.