@optima-chat/scout-cli 0.1.5 → 0.1.7

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.
package/README.md CHANGED
@@ -1,274 +1,96 @@
1
1
  # Optima Scout CLI
2
2
 
3
- Command-line interface for Optima Scout - AI-powered Amazon product research tool.
4
-
5
- **Designed for LLM consumption** - optimized for Claude Code and other AI assistants.
6
-
7
- ## Features
8
-
9
- - **JSON Output**: Default structured JSON output for easy LLM parsing
10
- - **Non-Interactive**: No spinners, prompts, or colored output by default
11
- - **Simple Text Mode**: Optional plain text format for human readability
12
- - **Fast**: Leverages backend caching for quick responses
13
-
14
- ## Prerequisites
15
-
16
- - Node.js >= 20.0.0
17
- - Optima Scout API running (default: `http://localhost:3000`)
3
+ AI-powered Amazon product research tool for Claude Code and LLMs.
18
4
 
19
5
  ## Installation
20
6
 
21
- ### From Source
22
-
23
7
  ```bash
24
- # Install dependencies
25
- npm install
26
-
27
- # Run in development mode
28
- npm run dev <command>
29
-
30
- # Or build and use globally
31
- npm run build
32
- npm link
33
- scout <command>
8
+ npm install -g @optima-chat/scout-cli
34
9
  ```
35
10
 
36
- ## Usage
37
-
38
- ### Initialize Claude Code Skills
39
-
40
- Initialize Optima Scout Skills in your project for Claude Code integration:
11
+ ## Quick Start
41
12
 
42
13
  ```bash
14
+ # Initialize Claude Code skills
43
15
  scout init
44
- ```
45
-
46
- This creates `.claude/skills/` directory with `search.json` and `product.json` configurations.
47
-
48
- **Options:**
49
- - `-f, --force` - Overwrite existing skills
50
16
 
51
- **Example:**
52
- ```bash
53
- # First time setup
54
- cd your-project
55
- scout init
17
+ # Search products
18
+ scout search "coffee maker"
56
19
 
57
- # Update skills configuration
58
- scout init --force
20
+ # Get product details
21
+ scout product B01GJOMWVA
59
22
  ```
60
23
 
61
- After initialization, you can use Optima Scout in Claude Code:
62
- ```
63
- 帮我搜索一下 "wireless mouse"
64
- ```
24
+ ## Commands
65
25
 
66
- ---
26
+ ### `scout init`
67
27
 
68
- ### Search Products
28
+ Initialize Optima Scout skills for Claude Code.
69
29
 
70
- Search for products on Amazon with JSON output (default):
30
+ **Options:**
31
+ - `-f, --force` - Overwrite existing skills
71
32
 
72
- ```bash
73
- scout search "coffee maker"
74
- ```
33
+ ### `scout search <query>`
75
34
 
76
- **Output (JSON)**:
77
- ```json
78
- {
79
- "results": [
80
- {
81
- "position": 1,
82
- "title": "BLACK+DECKER 12-Cup Digital Coffee Maker...",
83
- "asin": "B01GJOMWVA",
84
- "price": { "value": 40.99, "currency": "USD" },
85
- "rating": 4.4,
86
- "ratings_total": 46754,
87
- "recent_sales": "10K+ bought in past month"
88
- }
89
- ],
90
- "metadata": {
91
- "total_results": 48,
92
- "shown_results": 10,
93
- "cached": false,
94
- "credits_remaining": 89
95
- }
96
- }
97
- ```
35
+ Search Amazon products with structured JSON output.
98
36
 
99
37
  **Options:**
100
38
  - `-d, --domain <domain>` - Amazon domain (default: `amazon.com`)
101
- - `-l, --limit <number>` - Limit results (default: `10`)
102
- - `-f, --format <format>` - Output format: `json` (default) or `text`
103
-
104
- **Examples:**
39
+ - `-l, --limit <number>` - Result limit (default: `10`)
40
+ - `-f, --format <format>` - Output: `json` | `text`
105
41
 
42
+ **Example:**
106
43
  ```bash
107
- # JSON output (default) - for LLMs
108
- scout search "coffee maker" --limit 5
109
-
110
- # Text output - for humans
111
- scout search "coffee maker" --limit 5 --format text
44
+ scout search "wireless mouse" --limit 5 --format json
112
45
  ```
113
46
 
114
- **Text Output**:
115
- ```
116
- B01GJOMWVA BLACK+DECKER 12-Cup Digital Coffee Maker... 40.99 4.4 46754 10K+ bought in past month
117
- B0C8B9V7HR BLACK+DECKER 12-Cup Coffee Maker... 28.67 4.3 18851 20K+ bought in past month
118
- ```
119
-
120
- ### Get Product Details
47
+ ### `scout product <asin>`
121
48
 
122
- Get detailed information about a specific product (JSON by default):
123
-
124
- ```bash
125
- scout product B01GJOMWVA
126
- ```
127
-
128
- **Output (JSON)**:
129
- ```json
130
- {
131
- "product": {
132
- "asin": "B01GJOMWVA",
133
- "title": "BLACK+DECKER 12-Cup Digital Coffee Maker...",
134
- "brand": "BLACK+DECKER",
135
- "buybox_winner": {
136
- "price": { "value": 40.99, "currency": "USD" },
137
- "new_offers_count": 2
138
- },
139
- "recent_sales": "10K+ bought in past month",
140
- "rating": 4.4,
141
- "ratings_total": 46754,
142
- "rating_breakdown": {
143
- "five_star": { "percentage": 70, "count": 32727 },
144
- "one_star": { "percentage": 7, "count": 3272 }
145
- },
146
- "top_reviews": [ /* array of reviews */ ],
147
- "specifications": [ /* array of specs including BSR */ ]
148
- },
149
- "metadata": {
150
- "cached": true,
151
- "credits_remaining": 90
152
- }
153
- }
154
- ```
49
+ Get detailed product information.
155
50
 
156
51
  **Options:**
157
52
  - `-d, --domain <domain>` - Amazon domain (default: `amazon.com`)
158
- - `-f, --format <format>` - Output format: `json` (default) or `text`
53
+ - `-f, --format <format>` - Output: `json` | `text`
159
54
 
160
- **Text Output**:
161
- ```
162
- ASIN: B01GJOMWVA
163
- Title: BLACK+DECKER 12-Cup Digital Coffee Maker...
164
- Brand: BLACK+DECKER
165
- Price: $40.99
166
- Sellers: 2
167
- Recent Sales: 10K+ bought in past month
168
- Rating: 4.4
169
- Reviews: 46754
170
- BSR: #530 in Home & Kitchen #2 in Coffee Machines
55
+ **Example:**
56
+ ```bash
57
+ scout product B004YAVF8I --domain amazon.com
171
58
  ```
172
59
 
173
60
  ## Configuration
174
61
 
175
- Create a `.env` file:
62
+ Set API endpoint via environment variable:
176
63
 
177
64
  ```bash
178
- cp .env.example .env
65
+ export API_URL=http://dev.optima.sh:3000
179
66
  ```
180
67
 
181
- Edit `.env`:
68
+ Or create `.env` file:
182
69
 
183
70
  ```env
184
71
  API_URL=http://localhost:3000
185
72
  ```
186
73
 
187
- ## LLM Integration
188
-
189
- This CLI is designed for Claude Code and other LLM tools:
190
-
191
- ### Key Features for LLMs
192
-
193
- 1. **Structured JSON Output**: All data returned in parseable JSON by default
194
- 2. **No Interactive Elements**: No spinners, colors, or prompts
195
- 3. **Complete Data**: Full product information in single response
196
- 4. **Error Handling**: Errors also returned as JSON
197
-
198
- ### Example LLM Usage
74
+ ## Features
199
75
 
200
- ```typescript
201
- // Claude Code can call:
202
- const result = await exec('scout search "coffee maker" --limit 5');
203
- const data = JSON.parse(result);
204
-
205
- // Access structured data
206
- data.results.forEach(product => {
207
- console.log(product.asin, product.title, product.recent_sales);
208
- });
209
- ```
76
+ - **JSON-first**: Structured output optimized for LLM parsing
77
+ - **Non-interactive**: No spinners, prompts, or colors
78
+ - **Fast**: Backend caching for quick responses
79
+ - **Claude Code integration**: Auto-discovery via skills
210
80
 
211
81
  ## Development
212
82
 
213
- ### Project Structure
214
-
215
- ```
216
- cli/
217
- ├── src/
218
- │ ├── commands/ # CLI commands
219
- │ │ ├── search.ts # Search command
220
- │ │ └── product.ts # Product command
221
- │ ├── types/ # TypeScript types
222
- │ │ └── api.ts # API response types
223
- │ ├── utils/ # Utilities
224
- │ │ ├── api.ts # API client
225
- │ │ └── config.ts # Configuration
226
- │ └── index.ts # Entry point
227
- ├── package.json
228
- └── tsconfig.json
229
- ```
230
-
231
- ### Scripts
232
-
233
83
  ```bash
234
- # Development mode
235
- npm run dev <command>
84
+ # Install dependencies
85
+ npm install
236
86
 
237
- # Build TypeScript
87
+ # Build
238
88
  npm run build
239
89
 
240
- # Type checking
241
- npm run type-check
242
-
243
- # Lint code
244
- npm run lint
90
+ # Link locally
91
+ npm link
245
92
  ```
246
93
 
247
- ## Output Formats
248
-
249
- ### JSON Format (Default)
250
-
251
- - **Purpose**: LLM consumption
252
- - **Benefits**:
253
- - Easy to parse programmatically
254
- - Complete data structure
255
- - No formatting noise
256
- - Metadata included (caching, credits)
257
-
258
- ### Text Format
259
-
260
- - **Purpose**: Human readability
261
- - **Benefits**:
262
- - Quick visual scanning
263
- - Tab-separated values (easy to parse)
264
- - Minimal but informative
265
-
266
- ## Tech Stack
267
-
268
- - **Commander.js** - CLI framework
269
- - **TypeScript** - Type safety
270
- - **Minimal Dependencies** - Only essential packages
271
-
272
94
  ## License
273
95
 
274
96
  MIT
package/dist/index.js CHANGED
@@ -1,13 +1,16 @@
1
1
  #!/usr/bin/env node
2
+ import { createRequire } from 'module';
2
3
  import { Command } from 'commander';
3
4
  import { searchCommand } from './commands/search.js';
4
5
  import { productCommand } from './commands/product.js';
5
6
  import { initCommand } from './commands/init.js';
7
+ const require = createRequire(import.meta.url);
8
+ const packageJson = require('../package.json');
6
9
  const program = new Command();
7
10
  program
8
11
  .name('scout')
9
12
  .description('Optima Scout - AI-powered Amazon product research tool')
10
- .version('0.1.0');
13
+ .version(packageJson.version);
11
14
  // Register commands
12
15
  program.addCommand(initCommand);
13
16
  program.addCommand(searchCommand);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,wDAAwD,CAAC;KACrE,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,oBAAoB;AACpB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAEnC,kBAAkB;AAClB,OAAO,CAAC,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAE/C,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,wDAAwD,CAAC;KACrE,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;AAEhC,oBAAoB;AACpB,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC;AAClC,OAAO,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC;AAEnC,kBAAkB;AAClB,OAAO,CAAC,KAAK,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optima-chat/scout-cli",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "AI-powered Amazon product research CLI tool - Search products and get detailed analytics",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",