The OpsTrails CLI lets you track events from your terminal or CI/CD pipelines.
npm install -g @opstrails/cliSet your API key as an environment variable:
export OPSTRAILS_API_KEY=YOUR_API_KEY✅ Tip
OPSTRAILS_API_KEY as a secret/masked variable in your pipeline configuration.Record an event on the timeline.
opstrails track \
--type deployment \
--source "//github.com/your-org/your-repo" \
--subject production \
--version v1.2.3| Flag | Required | Description |
|---|---|---|
--type | required | Event type (e.g. deployment, rollback) |
--source | required | Event source URI |
--subject | optional | Context label (e.g. production) |
--version | optional | Release version |
--severity | optional | LOW, MINOR, MAJOR, or CRITICAL |
--description | optional | Human-readable description of the event |
--time | optional | Timestamp (defaults to "NOW") |
opstrails track \
--type deployment \
--source "//github.com/acme/api-service" \
--subject production \
--version v2.1.0 \
--severity LOW \
--description "Deployed API service v2.1.0 to production"| Variable | Description |
|---|---|
OPSTRAILS_API_KEY | API key with READ_WRITE scope |
OPSTRAILS_API_URL | API base URL (defaults to https://api.opstrails.dev) |