CLI
CLI
Manage OwlMetry from the command line — query events, manage projects, and integrate with AI agents.
The OwlMetry CLI (@owlmetry/cli) lets you manage your OwlMetry instance from the terminal. Use it to query events, create and manage projects and apps, inspect metrics and funnels, and view audit logs. It also ships AI skill files that teach coding agents how to instrument and query OwlMetry.
Key capabilities
- Query events with flexible filters, date ranges, and output formats
- Manage resources — projects, apps, metrics, and funnels
- Inspect metrics — view definitions, query aggregations, and browse raw metric events
- Analyze funnels — run funnel queries with open/closed modes and experiment segmentation
- Audit trail — review who did what across your team
- Multi-team support — authenticate with multiple teams and switch between them
- AI agent integration — bundled skill files for CLI, Node SDK, and Swift SDK
Global options
Every command accepts these global flags. They can be placed before or after the subcommand.
owlmetry [global options] <command> [command options]| Flag | Description | Default |
|---|---|---|
--format <format> | Output format: table, json, or log | table |
--endpoint <url> | OwlMetry API server URL | From config or https://api.owlmetry.com |
--api-key <key> | API key (overrides config file) | From config or OWLMETRY_API_KEY env var |
--ingest-endpoint <url> | Ingest endpoint URL (for SDK setup commands) | Derived from API endpoint |
--team <name-or-id> | Use a specific team profile for this command | Active team from config |
--version | Print CLI version | |
--help | Show help for any command |
Configuration resolution
The CLI resolves configuration in this order:
- Command-line flags (
--endpoint,--api-key,--team) - Environment variables (
OWLMETRY_ENDPOINT,OWLMETRY_API_KEY) - Config file (
~/.owlmetry/config.json)
See Authentication for details on setting up the config file.
Output formats
The --format flag controls how results are displayed:
table(default) — human-readable tables with aligned columnsjson— raw JSON, suitable for piping tojqor other toolslog— chronological log view, used byeventsandinvestigatecommands
# Default table output
owlmetry events --since 1h
# JSON for scripting
owlmetry events --since 1h --format json
# Log view for event streams
owlmetry events --since 1h --format log