r3plica 1.0.2 → 1.2.1
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 +188 -173
- package/dist/cli/commands/product.js +46 -1
- package/dist/cli/commands/product.js.map +1 -1
- package/dist/core/api.d.ts +4 -0
- package/dist/core/api.js +59 -21
- package/dist/core/api.js.map +1 -1
- package/dist/core/formatter.d.ts +12 -0
- package/dist/core/formatter.js +109 -0
- package/dist/core/formatter.js.map +1 -1
- package/package.json +37 -37
package/README.md
CHANGED
|
@@ -1,173 +1,188 @@
|
|
|
1
|
-
# r3 — R3PLICA CLI
|
|
2
|
-
|
|
3
|
-
Query the R3PLICA digital replicas catalog from your terminal. Search products, brands, collections, and finishes — built for AI agents, developers, and scripts.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install -g r3plica
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Requires Node.js 20+.
|
|
12
|
-
|
|
13
|
-
## Quick Start
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
# Search products
|
|
17
|
-
r3 product search "dining table"
|
|
18
|
-
|
|
19
|
-
# List brands
|
|
20
|
-
r3 brand list
|
|
21
|
-
|
|
22
|
-
# Filter by brand and category
|
|
23
|
-
r3 product list --brand "Cattelan Italia" --category table
|
|
24
|
-
|
|
25
|
-
# Get product details
|
|
26
|
-
r3 product get <mongo_id>
|
|
27
|
-
|
|
28
|
-
# Pipe to jq
|
|
29
|
-
r3 product list --limit 5 --json | jq '.[].name'
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Commands
|
|
33
|
-
|
|
34
|
-
### Products
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
r3 product list [--brand X] [--category X] [--collection X] [--limit N] [--page N]
|
|
38
|
-
r3 product search <query> [--brand X] [--category X] [--limit N]
|
|
39
|
-
r3 product get <mongo_id>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
Product
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
Finish
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
r3 finish-collection
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
- `r3 product
|
|
115
|
-
- `r3 brand
|
|
116
|
-
- `r3
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
1
|
+
# r3 — R3PLICA CLI
|
|
2
|
+
|
|
3
|
+
Query the R3PLICA digital replicas catalog from your terminal. Search products, brands, collections, and finishes — built for AI agents, developers, and scripts.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g r3plica
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires Node.js 20+.
|
|
12
|
+
|
|
13
|
+
## Quick Start
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Search products
|
|
17
|
+
r3 product search "dining table"
|
|
18
|
+
|
|
19
|
+
# List brands
|
|
20
|
+
r3 brand list
|
|
21
|
+
|
|
22
|
+
# Filter by brand and category
|
|
23
|
+
r3 product list --brand "Cattelan Italia" --category table
|
|
24
|
+
|
|
25
|
+
# Get product details
|
|
26
|
+
r3 product get <mongo_id>
|
|
27
|
+
|
|
28
|
+
# Pipe to jq
|
|
29
|
+
r3 product list --limit 5 --json | jq '.[].name'
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Commands
|
|
33
|
+
|
|
34
|
+
### Products
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
r3 product list [--brand X] [--category X] [--collection X] [--designer X] [--year X] [--limit N] [--page N]
|
|
38
|
+
r3 product search <query> [--brand X] [--category X] [--designer X] [--year X] [--limit N]
|
|
39
|
+
r3 product get <mongo_id>
|
|
40
|
+
r3 product stats [--by category|brand|designer|year] [--brand X]
|
|
41
|
+
r3 product compare <id1> <id2>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Brands
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
r3 brand list [--country X] [--limit N]
|
|
48
|
+
r3 brand search <query>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Product Collections
|
|
52
|
+
|
|
53
|
+
Product collections are furniture lines from a brand (e.g., "Tudor" by Cattelan Italia).
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
r3 product-collection list [--brand X] [--limit N] [--page N] [--sort X] [--order asc|desc]
|
|
57
|
+
r3 product-collection search <query>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Finish Collections
|
|
61
|
+
|
|
62
|
+
Finish collections are sets of material finishes (shaders) — wood types, fabrics, metals, leathers — that can be applied to product parts.
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
r3 finish-collection list [--brand X] [--category X] [--limit N] [--page N]
|
|
66
|
+
r3 finish-collection search <query>
|
|
67
|
+
r3 finish-collection get <mongo_id>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Configuration
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
r3 config show
|
|
74
|
+
r3 config set api-url <url>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Default API URL: `https://api.r3plica.space/api/r3vault`. Override with `R3_API_URL` environment variable or `r3 config set`.
|
|
78
|
+
|
|
79
|
+
## Output
|
|
80
|
+
|
|
81
|
+
- **Terminal**: formatted table with headers and result count
|
|
82
|
+
- **Piped**: JSON (automatic detection)
|
|
83
|
+
- `--json`: force JSON output
|
|
84
|
+
- `--pretty`: force table output
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
# Table output (terminal)
|
|
88
|
+
$ r3 brand list --limit 3
|
|
89
|
+
|
|
90
|
+
ID Name Country Products
|
|
91
|
+
0a497f00-cc6f-4 Driade Italy 29
|
|
92
|
+
22b4a540-bcf2-4 We Are IB Italy 37
|
|
93
|
+
ab368a13-6038-4 Emu Italy 26
|
|
94
|
+
|
|
95
|
+
3 brands found
|
|
96
|
+
|
|
97
|
+
# JSON output (piped or --json)
|
|
98
|
+
$ r3 brand list --limit 1 --json | jq '.[0].name'
|
|
99
|
+
"Driade"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Use with AI Agents
|
|
103
|
+
|
|
104
|
+
### Claude Code / CLAUDE.md
|
|
105
|
+
|
|
106
|
+
Add to your project's `CLAUDE.md`:
|
|
107
|
+
|
|
108
|
+
```markdown
|
|
109
|
+
## R3PLICA Catalog
|
|
110
|
+
|
|
111
|
+
The `r3` CLI queries the R3PLICA digital replicas catalog. Use it when the user
|
|
112
|
+
asks about furniture, finishes, brands, or design products.
|
|
113
|
+
|
|
114
|
+
- `r3 product search "query"` — search products by text
|
|
115
|
+
- `r3 product list --brand X --category X` — filter products
|
|
116
|
+
- `r3 product list --designer "Name"` — filter by designer
|
|
117
|
+
- `r3 product get <id>` — product details with finish options
|
|
118
|
+
- `r3 product stats --by brand` — catalog breakdown
|
|
119
|
+
- `r3 product compare <id1> <id2>` — side-by-side comparison
|
|
120
|
+
- `r3 brand list` — all available brands
|
|
121
|
+
- `r3 finish-collection list --brand X` — available finish collections
|
|
122
|
+
- Always use `--json` when processing results programmatically
|
|
123
|
+
- Run `r3 --help` for full command reference
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### MCP Server
|
|
127
|
+
|
|
128
|
+
The package also includes an MCP server for auto-discovery in Claude Desktop, Cursor, and similar IDEs.
|
|
129
|
+
|
|
130
|
+
Add to your Claude Desktop config (`claude_desktop_config.json`):
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"mcpServers": {
|
|
135
|
+
"r3plica": {
|
|
136
|
+
"command": "r3-mcp"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The MCP server exposes the same data through 10 tools: `product_list`, `product_search`, `product_get`, `brand_list`, `brand_search`, `product_collection_list`, `product_collection_search`, `finish_collection_list`, `finish_collection_search`, `finish_collection_get`.
|
|
143
|
+
|
|
144
|
+
## Examples
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
# Find Italian brands
|
|
148
|
+
r3 brand list --country Italy
|
|
149
|
+
|
|
150
|
+
# Search chairs, limit to 5 results
|
|
151
|
+
r3 product search "chair" --limit 5
|
|
152
|
+
|
|
153
|
+
# Get all products from a brand
|
|
154
|
+
r3 product list --brand "Driade"
|
|
155
|
+
|
|
156
|
+
# Explore a product collection
|
|
157
|
+
r3 product-collection search "Tudor"
|
|
158
|
+
|
|
159
|
+
# Find products by designer
|
|
160
|
+
r3 product list --designer "Philippe Starck"
|
|
161
|
+
|
|
162
|
+
# Catalog stats
|
|
163
|
+
r3 product stats --by brand
|
|
164
|
+
r3 product stats --brand "Driade" --by designer
|
|
165
|
+
|
|
166
|
+
# Compare two products
|
|
167
|
+
r3 product compare <id1> <id2>
|
|
168
|
+
|
|
169
|
+
# Find wood finishes
|
|
170
|
+
r3 finish-collection list --category wood
|
|
171
|
+
|
|
172
|
+
# Script: get all brand names
|
|
173
|
+
r3 brand list --json | jq -r '.[].name'
|
|
174
|
+
|
|
175
|
+
# Script: count products per brand
|
|
176
|
+
r3 brand list --json | jq -r '.[].name' | while read brand; do
|
|
177
|
+
count=$(r3 product list --brand "$brand" --json 2>/dev/null | jq length)
|
|
178
|
+
echo "$brand: $count"
|
|
179
|
+
done
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## About R3PLICA
|
|
183
|
+
|
|
184
|
+
[R3PLICA](https://r3plica.space) provides certified digital replicas of branded furniture, finishes, and materials to architects, interior designers, and visualization professionals. The catalog includes 60+ premium partner brands including Cattelan Italia, Driade, Poliform, and more.
|
|
185
|
+
|
|
186
|
+
## License
|
|
187
|
+
|
|
188
|
+
Proprietary - R3PLICA S.r.l.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { listProducts, searchProducts, getProduct } from "../../core/api.js";
|
|
2
|
-
import { output, outputDetail } from "../../core/formatter.js";
|
|
2
|
+
import { output, outputDetail, outputStats, outputCompare } from "../../core/formatter.js";
|
|
3
3
|
import { handleError } from "../../core/errors.js";
|
|
4
4
|
const PRODUCT_COLUMNS = [
|
|
5
5
|
{ key: "mongo_id", header: "ID", width: 16 },
|
|
@@ -15,6 +15,8 @@ export function registerProductCommands(program) {
|
|
|
15
15
|
.option("--brand <name>", "Filter by brand name")
|
|
16
16
|
.option("--category <category>", "Filter by product category")
|
|
17
17
|
.option("--collection <name>", "Filter by collection name")
|
|
18
|
+
.option("--designer <name>", "Filter by designer name")
|
|
19
|
+
.option("--year <year>", "Filter by year")
|
|
18
20
|
.option("--limit <n>", "Max results", "20")
|
|
19
21
|
.option("--page <n>", "Page number", "1")
|
|
20
22
|
.action(async (opts) => {
|
|
@@ -23,6 +25,8 @@ export function registerProductCommands(program) {
|
|
|
23
25
|
brand: opts.brand,
|
|
24
26
|
category: opts.category,
|
|
25
27
|
collection: opts.collection,
|
|
28
|
+
designer: opts.designer,
|
|
29
|
+
year: opts.year,
|
|
26
30
|
limit: parseInt(opts.limit),
|
|
27
31
|
page: parseInt(opts.page),
|
|
28
32
|
});
|
|
@@ -42,12 +46,16 @@ export function registerProductCommands(program) {
|
|
|
42
46
|
.description("Search products by text")
|
|
43
47
|
.option("--brand <name>", "Filter by brand name")
|
|
44
48
|
.option("--category <category>", "Filter by product category")
|
|
49
|
+
.option("--designer <name>", "Filter by designer name")
|
|
50
|
+
.option("--year <year>", "Filter by year")
|
|
45
51
|
.option("--limit <n>", "Max results", "20")
|
|
46
52
|
.action(async (query, opts) => {
|
|
47
53
|
try {
|
|
48
54
|
const results = await searchProducts(query, {
|
|
49
55
|
brand: opts.brand,
|
|
50
56
|
category: opts.category,
|
|
57
|
+
designer: opts.designer,
|
|
58
|
+
year: opts.year,
|
|
51
59
|
limit: parseInt(opts.limit),
|
|
52
60
|
});
|
|
53
61
|
output(results, {
|
|
@@ -77,5 +85,42 @@ export function registerProductCommands(program) {
|
|
|
77
85
|
handleError(error);
|
|
78
86
|
}
|
|
79
87
|
});
|
|
88
|
+
product
|
|
89
|
+
.command("stats")
|
|
90
|
+
.description("Show catalog statistics (products by category, brand, designer)")
|
|
91
|
+
.option("--brand <name>", "Stats for a specific brand only")
|
|
92
|
+
.option("--by <field>", "Group by: category, brand, designer, year", "category")
|
|
93
|
+
.action(async (opts) => {
|
|
94
|
+
try {
|
|
95
|
+
const results = await listProducts({
|
|
96
|
+
brand: opts.brand,
|
|
97
|
+
limit: 9999,
|
|
98
|
+
});
|
|
99
|
+
outputStats(results, {
|
|
100
|
+
json: program.opts().json,
|
|
101
|
+
pretty: program.opts().pretty,
|
|
102
|
+
groupBy: opts.by,
|
|
103
|
+
brandFilter: opts.brand,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
handleError(error);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
product
|
|
111
|
+
.command("compare <id1> <id2>")
|
|
112
|
+
.description("Compare two products side by side")
|
|
113
|
+
.action(async (id1, id2) => {
|
|
114
|
+
try {
|
|
115
|
+
const [p1, p2] = await Promise.all([getProduct(id1), getProduct(id2)]);
|
|
116
|
+
outputCompare(p1, p2, {
|
|
117
|
+
json: program.opts().json,
|
|
118
|
+
pretty: program.opts().pretty,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
handleError(error);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
80
125
|
}
|
|
81
126
|
//# sourceMappingURL=product.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.js","sourceRoot":"","sources":["../../../src/cli/commands/product.ts"],"names":[],"mappings":"AACA,OA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
CHANGED
|
@@ -6,12 +6,16 @@ export declare function listProducts(opts: {
|
|
|
6
6
|
brand?: string;
|
|
7
7
|
category?: string;
|
|
8
8
|
collection?: string;
|
|
9
|
+
designer?: string;
|
|
10
|
+
year?: string;
|
|
9
11
|
limit?: number;
|
|
10
12
|
page?: number;
|
|
11
13
|
}): Promise<any[]>;
|
|
12
14
|
export declare function searchProducts(query: string, opts: {
|
|
13
15
|
brand?: string;
|
|
14
16
|
category?: string;
|
|
17
|
+
designer?: string;
|
|
18
|
+
year?: string;
|
|
15
19
|
limit?: number;
|
|
16
20
|
}): Promise<any[]>;
|
|
17
21
|
export declare function getProduct(mongoId: string): Promise<any>;
|
package/dist/core/api.js
CHANGED
|
@@ -56,30 +56,68 @@ function buildQuery(filters) {
|
|
|
56
56
|
.join(";");
|
|
57
57
|
}
|
|
58
58
|
// ── Products ──────────────────────────────────────────────
|
|
59
|
+
// NOTE: The backend /products endpoint only allows mongo_id filtering server-side.
|
|
60
|
+
// All other filters (brand, category, collection, designer, year) are applied client-side.
|
|
61
|
+
// The full product list (~600 items) is fetched once and cached per CLI invocation.
|
|
62
|
+
let _productsCache;
|
|
63
|
+
async function fetchAllProducts() {
|
|
64
|
+
if (_productsCache)
|
|
65
|
+
return _productsCache;
|
|
66
|
+
const data = await request("products", { limit: "9999" });
|
|
67
|
+
const products = data.products || [];
|
|
68
|
+
_productsCache = products;
|
|
69
|
+
return products;
|
|
70
|
+
}
|
|
71
|
+
/** Apply client-side filters */
|
|
72
|
+
function filterProducts(products, opts) {
|
|
73
|
+
let result = products;
|
|
74
|
+
if (opts.brand) {
|
|
75
|
+
const b = opts.brand.toLowerCase();
|
|
76
|
+
result = result.filter((p) => p.brand?.some((br) => br.name?.toLowerCase().includes(b)));
|
|
77
|
+
}
|
|
78
|
+
if (opts.category) {
|
|
79
|
+
const c = opts.category.toLowerCase();
|
|
80
|
+
result = result.filter((p) => p.category?.toLowerCase().includes(c));
|
|
81
|
+
}
|
|
82
|
+
if (opts.collection) {
|
|
83
|
+
const col = opts.collection.toLowerCase();
|
|
84
|
+
result = result.filter((p) => p.collection?.toLowerCase().includes(col));
|
|
85
|
+
}
|
|
86
|
+
if (opts.designer) {
|
|
87
|
+
const d = opts.designer.toLowerCase();
|
|
88
|
+
result = result.filter((p) => p.designed_by?.some((db) => db.name?.toLowerCase().includes(d)));
|
|
89
|
+
}
|
|
90
|
+
if (opts.year) {
|
|
91
|
+
result = result.filter((p) => p.year === opts.year);
|
|
92
|
+
}
|
|
93
|
+
return result;
|
|
94
|
+
}
|
|
59
95
|
export async function listProducts(opts) {
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
96
|
+
const hasFilter = !!(opts.brand || opts.category || opts.collection || opts.designer || opts.year);
|
|
97
|
+
if (!hasFilter) {
|
|
98
|
+
// No filters — use server pagination directly
|
|
99
|
+
const data = await request("products", {
|
|
100
|
+
page: String(opts.page || 1),
|
|
101
|
+
limit: String(opts.limit || 20),
|
|
102
|
+
});
|
|
103
|
+
return data.products || [];
|
|
104
|
+
}
|
|
105
|
+
// Filters active — fetch all, filter client-side, paginate
|
|
106
|
+
const all = await fetchAllProducts();
|
|
107
|
+
let products = filterProducts(all, opts);
|
|
108
|
+
const page = opts.page || 1;
|
|
109
|
+
const limit = opts.limit || 20;
|
|
110
|
+
const start = (page - 1) * limit;
|
|
111
|
+
return products.slice(start, start + limit);
|
|
71
112
|
}
|
|
72
113
|
export async function searchProducts(query, opts) {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
limit: String(opts.limit || 20),
|
|
81
|
-
});
|
|
82
|
-
return data.products || [];
|
|
114
|
+
const all = await fetchAllProducts();
|
|
115
|
+
const q = query.toLowerCase();
|
|
116
|
+
let products = all.filter((p) => p.name?.toLowerCase().includes(q) ||
|
|
117
|
+
p.asset_name?.toLowerCase().includes(q) ||
|
|
118
|
+
p.description?.toLowerCase().includes(q));
|
|
119
|
+
products = filterProducts(products, opts);
|
|
120
|
+
return products.slice(0, opts.limit || 20);
|
|
83
121
|
}
|
|
84
122
|
export async function getProduct(mongoId) {
|
|
85
123
|
const data = await request("products", {
|
package/dist/core/api.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/core/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B,MAAM,OAAO,QAAS,SAAQ,KAAK;IAGxB;IAFT,YACE,OAAe,EACR,UAAmB;QAE1B,KAAK,CAAC,OAAO,CAAC,CAAC;QAFR,eAAU,GAAV,UAAU,CAAS;QAG1B,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AAED,KAAK,UAAU,OAAO,CAAC,IAAY,EAAE,SAAiC,EAAE;IACtE,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC;IAC5B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,GAAG,GAAG,CAAC,CAAC;IAE3E,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,IAAI,KAAK;YAAE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;IACzC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,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,OAAO,CAAC,oBAAoB,EAAE;QAC/C,CAAC,EAAE,YAAY,OAAO,EAAE;QACxB,KAAK,EAAE,GAAG;KACX,CAAC,CAAC;IACH,MAAM,WAAW,GAAG,IAAI,CAAC,kBAAkB,IAAI,EAAE,CAAC;IAClD,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,QAAQ,CAAC,sBAAsB,OAAO,aAAa,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;AACxB,CAAC"}
|
package/dist/core/formatter.d.ts
CHANGED
|
@@ -15,4 +15,16 @@ export declare function outputDetail(data: any, opts: {
|
|
|
15
15
|
json?: boolean;
|
|
16
16
|
pretty?: boolean;
|
|
17
17
|
}): void;
|
|
18
|
+
/** Output catalog statistics grouped by a field */
|
|
19
|
+
export declare function outputStats(data: any[], opts: {
|
|
20
|
+
json?: boolean;
|
|
21
|
+
pretty?: boolean;
|
|
22
|
+
groupBy: string;
|
|
23
|
+
brandFilter?: string;
|
|
24
|
+
}): void;
|
|
25
|
+
/** Output a side-by-side comparison of two products */
|
|
26
|
+
export declare function outputCompare(p1: any, p2: any, opts: {
|
|
27
|
+
json?: boolean;
|
|
28
|
+
pretty?: boolean;
|
|
29
|
+
}): void;
|
|
18
30
|
export {};
|
package/dist/core/formatter.js
CHANGED
|
@@ -67,6 +67,115 @@ export function outputDetail(data, opts) {
|
|
|
67
67
|
printObject(data, 0);
|
|
68
68
|
process.stdout.write("\n");
|
|
69
69
|
}
|
|
70
|
+
/** Output catalog statistics grouped by a field */
|
|
71
|
+
export function outputStats(data, opts) {
|
|
72
|
+
const items = Array.isArray(data) ? data : [];
|
|
73
|
+
// Build counts grouped by field
|
|
74
|
+
const counts = {};
|
|
75
|
+
for (const item of items) {
|
|
76
|
+
let key;
|
|
77
|
+
switch (opts.groupBy) {
|
|
78
|
+
case "brand":
|
|
79
|
+
key = item.brand?.[0]?.name || "Unknown";
|
|
80
|
+
break;
|
|
81
|
+
case "designer":
|
|
82
|
+
key = item.designed_by?.[0]?.name || "Unknown";
|
|
83
|
+
break;
|
|
84
|
+
case "year":
|
|
85
|
+
key = item.year || "Unknown";
|
|
86
|
+
break;
|
|
87
|
+
case "category":
|
|
88
|
+
default:
|
|
89
|
+
key = item.category || "Unknown";
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
counts[key] = (counts[key] || 0) + 1;
|
|
93
|
+
}
|
|
94
|
+
// Sort descending by count
|
|
95
|
+
const sorted = Object.entries(counts).sort((a, b) => b[1] - a[1]);
|
|
96
|
+
const forceJson = opts.json === true;
|
|
97
|
+
const forcePretty = opts.pretty === true;
|
|
98
|
+
const useTable = forcePretty || (!forceJson && isTTY());
|
|
99
|
+
if (!useTable) {
|
|
100
|
+
const result = {
|
|
101
|
+
total: items.length,
|
|
102
|
+
group_by: opts.groupBy,
|
|
103
|
+
...(opts.brandFilter && { brand_filter: opts.brandFilter }),
|
|
104
|
+
groups: Object.fromEntries(sorted),
|
|
105
|
+
};
|
|
106
|
+
process.stdout.write(JSON.stringify(result, null, 2) + "\n");
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const label = opts.groupBy.charAt(0).toUpperCase() + opts.groupBy.slice(1);
|
|
110
|
+
const maxKeyLen = Math.max(label.length, ...sorted.map(([k]) => k.length));
|
|
111
|
+
const colWidth = Math.min(maxKeyLen + 2, 40);
|
|
112
|
+
process.stdout.write("\n");
|
|
113
|
+
if (opts.brandFilter) {
|
|
114
|
+
process.stdout.write(` Stats for brand: ${opts.brandFilter}\n`);
|
|
115
|
+
}
|
|
116
|
+
process.stdout.write(` ${label.padEnd(colWidth)}Count\n`);
|
|
117
|
+
process.stdout.write(` ${"─".repeat(colWidth)}${"─".repeat(8)}\n`);
|
|
118
|
+
for (const [key, count] of sorted) {
|
|
119
|
+
process.stdout.write(` ${key.padEnd(colWidth)}${String(count).padStart(5)}\n`);
|
|
120
|
+
}
|
|
121
|
+
process.stdout.write(` ${"─".repeat(colWidth)}${"─".repeat(8)}\n`);
|
|
122
|
+
process.stdout.write(` ${"Total".padEnd(colWidth)}${String(items.length).padStart(5)}\n\n`);
|
|
123
|
+
}
|
|
124
|
+
/** Output a side-by-side comparison of two products */
|
|
125
|
+
export function outputCompare(p1, p2, opts) {
|
|
126
|
+
const forceJson = opts.json === true;
|
|
127
|
+
const forcePretty = opts.pretty === true;
|
|
128
|
+
const useTable = forcePretty || (!forceJson && isTTY());
|
|
129
|
+
if (!useTable) {
|
|
130
|
+
process.stdout.write(JSON.stringify({ product_1: p1, product_2: p2 }, null, 2) + "\n");
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const brand1 = p1.brand?.[0]?.name || "?";
|
|
134
|
+
const brand2 = p2.brand?.[0]?.name || "?";
|
|
135
|
+
const designer1 = p1.designed_by?.[0]?.name || "-";
|
|
136
|
+
const designer2 = p2.designed_by?.[0]?.name || "-";
|
|
137
|
+
const dims1 = p1.dimensions || {};
|
|
138
|
+
const dims2 = p2.dimensions || {};
|
|
139
|
+
const parts1 = (p1.parts || []).map((p) => p.name).join(", ");
|
|
140
|
+
const parts2 = (p2.parts || []).map((p) => p.name).join(", ");
|
|
141
|
+
const finishes1 = new Set();
|
|
142
|
+
const finishes2 = new Set();
|
|
143
|
+
for (const pt of p1.parts || []) {
|
|
144
|
+
for (const fc of pt.finish_collections || [])
|
|
145
|
+
finishes1.add(fc);
|
|
146
|
+
}
|
|
147
|
+
for (const pt of p2.parts || []) {
|
|
148
|
+
for (const fc of pt.finish_collections || [])
|
|
149
|
+
finishes2.add(fc);
|
|
150
|
+
}
|
|
151
|
+
const rows = [
|
|
152
|
+
["Name", p1.name || "?", p2.name || "?"],
|
|
153
|
+
["Brand", brand1, brand2],
|
|
154
|
+
["Category", p1.category || "?", p2.category || "?"],
|
|
155
|
+
["Collection", p1.collection || "-", p2.collection || "-"],
|
|
156
|
+
["Designer", designer1, designer2],
|
|
157
|
+
["Year", p1.year || "-", p2.year || "-"],
|
|
158
|
+
["Width (cm)", dims1.width || "?", dims2.width || "?"],
|
|
159
|
+
["Length (cm)", dims1.length || "?", dims2.length || "?"],
|
|
160
|
+
["Height (cm)", dims1.height || "?", dims2.height || "?"],
|
|
161
|
+
["Parts", parts1 || "-", parts2 || "-"],
|
|
162
|
+
["Finish options", String(finishes1.size), String(finishes2.size)],
|
|
163
|
+
["Finishes", [...finishes1].join(", ") || "-", [...finishes2].join(", ") || "-"],
|
|
164
|
+
["SKU", p1.sku || "-", p2.sku || "-"],
|
|
165
|
+
["Spec sheet", p1.spec_sheet ? "Yes" : "No", p2.spec_sheet ? "Yes" : "No"],
|
|
166
|
+
];
|
|
167
|
+
const labelWidth = 16;
|
|
168
|
+
const valWidth = 30;
|
|
169
|
+
process.stdout.write("\n");
|
|
170
|
+
process.stdout.write(` ${"".padEnd(labelWidth)}${(p1.name || "Product 1").substring(0, valWidth - 1).padEnd(valWidth)}${(p2.name || "Product 2").substring(0, valWidth - 1).padEnd(valWidth)}\n`);
|
|
171
|
+
process.stdout.write(` ${"─".repeat(labelWidth)}${"─".repeat(valWidth)}${"─".repeat(valWidth)}\n`);
|
|
172
|
+
for (const [label, v1, v2] of rows) {
|
|
173
|
+
const val1 = v1.substring(0, valWidth - 1).padEnd(valWidth);
|
|
174
|
+
const val2 = v2.substring(0, valWidth - 1).padEnd(valWidth);
|
|
175
|
+
process.stdout.write(` ${label.padEnd(labelWidth)}${val1}${val2}\n`);
|
|
176
|
+
}
|
|
177
|
+
process.stdout.write("\n");
|
|
178
|
+
}
|
|
70
179
|
function printObject(obj, indent) {
|
|
71
180
|
const pad = " ".repeat(indent + 1);
|
|
72
181
|
for (const [key, value] of Object.entries(obj)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatter.js","sourceRoot":"","sources":["../../src/core/formatter.ts"],"names":[],"mappings":"AAMA,SAAS,KAAK;IACZ,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,I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AAE,CAAC;gBACzB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;oBAC9C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,CAAC,CAAC;oBACpC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;gBAChC,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,OAAO,IAAI,IAAI,CAAC,CAAC;gBAC9C,CAAC;YACH,CAAC;QACH,CAAC;aAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC;YACxC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,CAAC,CAAC;QACjC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,GAAG,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "r3plica",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "R3PLICA CLI — Search products, brands, collections, and finishes from the R3PLICA digital replicas catalog",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"bin": {
|
|
7
|
-
"r3": "dist/cli/index.js",
|
|
8
|
-
"r3-mcp": "dist/mcp/server.js"
|
|
9
|
-
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "tsc",
|
|
12
|
-
"dev": "tsc --watch",
|
|
13
|
-
"start": "node dist/cli/index.js",
|
|
14
|
-
"start:mcp": "node dist/mcp/server.js",
|
|
15
|
-
"clean": "rm -rf dist",
|
|
16
|
-
"prepublishOnly": "npm run clean && npm run build"
|
|
17
|
-
},
|
|
18
|
-
"keywords": ["r3plica", "cli", "furniture", "design", "architecture", "digital-replicas", "finishes", "mcp"],
|
|
19
|
-
"author": "R3PLICA S.r.l.",
|
|
20
|
-
"license": "Proprietary",
|
|
21
|
-
"repository": {
|
|
22
|
-
"type": "git",
|
|
23
|
-
"url": "git+https://github.com/R3PLICAsrl/r3-cli.git"
|
|
24
|
-
},
|
|
25
|
-
"files": ["dist/**/*", "README.md", "package.json"],
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"commander": "^13.1.0",
|
|
28
|
-
"@modelcontextprotocol/sdk": "^1.12.1"
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"typescript": "^5.8.3",
|
|
32
|
-
"@types/node": "^22.15.24"
|
|
33
|
-
},
|
|
34
|
-
"engines": {
|
|
35
|
-
"node": ">=20.0.0"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "r3plica",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "R3PLICA CLI — Search products, brands, collections, and finishes from the R3PLICA digital replicas catalog",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"r3": "dist/cli/index.js",
|
|
8
|
+
"r3-mcp": "dist/mcp/server.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "tsc",
|
|
12
|
+
"dev": "tsc --watch",
|
|
13
|
+
"start": "node dist/cli/index.js",
|
|
14
|
+
"start:mcp": "node dist/mcp/server.js",
|
|
15
|
+
"clean": "rm -rf dist",
|
|
16
|
+
"prepublishOnly": "npm run clean && npm run build"
|
|
17
|
+
},
|
|
18
|
+
"keywords": ["r3plica", "cli", "furniture", "design", "architecture", "digital-replicas", "finishes", "mcp"],
|
|
19
|
+
"author": "R3PLICA S.r.l.",
|
|
20
|
+
"license": "Proprietary",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/R3PLICAsrl/r3-cli.git"
|
|
24
|
+
},
|
|
25
|
+
"files": ["dist/**/*", "README.md", "package.json"],
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"commander": "^13.1.0",
|
|
28
|
+
"@modelcontextprotocol/sdk": "^1.12.1"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"typescript": "^5.8.3",
|
|
32
|
+
"@types/node": "^22.15.24"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"node": ">=20.0.0"
|
|
36
|
+
}
|
|
37
|
+
}
|