Skip to main content

Metricly CLI - Query metrics and manage dashboards from the terminal

Project description

Metricly CLI

Query metrics and manage dashboards from the terminal.

Installation

Using uv (Recommended)

# Install from local build
uv tool install ./backend

# Or install from GitHub (once published)
uv tool install git+https://github.com/metricly/metricly#subdirectory=backend

Using pip

pip install ./backend

Quick Start

# Login with Google OAuth
metricly login

# Check who you're logged in as
metricly whoami

# List available metrics
metricly metrics list

# Query metrics
metricly query -m total_revenue -g month --limit 5

# Get visualization suggestions
metricly query -m total_revenue -g month --suggest-viz

# Export to JSON
metricly query -m total_revenue --format json > data.json

Commands

Authentication

metricly login          # Login via Google OAuth (opens browser)
metricly whoami         # Show current user and organization
metricly logout         # Clear stored credentials
metricly org list       # List your organizations
metricly org switch ID  # Switch to a different organization

Querying Metrics

# List available metrics
metricly metrics list
metricly metrics list --format json

# Get metric details
metricly metrics show total_revenue

# Query data
metricly query -m revenue -g month                    # Monthly revenue
metricly query -m revenue -d region --limit 10        # By region
metricly query -m revenue -m orders -g week           # Multiple metrics
metricly query -m revenue --start 2024-01-01 --end 2024-12-31

# With visualization suggestion
metricly query -m revenue -g month --suggest-viz

# List dimensions
metricly dimensions list

Dashboard Management

# List dashboards
metricly dashboards list

# Show dashboard details
metricly dashboards show DASHBOARD_ID

# Create a new dashboard
metricly dashboards create "My Dashboard"
metricly dashboards create "Team Metrics" -v org  # Visible to team

# Delete a dashboard
metricly dashboards delete DASHBOARD_ID
metricly dashboards delete DASHBOARD_ID --yes     # Skip confirmation

Manifest Management (Admin Only)

# View manifest status
metricly manifest status

# Export manifest
metricly manifest export -o manifest.yaml

# Import manifest
metricly manifest upload manifest.yaml
metricly manifest upload manifest.yaml --force  # Overwrite conflicts

# Semantic models
metricly models list
metricly models show orders
metricly models create model.yaml
metricly models update orders updated.yaml
metricly models delete orders

# Metrics
metricly metrics create metric.yaml
metricly metrics update total_revenue updated.yaml
metricly metrics delete total_revenue
metricly metrics preview metric.yaml  # Test before saving

Output Formats

All commands support --format:

Format Description
table Human-readable ASCII table (default)
json JSON output for scripting
yaml YAML output for config editing
metricly metrics list --format json | jq '.[0]'
metricly dashboards show abc123 --format yaml > dashboard.yaml

Configuration

Credentials are stored in ~/.metricly/:

~/.metricly/
├── credentials.json    # OAuth tokens (encrypted)
└── config.json         # User preferences

Development

# Build the wheel
cd backend
uv build

# Install locally for testing
uv tool install dist/metricly_cli-*.whl --force

# Run tests
uv run pytest tests/ -v

Environment Variables

Variable Description
FIRESTORE_EMULATOR_HOST Use Firestore emulator
FIREBASE_AUTH_EMULATOR_HOST Use Auth emulator
ENV Environment: production, development, test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

metricly_cli-0.1.8.tar.gz (342.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

metricly_cli-0.1.8-py3-none-any.whl (103.2 kB view details)

Uploaded Python 3

File details

Details for the file metricly_cli-0.1.8.tar.gz.

File metadata

  • Download URL: metricly_cli-0.1.8.tar.gz
  • Upload date:
  • Size: 342.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for metricly_cli-0.1.8.tar.gz
Algorithm Hash digest
SHA256 83f8c38544f11675f21e53da240b26e04e29d20e5f66b2605b0a088f13fb6858
MD5 1f51f3df1c10bf78d56d3feba869b8ef
BLAKE2b-256 d7fc9460e55ddef0c9bd39e3495e232f6aaab59dd63aadb055e634ad37d9bc74

See more details on using hashes here.

File details

Details for the file metricly_cli-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: metricly_cli-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 103.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.8

File hashes

Hashes for metricly_cli-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 ed818c6c9af74d0685976c2eb2b27dffe722808ff68e5042ed65bab6827c2281
MD5 da800a40de2a88f326984de5f278327a
BLAKE2b-256 af1518b3066c8ed16445fed6d4705b7a4e60ddd15ac9ce0a6e9218278f529f4d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page