JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 331
  • Score
    100M100P100Q84996F

Optima BI CLI - AI-friendly business intelligence tool

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-cli

Authentication

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 development

Check Status

# Show current user
bi-cli auth whoami

# Show authentication status
bi-cli auth status

# Logout
bi-cli auth logout

Environment 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

  1. BI_CLI_TOKEN environment variable
  2. OPTIMA_TOKEN environment variable
  3. ~/.optima/token.json file

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 30

Product 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 performance

Trend 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 forecast

Advanced 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 funnel

JSON 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-tool

License

MIT