Enterprise-Grade CLI for OpenObserve Management
Version: 1.1.3 | Status: Production-Ready β
- Overview
- Features
- Installation
- Quick Start
- Configuration
- Resources
- Command Syntaxes
- Examples
- Documentation
O2 CLI is a command-line interface for managing OpenObserve resources directly, similar to AWS CLI or kubectl. It provides an imperative way to manage OpenObserve alongside the declarative Kubernetes Operator.
Why O2 CLI?
- β Direct management without Kubernetes
- β Quick ad-hoc operations
- β Multi-environment support
- β Scripting and automation
- β Resource querying and export
- β 6 Resources with Full CRUD: Dashboards, Templates, Destinations, Pipelines, Functions, Alerts
- β 7 Resources Queryable: Including Organizations
- β Simple YAML Format: No Kubernetes wrapper needed (for most resources)
- β Multi-Environment: Unlimited profiles (dev, staging, prod)
- β Multi-Tenant: Query across 21+ organizations
- β 4 Output Formats: table, JSON, YAML, wide
- β 2 Command Syntaxes: kubectl-style + resource-first
- β Auto-detection of YAML format (simple vs full K8s)
- β Flexible delete/update (by name or from file)
- β Auto-defaults for missing fields
- β Filtering (folder, type, enabled-only)
- β Organization override
curl -fsSL https://raw.githubusercontent.com/openobserve/o2-cli/main/install.sh | bashbrew tap openobserve/tap
brew install o2# macOS Apple Silicon
curl -L https://github.com/openobserve/o2-cli/releases/latest/download/o2-darwin-arm64.tar.gz | tar xz
sudo mv o2 /usr/local/bin/
# macOS Intel
curl -L https://github.com/openobserve/o2-cli/releases/latest/download/o2-darwin-amd64.tar.gz | tar xz
sudo mv o2 /usr/local/bin/
# Linux AMD64
curl -L https://github.com/openobserve/o2-cli/releases/latest/download/o2-linux-amd64.tar.gz | tar xz
sudo mv o2 /usr/local/bin/- OpenObserve Enterprise instance
- Valid credentials (username/password or API token)
# Setup default profile
o2 configure
# Enter: endpoint, organization, username, password
# Setup additional environments
o2 configure --profile dev
o2 configure --profile prodNote: The CLI will validate your OpenObserve instance is Enterprise edition on first command.
# List all organizations
o2 list organizations
# Get organization summary
o2 organization get default --summary
# List dashboards
o2 list dashboard --folder production
# List alerts
o2 list alert --folder default --enabled-only# Create a template
o2 create template -f slack-alert.yaml
# List templates
o2 list template
# Delete a template
o2 delete template old-templateConfigure Multiple Environments:
o2 configure # Default profile
o2 configure --profile dev # Dev environment
o2 configure --profile staging # Staging environment
o2 configure --profile prod # Production environmentList All Profiles:
o2 configure listConfig File Location: ~/.o2/config.yaml
Example Config:
profiles:
default:
endpoint: https://openobserve.company.com
organization: default
username: user@company.com
password: your-password
dev:
endpoint: https://dev.openobserve.com
organization: dev-org
username: dev-user@company.com
password: dev-password| Resource | Create | List | Get | Update | Delete | Samples |
|---|---|---|---|---|---|---|
| Organizations | β | β | β (+ summary) | - | - | - |
| Dashboards | β | β | β | β | β (by ID) | Operator samples |
| Templates | β | β | β | β | β | 6 files |
| Destinations | β | β | β | β | β | 3 files |
| Pipelines | β | β | β | β | β | 2 files |
| Functions | β | β | β | β | β | 5 files |
| Alerts | β | β | β | β | β | 2 files |
O2 CLI supports TWO syntaxes - use whichever you prefer!
o2 <verb> <resource> [name] [flags]
# Examples:
o2 list template
o2 get dashboard 123456
o2 create template -f template.yaml
o2 update pipeline -f pipeline.yaml
o2 delete function my-functiono2 <resource> <verb> [name] [flags]
# Examples:
o2 template list
o2 dashboard get 123456
o2 template create -f template.yaml
o2 pipeline update -f pipeline.yaml
o2 function delete my-functionBoth syntaxes do the same thing!
# Create in dev
o2 create template -f alert.yaml --profile dev
# Test it
o2 list template --profile dev
# Export from dev
o2 get template MyAlert --profile dev -o yaml > tested.yaml
# Deploy to prod
o2 create template -f tested.yaml --profile prod# List all organizations
o2 list organizations
# Query different orgs
o2 list alert --org org1
o2 list dashboard --org org2 --folder monitoring
o2 list function --org org3# Backup all templates
for t in $(o2 list template --output json | jq -r '.[].name'); do
o2 get template $t -o yaml > backups/${t}.yaml
done
# Restore templates
for f in backups/*.yaml; do
o2 create template -f $f
done# Create destination
o2 create dest -f slack-webhook.yaml
# List HTTP destinations
o2 list dest --type http
# Update destination
o2 update dest -f updated-webhook.yaml
# Delete destination
o2 delete dest slack-webhook- COMMANDS.md - Complete command reference with syntax
- README.md - This file
Located in samples/ directory:
templates/- 6 alert template samplesdestinations/- 3 destination samplespipelines/- 2 pipeline samplesfunctions/- 5 function samplesdashboards/- 2 dashboard samplesalerts/- 2 alert samples
Located in docs/ directory:
ARCHITECTURE.md- Technical architectureIMPLEMENTATION_PLAN.md- Development roadmapTESTING.md- Testing guidePROFILES.md- Multi-environment setupDISTRIBUTION.md- Packaging and distribution
Available on all commands:
| Flag | Short | Default | Description |
|---|---|---|---|
--profile |
default |
Use specific profile | |
--org |
From profile | Override organization | |
--output |
-o |
table |
Output format: table, json, yaml, wide |
--config |
~/.o2/config.yaml |
Custom config file |
o2 organization list
o2 organization get default --summary
o2 organization create myorg --identifier myorg
o2 get organization myorg --summaryo2 create template -f template.yaml
o2 list template
o2 delete template MyTemplateo2 create dest -f destination.yaml
o2 list dest --type http
o2 delete dest my-destinationo2 create dashboard -f dashboard.yaml
o2 list dashboard --folder production
o2 delete dashboard 7417863561566760960 # Use ID from listo2 create pipeline -f pipeline.yaml
o2 list pipeline
o2 delete pipeline my-pipelineo2 create function -f function.yaml
o2 list function
o2 delete function my-functiono2 create alert -f alert.yaml
o2 list alert --folder test_alerts --enabled-only
o2 get alert my-alert
o2 update alert -f updated-alert.yaml
o2 delete alert my-alert# Configure environments
o2 configure --profile dev
o2 configure --profile prod
# Use different environments
o2 list template --profile dev
o2 create template -f alert.yaml --profile prod
o2 list dashboard --profile staging --folder monitoringWhat's Available:
- Commands: 90+
- Working: 60+
- Full CRUD Resources: 6
- Query Resources: 7
- Sample Files: 18+
- Organizations: 21+
O2 CLI is production-ready for:
- Alert template management
- Destination configuration
- Pipeline lifecycle
- Function management
- Dashboard management
- Resource querying and auditing
- Multi-environment workflows
- Backup and restore operations
Kubernetes Operator: For GitOps and declarative management
kubectl apply -f dashboard.yamlO2 CLI: For direct management and scripting
o2 create dashboard -f dashboard.yamlUse both together for complete OpenObserve management!
# General help
o2 --help
# Command help
o2 list --help
o2 create --help
o2 delete --help
# Resource-specific help
o2 template --help
o2 dashboard --help
o2 pipeline --helpManage OpenObserve like a pro:
- Create and manage alert templates across environments
- Configure destinations for Slack, PagerDuty, Email
- Deploy pipelines for data routing
- Manage VRL functions for data transformation
- Query resources across 21+ organizations
For detailed command syntax, see COMMANDS.md
For samples, see samples/ directory
For advanced topics, see docs/ directory