Package Exports
- @optima-chat/bi-cli
- @optima-chat/bi-cli/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@optima-chat/bi-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@optima-chat/bi-cli
Optima BI CLI - AI-friendly business intelligence tool for e-commerce analytics.
Installation
npm install -g @optima-chat/bi-cliAuthentication
bi-cli uses unified authentication via ~/.optima/token.json, shared with commerce-cli and optima-agent.
Login
# Login to production (default)
bi-cli auth login
# Login to stage environment
bi-cli auth login --env stage
# Login to development environment
bi-cli auth login --env developmentCheck Status
# Show current user
bi-cli auth whoami
# Show authentication status
bi-cli auth status
# Logout
bi-cli auth logoutEnvironment Configuration
| Environment | Auth URL | Backend URL |
|---|---|---|
| production | auth.optima.onl | bi-api.optima.onl |
| stage | auth.stage.optima.onl | bi-api.stage.optima.onl |
| development | auth.optima.chat | bi-api.optima.chat |
Token Priority
BI_CLI_TOKENenvironment variableOPTIMA_TOKENenvironment variable~/.optima/token.jsonfile
Environment Variables
# Override token
export BI_CLI_TOKEN="your-access-token"
# Override URLs
export BI_CLI_BACKEND_URL="https://custom-api.example.com"
export BI_CLI_AUTH_URL="https://custom-auth.example.com"
# Override environment
export BI_CLI_ENV="stage"Commands
Sales Analytics
# Get sales data
bi-cli sales get
bi-cli sales get --days 30Product Analytics
# Best selling products
bi-cli product best-sellers
bi-cli product best-sellers --limit 10
# ABC inventory analysis
bi-cli product abc-analysis
# Price point analysis
bi-cli product price-analysis
# Product performance
bi-cli product performanceTrend Analytics
# Revenue trends
bi-cli trends revenue
bi-cli trends revenue --days 30
# Orders heatmap
bi-cli trends heatmap
# Seasonal patterns
bi-cli trends seasonality
# Revenue forecast
bi-cli trends forecastAdvanced Analytics
# Compare periods
bi-cli analytics compare
bi-cli analytics compare --days 30
# Growth trends
bi-cli analytics growth
# Customer cohort analysis
bi-cli analytics cohort
# Order funnel analysis
bi-cli analytics funnelJSON Output
All commands output JSON by default, making it easy to integrate with AI agents and other tools.
# Pipe to jq for formatting
bi-cli sales get | jq .
# Use with AI agents
bi-cli product best-sellers --limit 5 | your-ai-toolLicense
MIT