Skip to content

Osuite CLI reference

The osuite CLI queries your telemetry — logs, metrics, and traces — and manages dashboards as code from the terminal. It is the same tool the Osuite AI agents drive under the hood, so anything an agent can read or change, you can script directly.

This page documents every command. For first-time install and authentication, follow Set up the Osuite AI agents — the CLI setup is shared with the agents and is not repeated here.

The CLI is published to npm as @osuite/cli and installs globally.

Terminal window
npm install @osuite/cli -g

Confirm the install and check the version.

Terminal window
osuite --version

The CLI reads two environment variables. Both are required; the CLI exits with an error if either is missing.

VariablePurpose
OSUITE_API_KEYYour Osuite API key. Sent as a bearer token on every request.
OSUITE_API_ENDPOINTYour region’s query API base URL, for example https://api.<region>.osuite.io.

Add them to your shell profile:

Terminal window
export OSUITE_API_ENDPOINT=https://api.<region>.osuite.io
export OSUITE_API_KEY=<your-api-key>

Run osuite whoami to confirm you are authenticated. Create an API key in the Osuite UI under Settings → API Keys — see Set up the Osuite AI agents for the full walkthrough.

The API endpoint used here is the query API, which is different from the OTLP ingest endpoint your services send telemetry to. See the OTLP endpoints reference for the distinction.

These apply to osuite itself and are available on every command.

OptionDescription
-o, --output <format>Output format: json or text. Defaults vary by command (see below).
-V, --versionPrint the CLI version.
-h, --helpPrint help for the CLI or any command. Run osuite <command> --help for a specific command.

Default output formats:

Command groupDefault --output
logs, tracesjson
metrics, whoamijson
dashboardtext

text output prints a human-readable summary with progress spinners; json prints the raw structured response, suitable for piping into jq or another tool.

CommandWhat it does
dashboardManage dashboards as code — pull, plan, and apply local JSON files.
logsSearch logs, Kubernetes events, and RUM session events.
metricsRun PromQL queries and discover metrics and labels.
tracesSearch distributed traces and individual spans.
whoamiPrint the authenticated user profile.
init-aiInstall the Osuite AI agent skills globally.
upgradeUpgrade the CLI and refresh the installed skills.

The logs and traces search commands share a filter grammar. Each --filter takes an expression in the form field__operator=value, and you can pass --filter multiple times to combine conditions.

OperatorMeaningExample
isExact matchresource.service.name__is=checkout
is_notExclude matchresource.service.environment__is_not=dev
inOne of a comma-separated listseverity.text__in=error,warning
containsSubstring match (traces only)operationName__contains=http
gt, gte, lt, lteNumeric comparisonsduration__gt=1000

Field names are the fully qualified attribute paths Osuite stores, such as resource.service.name or attributes.event.name. See the resource attributes reference for the common resource fields and how they map to the UI.

The query commands accept a relative range or an explicit start and end.

  • --range <range> — one of 15m, 1h, 6h, 1d, 4d.
  • --start / --end — an explicit window that overrides --range.

The unit of --start and --end differs by command:

  • logs and traces take milliseconds since the epoch.
  • metrics query takes seconds since the epoch.

Manage Osuite dashboards as code. Local JSON files are the source of truth: you pull dashboards down, edit them, preview the diff, and apply the changes back. For the dashboard file format, see the dashboard JSON schema reference.

osuite dashboard <subcommand> [path]
SubcommandDescription
pullPull all dashboards from Osuite into the current directory as JSON files.
plan [path]Preview the changes that apply would make, without calling the API to mutate anything.
apply [path]Apply local dashboard JSON files to Osuite.

apply mutates remote state from your local .json files:

  • A dashboard with no id (or an id not found remotely) is created, and the returned id is written back to the local file.
  • A dashboard with an existing id is updated.
  • A dashboard with no changes is skipped.

If [path] is omitted, every *.json file in the current directory is used. Pass a file or a directory to narrow the set.

OptionDescription
--dry-runPreview changes without making API calls.
Terminal window
osuite dashboard apply
osuite dashboard apply ./dashboards/
osuite dashboard apply my-dashboard.json
osuite dashboard apply --dry-run

Run osuite dashboard plan or apply --dry-run first to review the diff before writing to your account.

Query logs and event streams from Osuite. All three subcommands share the filter syntax and time-range options.

SubcommandDescription
searchSearch application and infrastructure logs.
k8s-eventsSearch Kubernetes cluster events.
session-eventsSearch RUM session events.

Common options for all three:

OptionDescription
--filter <filters...>One or more field__operator=value expressions.
--limit <n>Maximum results to return (default 100).
--range <range>Relative time range (default 1h).
--start <ms>Start time in milliseconds since the epoch (overrides --range).
--end <ms>End time in milliseconds since the epoch (overrides --range).
Terminal window
osuite logs search --filter resource.service.name__is=myservice
osuite logs search --filter severity.text__in=error,warning --filter resource.service.environment__is_not=dev
osuite logs search --range 6h
osuite logs search --start 1710460800000 --end 1710547200000 --output json

Search cluster events collected by the osuite-k8s Helm chart. Common fields include resource.cluster, resource.environment, resource.k8s.namespace.name, attributes.event.domain, and attributes.event.name.

Terminal window
osuite logs k8s-events --filter resource.k8s.namespace.name__is=observability
osuite logs k8s-events --filter resource.cluster__is=osuite-us-east-1 --filter resource.environment__is=prod-us
osuite logs k8s-events --range 1d --limit 50 --output json

Search RUM session events. Common fields include resource.cluster, resource.environment, attributes.event.domain, and attributes.event.name.

Terminal window
osuite logs session-events --filter attributes.event.domain__is=session
osuite logs session-events --filter resource.environment__is=prod-us
osuite logs session-events --range 6h

Query metrics and discover what is available. metrics query runs PromQL; the other subcommands help you find metric and label names to query — see Querying with PromQL for the query language itself.

SubcommandDescription
search-embedding <query>Search for metrics and their labels using a phrase.
get-labels <metric>List the labels available on a metric.
get-label-values <metric> [label]List values for a label, or for all labels if omitted.
query <promql>Run a PromQL query.

Find metrics by describing them in words.

Terminal window
osuite metrics search-embedding "CPU usage"
osuite metrics search-embedding "memory consumption" --output json
Terminal window
osuite metrics get-labels up
osuite metrics get-labels http_requests_total --output json

Pass a metric to list all its labels and their values, or add a label name to list only that label’s values.

Terminal window
osuite metrics get-label-values http_requests_total
osuite metrics get-label-values http_requests_total status_code
osuite metrics get-label-values up --output json

Run a PromQL query. Step size is calculated automatically for range queries from the start and end times.

OptionDescription
--range <range>Relative time range (default 15m).
--start <seconds>Start time in seconds since the epoch (overrides --range).
--end <seconds>End time in seconds since the epoch (overrides --range).
--type <type>Query type: instant or range (default range).
Terminal window
osuite metrics query "up"
osuite metrics query "up" --start 1710460800 --end 1710547200
osuite metrics query "rate(http_requests_total[5m])" --range 1h --type range --output json

The --start and --end times for metrics query are in seconds, unlike the millisecond timestamps used by logs and traces.

Search distributed traces and individual spans. The search commands share the filter syntax and time-range options, and add the contains operator for substring matching.

SubcommandDescription
searchSearch traces.
search-spanSearch individual spans.
getbyid <traceId>Fetch one trace by ID, including its full span hierarchy.
getoperationsList service names and their operations.

Common options for search and search-span:

OptionDescription
--service <name>Filter by service name.
--environment <env>Filter by environment.
--operation <op>Filter by operation name.
--filter <filters...>Additional field__operator=value expressions.
--limit <n>Maximum results to return (default 10).
--range <range>Relative time range (default 1h).
--start <ms>Start time in milliseconds since the epoch.
--end <ms>End time in milliseconds since the epoch.

search also accepts --min-duration <ms> and --max-duration <ms> to bound trace duration.

Terminal window
osuite traces search --service myservice
osuite traces search --service myservice --filter some.field__is=test
osuite traces search --environment production --filter some.field__is=test --output json
osuite traces search --range 6h --output json

Same options as search, but returns individual spans rather than whole traces.

Terminal window
osuite traces search-span --service myservice
osuite traces search-span --environment production --filter some.field__is=test --output json

Fetch a single trace by its ID. The response is the complete trace hierarchy, including spans and operations.

Terminal window
osuite traces getbyid <traceId>

List every service and the operations it emits. Use this to discover valid --operation values before running a search.

OptionDescription
--service <service>Filter operations by a specific service.
Terminal window
osuite traces getoperations
osuite traces getoperations --service myservice

Print the authenticated user profile. Use it to confirm the CLI is configured and pointed at the right account.

Terminal window
osuite whoami

Install the Osuite AI agent skills globally so your AI IDE can invoke them as slash commands. It installs every bundled skill — Instrumentation (/osuite-instrument), Investigation (/osuite-investigate), Visualizer (/osuite-edit-dashboard), and Write PromQL (/osuite-write-promql).

Terminal window
osuite init-ai

See Set up the Osuite AI agents for the full setup, including which AI IDEs are supported.

Check npm for the latest CLI release, upgrade the CLI if a newer version exists, and then refresh the installed agent skills. Run it periodically to pick up new skill versions.

Terminal window
osuite upgrade