Metrics for humans and agents
A CLI built for both humans and coding agents. Claude Code, Codex, Devin, and other AI assistants can query your metrics and manage dashboards autonomously.
Quick install
With pip:
With uv:
Query from anywhere
Run metric queries from your terminal, scripts, or CI/CD pipelines. No browser required.
Agent-native design
Built for coding agents like Claude Code, Codex, and Devin. Structured output they can parse and act on.
Multiple output formats
JSON for agents, CSV for spreadsheets, YAML for config files, tables for humans.
CI/CD integration
Validate metrics in your pipeline. Catch data issues before they reach production.
Powerful commands
Query metrics, manage dashboards, and update your semantic layer from the terminal.
Authentication
metricly loginAuthenticate via Google OAuth
metricly whoamiShow current user and organization
metricly org switch <id>Switch to different organization
Querying
metricly query -m revenue -g monthQuery revenue by month
metricly query -m revenue -d region --limit 10Top 10 regions by revenue
metricly query -m mrr,churn -f jsonMultiple metrics as JSON
Dashboards
metricly dashboards listList your dashboards
metricly dashboards show <id>Show dashboard details
metricly dashboards create "Sales"Create new dashboard
Metrics & Models
metricly metrics listList available metrics
metricly metrics show total_revenueShow metric definition
metricly manifest upload manifest.yamlImport semantic layer
Built for coding agents
AI assistants use the CLI to understand your data while they work.
Claude Code
Analyzing business metrics while reviewing code
Codex / Devin
Automated reporting workflow
Works with popular coding agents
Flexible output formats
Tables for humans, JSON for agents, CSV for spreadsheets.
Table
-f tableHuman-readable ASCII tables
┌────────────┬───────────┐
│ month │ revenue │
├────────────┼───────────┤
│ 2024-01 │ $1,234,567│
│ 2024-02 │ $1,345,678│
└────────────┴───────────┘JSON
-f jsonStructured data for agents
{
"data": [
{"month": "2024-01", "revenue": 1234567},
{"month": "2024-02", "revenue": 1345678}
]
}CSV
-f csvSpreadsheet-compatible
month,revenue
2024-01,1234567
2024-02,1345678CI/CD integration
Validate metrics in your pipeline. Catch data issues before they reach production.
- Validate metric definitions on PR
- Alert on unexpected metric changes
- Test queries before deployment
- Works with GitHub Actions, GitLab CI, CircleCI
Example GitHub Action:
- name: Validate metrics
run: |
metricly metrics list -f json > metrics.json
metricly query -m revenue \
--start ${{ env.START_DATE }} \
-f json > revenue.json
# Assert revenue is positive
jq -e '.data[0].revenue > 0' revenue.jsonFrequently asked questions
How do coding agents use the CLI?
Coding agents like Claude Code and Codex can execute metricly commands directly. They parse the JSON output to understand your metrics, validate data assumptions, and make informed decisions while writing code.
Can I use the CLI in CI/CD pipelines?
Yes. Use `metricly query` with JSON output to validate metrics in your pipeline. Set up alerts when key metrics change unexpectedly or data quality issues arise.
What authentication methods are supported?
The CLI uses Google OAuth for authentication. Run `metricly login` to open a browser and authenticate. Credentials are stored securely in ~/.metricly/credentials.json.
Is the CLI open source?
The CLI is part of the Metricly backend package and included with your subscription. Documentation and examples are available in our public docs.
Ready to query metrics from anywhere?
Install the CLI and start querying in minutes.