@stephendolan/chartmogul-cli
v1.5.0
Published
A command-line interface for ChartMogul analytics
Maintainers
Readme
ChartMogul CLI
A command-line interface for ChartMogul analytics, designed for developers and LLMs.
Features
- LLM-first design - JSON output for easy parsing and automation
- Analytics focused - MRR, ARR, churn rates, LTV, customer counts
- Secure auth - Credentials stored in OS keychain
- Read-only - Query your data safely without risk of modification
Installation
npm install -g @stephendolan/chartmogul-cliLinux: Install libsecret for keychain support: sudo apt-get install libsecret-1-dev
Authentication
chartmogul auth login --api-key YOUR_API_KEY
chartmogul auth status
chartmogul auth logoutOr use the environment variable: export CHARTMOGUL_API_KEY=your_api_key
Get your API key from ChartMogul under Profile -> API Keys.
Commands
Metrics
All metric commands support --start-date, --end-date, and --interval (day, week, month, quarter).
chartmogul metrics all # All key metrics (last 30 days)
chartmogul metrics mrr # Monthly Recurring Revenue
chartmogul metrics arr # Annual Recurring Revenue
chartmogul metrics arpa # Average Revenue Per Account
chartmogul metrics asp # Average Sale Price
chartmogul metrics customer-count # Customer count over time
chartmogul metrics customer-churn # Customer churn rate
chartmogul metrics mrr-churn # MRR churn rate
chartmogul metrics ltv # Customer Lifetime Value
# With date range
chartmogul metrics mrr --start-date 2024-01-01 --end-date 2024-12-31 --interval monthCustomers
chartmogul customers list # List all customers
chartmogul customers list --status Active # Filter by status
chartmogul customers list --data-source <uuid> # Filter by data source
chartmogul customers view <uuid> # View customer details
chartmogul customers search --email [email protected]
chartmogul customers activities <uuid> # Customer activities
chartmogul customers subscriptions <uuid> # Customer subscriptionsOther Resources
# Account
chartmogul account view
# Plans
chartmogul plans list
chartmogul plans view <uuid>
# Invoices
chartmogul invoices list
chartmogul invoices list --customer <uuid>
chartmogul invoices view <uuid>
# Data Sources
chartmogul data-sources list
chartmogul data-sources view <uuid>
chartmogul data-sources set-default <uuid>
chartmogul data-sources get-default
# Activities
chartmogul activities list
chartmogul activities list --type new_biz --start-date 2024-01-01
# Activity types: new_biz, expansion, contraction, churn, reactivationMCP Server
Run as an MCP server for AI agent integration:
chartmogul mcpOutput
All commands output JSON. Use --compact or -c for single-line output:
chartmogul metrics mrr # Pretty-printed JSON
chartmogul -c metrics mrr # Compact JSON (single line)Monetary values are in dollars (not ChartMogul's internal cents). An MRR of 100 means $100.
Errors are also returned as JSON:
{"error": {"name": "unauthorized", "detail": "Invalid API key", "statusCode": 401}}Environment Variables
| Variable | Description |
|----------|-------------|
| CHARTMOGUL_API_KEY | API key (alternative to keychain) |
| CHARTMOGUL_DATA_SOURCE | Default data source UUID |
License
MIT
