@optima-chat/bi-cli 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +144 -0
  2. package/package.json +1 -2
package/README.md ADDED
@@ -0,0 +1,144 @@
1
+ # @optima-chat/bi-cli
2
+
3
+ Optima BI CLI - AI-friendly business intelligence tool for e-commerce analytics.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @optima-chat/bi-cli
9
+ ```
10
+
11
+ ## Authentication
12
+
13
+ bi-cli uses unified authentication via `~/.optima/token.json`, shared with `commerce-cli` and `optima-agent`.
14
+
15
+ ### Login
16
+
17
+ ```bash
18
+ # Login to production (default)
19
+ bi-cli auth login
20
+
21
+ # Login to stage environment
22
+ bi-cli auth login --env stage
23
+
24
+ # Login to development environment
25
+ bi-cli auth login --env development
26
+ ```
27
+
28
+ ### Check Status
29
+
30
+ ```bash
31
+ # Show current user
32
+ bi-cli auth whoami
33
+
34
+ # Show authentication status
35
+ bi-cli auth status
36
+
37
+ # Logout
38
+ bi-cli auth logout
39
+ ```
40
+
41
+ ### Environment Configuration
42
+
43
+ | Environment | Auth URL | Backend URL |
44
+ |-------------|----------|-------------|
45
+ | production | auth.optima.onl | bi-api.optima.onl |
46
+ | stage | auth.stage.optima.onl | bi-api.stage.optima.onl |
47
+ | development | auth.optima.chat | bi-api.optima.chat |
48
+
49
+ ### Token Priority
50
+
51
+ 1. `BI_CLI_TOKEN` environment variable
52
+ 2. `OPTIMA_TOKEN` environment variable
53
+ 3. `~/.optima/token.json` file
54
+
55
+ ### Environment Variables
56
+
57
+ ```bash
58
+ # Override token
59
+ export BI_CLI_TOKEN="your-access-token"
60
+
61
+ # Override URLs
62
+ export BI_CLI_BACKEND_URL="https://custom-api.example.com"
63
+ export BI_CLI_AUTH_URL="https://custom-auth.example.com"
64
+
65
+ # Override environment
66
+ export BI_CLI_ENV="stage"
67
+ ```
68
+
69
+ ## Commands
70
+
71
+ ### Sales Analytics
72
+
73
+ ```bash
74
+ # Get sales data
75
+ bi-cli sales get
76
+ bi-cli sales get --days 30
77
+ ```
78
+
79
+ ### Product Analytics
80
+
81
+ ```bash
82
+ # Best selling products
83
+ bi-cli product best-sellers
84
+ bi-cli product best-sellers --limit 10
85
+
86
+ # ABC inventory analysis
87
+ bi-cli product abc-analysis
88
+
89
+ # Price point analysis
90
+ bi-cli product price-analysis
91
+
92
+ # Product performance
93
+ bi-cli product performance
94
+ ```
95
+
96
+ ### Trend Analytics
97
+
98
+ ```bash
99
+ # Revenue trends
100
+ bi-cli trends revenue
101
+ bi-cli trends revenue --days 30
102
+
103
+ # Orders heatmap
104
+ bi-cli trends heatmap
105
+
106
+ # Seasonal patterns
107
+ bi-cli trends seasonality
108
+
109
+ # Revenue forecast
110
+ bi-cli trends forecast
111
+ ```
112
+
113
+ ### Advanced Analytics
114
+
115
+ ```bash
116
+ # Compare periods
117
+ bi-cli analytics compare
118
+ bi-cli analytics compare --days 30
119
+
120
+ # Growth trends
121
+ bi-cli analytics growth
122
+
123
+ # Customer cohort analysis
124
+ bi-cli analytics cohort
125
+
126
+ # Order funnel analysis
127
+ bi-cli analytics funnel
128
+ ```
129
+
130
+ ## JSON Output
131
+
132
+ All commands output JSON by default, making it easy to integrate with AI agents and other tools.
133
+
134
+ ```bash
135
+ # Pipe to jq for formatting
136
+ bi-cli sales get | jq .
137
+
138
+ # Use with AI agents
139
+ bi-cli product best-sellers --limit 5 | your-ai-tool
140
+ ```
141
+
142
+ ## License
143
+
144
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optima-chat/bi-cli",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "type": "module",
5
5
  "description": "Optima BI CLI - AI-friendly business intelligence tool",
6
6
  "main": "dist/index.js",
@@ -19,7 +19,6 @@
19
19
  "axios": "^1.6.5",
20
20
  "chalk": "^4.1.2",
21
21
  "commander": "^11.1.0",
22
- "conf": "^12.0.0",
23
22
  "open": "^8.4.2",
24
23
  "ora": "^5.4.1",
25
24
  "table": "^6.8.1"