Get Started with openstatus CLI
What you’ll learn
Section titled “What you’ll learn”| Time | ~10 minutes |
| Level | Intermediate |
| Prerequisites | openstatus account, command line experience |
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.
Prerequisites
Section titled “Prerequisites”- An openstatus account
- Command line experience
- API token from your openstatus workspace (Settings → API)
What you’ll build
Section titled “What you’ll build”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

Installation
Section titled “Installation”Install the openstatus CLI to manage your monitors directly from code.
Using Homebrew (recommended):
brew install openstatusHQ/cli/openstatus --caskOr using the install script:
curl -fsSL https://raw.githubusercontent.com/openstatusHQ/cli/refs/heads/main/install.sh | bashcurl -fsSL https://raw.githubusercontent.com/openstatusHQ/cli/refs/heads/main/install.sh | bashWindows
Section titled “Windows”iwr https://raw.githubusercontent.com/openstatusHQ/cli/refs/heads/main/install.ps1 | iexVerify installation
Section titled “Verify installation”Run the following command to confirm the CLI is installed:
openstatus --versionYou should see output like:
openstatus version x.x.xConfigure API authentication
Section titled “Configure API authentication”Create an API key in your workspace settings (Settings → API), then set it as an environment variable:
# macOS / Linuxexport OPENSTATUS_API_TOKEN=<your-api-token># Windows PowerShell$env:OPENSTATUS_API_TOKEN="<your-api-token>"Import existing monitors
Section titled “Import existing monitors”Start by importing your existing monitors from your workspace to a YAML file:
openstatus monitors importYou should see output confirming the import:
Successfully imported X monitors to openstatus.yamlThis creates an openstatus.yaml file containing all your current monitors. This file becomes your single source of truth for monitoring configuration.
Checkpoint: Open the openstatus.yaml file and verify it contains your monitors. You should see entries with your monitor names and URLs.
Manage monitors as code
Section titled “Manage monitors as code”Now you can add, remove, or update monitors in the YAML file and apply your changes:
openstatus monitors applyThe CLI will show you a diff of changes before applying them, ensuring you’re aware of what will be modified.
What you’ve accomplished
Section titled “What you’ve accomplished”Excellent work! You’ve successfully:
- ✅ Installed the openstatus CLI
- ✅ Configured API authentication
- ✅ Imported monitors to a YAML file
- ✅ Learned the monitoring as code workflow
Troubleshooting
Section titled “Troubleshooting””command not found: openstatus”
Section titled “”command not found: openstatus””Cause: The CLI binary is not in your PATH.
Fix (macOS/Homebrew):
brew reinstall openstatusHQ/cli/openstatus --caskFix (install script): Ensure ~/.local/bin is in your PATH:
export PATH="$HOME/.local/bin:$PATH"“unauthorized” or “invalid token” error
Section titled ““unauthorized” or “invalid token” error”Cause: Your API token is missing or incorrect.
Fix:
- Verify the token is set:
echo $OPENSTATUS_API_TOKEN - Regenerate the token in your workspace settings (Settings → API)
- Make sure there are no extra spaces or newlines in the token value
”no monitors found” on import
Section titled “”no monitors found” on import”Cause: Your workspace has no monitors, or the token belongs to a different workspace.
Fix: Create at least one monitor in the dashboard first, then retry the import.
What’s next?
Section titled “What’s next?”Now that you have the CLI set up, you can:
- Monitor Your MCP Server - Example of CLI-based monitor configuration
- CLI Reference - Complete command documentation
- Set up CI/CD - Automate monitoring in your pipeline
Advanced workflows
Section titled “Advanced workflows”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
Learn more
Section titled “Learn more”- Monitoring as Code Concept - Why manage monitors as code
- CLI Reference - All available commands
- YAML Configuration Examples - Sample configurations