Skip to content

Get Started with openstatus CLI

In this tutorial, you’ll learn how to use the openstatus CLI to manage your monitors as code. This enables you to version control your monitoring configuration, automate deployments, and implement GitOps workflows.

  • An openstatus account
  • Command line experience
  • API token from your openstatus workspace (Settings → API)

By the end of this tutorial, you’ll have:

  • openstatus CLI installed on your system
  • Monitors exported to a YAML configuration file
  • Understanding of monitoring as code workflows
  • Ability to manage monitors programmatically
openstatus CLI in action showing monitor management

Install the openstatus CLI to manage your monitors directly from code.

Using Homebrew (recommended):

Terminal window
brew install openstatusHQ/cli/openstatus --cask

Or using the install script:

Terminal window
curl -sSL instl.sh/openstatushq/cli/macos | bash
Terminal window
curl -sSL instl.sh/openstatushq/cli/linux | bash
Terminal window
iwr instl.sh/openstatushq/cli/windows | iex

Create an API key in your workspace settings (Settings → API), then set it as an environment variable:

Terminal window
export OPENSTATUS_API_TOKEN=<your-api-token>

Tip: Add this to your shell profile (~/.bashrc, ~/.zshrc) to persist across sessions.

Start by importing your existing monitors from your workspace to a YAML file:

Terminal window
openstatus monitors import

This creates an openstatus.yaml file containing all your current monitors. This file becomes your single source of truth for monitoring configuration.

Now you can add, remove, or update monitors in the YAML file and apply your changes:

Terminal window
openstatus monitors apply

The CLI will show you a diff of changes before applying them, ensuring you’re aware of what will be modified.

Excellent work! You’ve successfully:

  • ✅ Installed the openstatus CLI
  • ✅ Configured API authentication
  • ✅ Imported monitors to a YAML file
  • ✅ Learned the monitoring as code workflow

Now that you have the CLI set up, you can:

With the CLI, you can:

  • Version control your monitoring configuration with Git
  • Review monitoring changes in pull requests
  • Automate monitor creation for new services
  • Sync monitors across multiple environments
  • Implement GitOps for infrastructure monitoring