cyclecad 0.2.2 → 0.2.3
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/API-BUILD-MANIFEST.txt +339 -0
- package/API-SERVER.md +535 -0
- package/Architecture-Deck.pptx +0 -0
- package/CLAUDE.md +172 -11
- package/CLI-BUILD-SUMMARY.md +504 -0
- package/CLI-INDEX.md +356 -0
- package/CLI-README.md +466 -0
- package/COLLABORATION-INTEGRATION-GUIDE.md +325 -0
- package/CONNECTED_FABS_GUIDE.md +612 -0
- package/CONNECTED_FABS_README.md +310 -0
- package/DELIVERABLES.md +343 -0
- package/DFM-ANALYZER-INTEGRATION.md +368 -0
- package/DFM-QUICK-START.js +253 -0
- package/Dockerfile +69 -0
- package/IMPLEMENTATION.md +327 -0
- package/LICENSE +31 -0
- package/MARKETPLACE_QUICK_REFERENCE.txt +294 -0
- package/MCP-INDEX.md +264 -0
- package/QUICKSTART-API.md +388 -0
- package/QUICKSTART-CLI.md +211 -0
- package/QUICKSTART-MCP.md +196 -0
- package/README-MCP.md +208 -0
- package/TEST-TOKEN-ENGINE.md +319 -0
- package/TOKEN-ENGINE-SUMMARY.md +266 -0
- package/TOKENS-README.md +263 -0
- package/TOOLS-REFERENCE.md +254 -0
- package/app/index.html +168 -3
- package/app/js/TOKEN-INTEGRATION.md +391 -0
- package/app/js/agent-api.js +3 -3
- package/app/js/ai-copilot.js +1435 -0
- package/app/js/cam-pipeline.js +840 -0
- package/app/js/collaboration-ui.js +995 -0
- package/app/js/collaboration.js +1116 -0
- package/app/js/connected-fabs-example.js +404 -0
- package/app/js/connected-fabs.js +1449 -0
- package/app/js/dfm-analyzer.js +1760 -0
- package/app/js/marketplace.js +1994 -0
- package/app/js/material-library.js +2115 -0
- package/app/js/token-dashboard.js +563 -0
- package/app/js/token-engine.js +743 -0
- package/app/test-agent.html +1801 -0
- package/bin/cyclecad-cli.js +662 -0
- package/bin/cyclecad-mcp +2 -0
- package/bin/server.js +242 -0
- package/cycleCAD-Architecture.pptx +0 -0
- package/cycleCAD-Investor-Deck.pptx +0 -0
- package/demo-mcp.sh +60 -0
- package/docs/API-SERVER-SUMMARY.md +375 -0
- package/docs/API-SERVER.md +667 -0
- package/docs/CAM-EXAMPLES.md +344 -0
- package/docs/CAM-INTEGRATION.md +612 -0
- package/docs/CAM-QUICK-REFERENCE.md +199 -0
- package/docs/CLI-INTEGRATION.md +510 -0
- package/docs/CLI.md +872 -0
- package/docs/MARKETPLACE-API-SCHEMA.json +564 -0
- package/docs/MARKETPLACE-INTEGRATION.md +467 -0
- package/docs/MARKETPLACE-SETUP.html +439 -0
- package/docs/MCP-SERVER.md +403 -0
- package/examples/api-client-example.js +488 -0
- package/examples/api-client-example.py +359 -0
- package/examples/batch-manufacturing.txt +28 -0
- package/examples/batch-simple.txt +26 -0
- package/model-marketplace.html +1273 -0
- package/package.json +14 -3
- package/server/api-server.js +1120 -0
- package/server/mcp-server.js +1161 -0
- package/test-api-server.js +432 -0
- package/test-mcp.js +198 -0
- package/~$cycleCAD-Investor-Deck.pptx +0 -0
package/docs/CLI.md
ADDED
|
@@ -0,0 +1,872 @@
|
|
|
1
|
+
# cycleCAD Command-Line Interface (CLI)
|
|
2
|
+
|
|
3
|
+
A powerful CLI tool for running cycleCAD Agent API commands from the terminal. Designed for automation, scripting, and headless CAD operations.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Install globally:
|
|
8
|
+
```bash
|
|
9
|
+
npm install -g cyclecad
|
|
10
|
+
cyclecad --version
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or use locally in the cycleCAD project:
|
|
14
|
+
```bash
|
|
15
|
+
cd ~/cyclecad
|
|
16
|
+
./bin/cyclecad-cli.js --help
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
Start the development server:
|
|
22
|
+
```bash
|
|
23
|
+
node bin/server.js
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
In another terminal, run a command:
|
|
27
|
+
```bash
|
|
28
|
+
./bin/cyclecad-cli.js shape.cylinder --radius 25 --height 80
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
### Single Command Execution
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
cyclecad <namespace>.<command> [--param value ...]
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Examples:
|
|
40
|
+
```bash
|
|
41
|
+
# Create a cylinder
|
|
42
|
+
cyclecad shape.cylinder --radius 25 --height 80
|
|
43
|
+
|
|
44
|
+
# Create a box
|
|
45
|
+
cyclecad shape.box --width 50 --height 40 --depth 30
|
|
46
|
+
|
|
47
|
+
# Create a sphere
|
|
48
|
+
cyclecad shape.sphere --radius 30
|
|
49
|
+
|
|
50
|
+
# Start a sketch on XY plane
|
|
51
|
+
cyclecad sketch.start --plane XY
|
|
52
|
+
|
|
53
|
+
# Draw a circle
|
|
54
|
+
cyclecad sketch.circle --cx 0 --cy 0 --radius 15
|
|
55
|
+
|
|
56
|
+
# End the sketch
|
|
57
|
+
cyclecad sketch.end
|
|
58
|
+
|
|
59
|
+
# Extrude the sketch
|
|
60
|
+
cyclecad feature.extrude --height 10
|
|
61
|
+
|
|
62
|
+
# Apply a fillet
|
|
63
|
+
cyclecad feature.fillet --radius 5 --edges all
|
|
64
|
+
|
|
65
|
+
# Check dimensions
|
|
66
|
+
cyclecad validate.dimensions --target extrude_1
|
|
67
|
+
|
|
68
|
+
# Estimate cost
|
|
69
|
+
cyclecad validate.cost --target extrude_1 --process CNC --material aluminum
|
|
70
|
+
|
|
71
|
+
# Export to STL
|
|
72
|
+
cyclecad export.stl --filename my-part.stl --binary true
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Interactive REPL Mode
|
|
76
|
+
|
|
77
|
+
Start an interactive command-line interface:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
cyclecad --interactive
|
|
81
|
+
# or
|
|
82
|
+
cyclecad -i
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
This opens a REPL where you can:
|
|
86
|
+
- Type commands directly
|
|
87
|
+
- Use tab completion
|
|
88
|
+
- Access command history (↑↓ keys)
|
|
89
|
+
- Type `help` to list all commands
|
|
90
|
+
- Type `describe <command>` for help on a specific command
|
|
91
|
+
- Type `exit` to quit
|
|
92
|
+
|
|
93
|
+
Example session:
|
|
94
|
+
```
|
|
95
|
+
cyclecad> shape.cylinder --radius 25 --height 80
|
|
96
|
+
✓ Command executed: shape.cylinder
|
|
97
|
+
Entity ID: cylinder_1711234567890
|
|
98
|
+
|
|
99
|
+
cyclecad> help
|
|
100
|
+
Available Commands
|
|
101
|
+
shape/
|
|
102
|
+
cylinder (radius, height)
|
|
103
|
+
Create a cylinder
|
|
104
|
+
box (width, height, depth)
|
|
105
|
+
Create a box
|
|
106
|
+
...
|
|
107
|
+
|
|
108
|
+
cyclecad> describe sketch.circle
|
|
109
|
+
Command: sketch.circle
|
|
110
|
+
Description: Draw a circle
|
|
111
|
+
Parameters:
|
|
112
|
+
cx: number?
|
|
113
|
+
cy: number?
|
|
114
|
+
radius: number
|
|
115
|
+
|
|
116
|
+
Example:
|
|
117
|
+
cyclecad sketch.circle --cx value --cy value --radius value
|
|
118
|
+
|
|
119
|
+
cyclecad> exit
|
|
120
|
+
Goodbye!
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Batch Mode
|
|
124
|
+
|
|
125
|
+
Execute multiple commands from a file:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
cyclecad --batch examples/batch-simple.txt
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Batch file format (commands one per line, # for comments):
|
|
132
|
+
```
|
|
133
|
+
# Create shapes
|
|
134
|
+
shape.cylinder --radius 25 --height 80
|
|
135
|
+
shape.box --width 50 --height 40 --depth 30
|
|
136
|
+
|
|
137
|
+
# Sketch operations
|
|
138
|
+
sketch.start --plane XY
|
|
139
|
+
sketch.circle --cx 0 --cy 0 --radius 15
|
|
140
|
+
sketch.end
|
|
141
|
+
|
|
142
|
+
# Features
|
|
143
|
+
feature.extrude --height 10
|
|
144
|
+
feature.fillet --radius 2 --edges all
|
|
145
|
+
|
|
146
|
+
# Validation
|
|
147
|
+
validate.dimensions --target extrude_1
|
|
148
|
+
validate.cost --target extrude_1 --process CNC
|
|
149
|
+
|
|
150
|
+
# Export
|
|
151
|
+
export.stl --filename output.stl
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Global Flags
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
--help, -h Show help message
|
|
158
|
+
--version, -v Show CLI version
|
|
159
|
+
--server <url> Server URL (default: http://localhost:3000)
|
|
160
|
+
--json Output raw JSON (useful for parsing in scripts)
|
|
161
|
+
--quiet, -q Suppress status messages
|
|
162
|
+
--list List all available commands
|
|
163
|
+
--describe <command> Show help for a specific command
|
|
164
|
+
--interactive, -i Start interactive REPL
|
|
165
|
+
--batch <file> Execute commands from file
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Command Reference
|
|
169
|
+
|
|
170
|
+
### shape.* — Geometry Creation
|
|
171
|
+
|
|
172
|
+
#### shape.cylinder
|
|
173
|
+
Create a cylinder.
|
|
174
|
+
```bash
|
|
175
|
+
cyclecad shape.cylinder --radius 25 --height 80
|
|
176
|
+
```
|
|
177
|
+
**Parameters:**
|
|
178
|
+
- `radius` (number): Cylinder radius in mm
|
|
179
|
+
- `height` (number): Cylinder height in mm
|
|
180
|
+
|
|
181
|
+
#### shape.box
|
|
182
|
+
Create a rectangular box.
|
|
183
|
+
```bash
|
|
184
|
+
cyclecad shape.box --width 50 --height 40 --depth 30
|
|
185
|
+
```
|
|
186
|
+
**Parameters:**
|
|
187
|
+
- `width` (number): Box width in mm
|
|
188
|
+
- `height` (number): Box height in mm
|
|
189
|
+
- `depth` (number): Box depth in mm
|
|
190
|
+
|
|
191
|
+
#### shape.sphere
|
|
192
|
+
Create a sphere.
|
|
193
|
+
```bash
|
|
194
|
+
cyclecad shape.sphere --radius 30
|
|
195
|
+
```
|
|
196
|
+
**Parameters:**
|
|
197
|
+
- `radius` (number): Sphere radius in mm
|
|
198
|
+
|
|
199
|
+
#### shape.cone
|
|
200
|
+
Create a cone.
|
|
201
|
+
```bash
|
|
202
|
+
cyclecad shape.cone --radius 20 --height 50
|
|
203
|
+
```
|
|
204
|
+
**Parameters:**
|
|
205
|
+
- `radius` (number): Base radius in mm
|
|
206
|
+
- `height` (number): Cone height in mm
|
|
207
|
+
|
|
208
|
+
### sketch.* — 2D Sketch Operations
|
|
209
|
+
|
|
210
|
+
#### sketch.start
|
|
211
|
+
Start sketch mode on a plane.
|
|
212
|
+
```bash
|
|
213
|
+
cyclecad sketch.start --plane XY
|
|
214
|
+
```
|
|
215
|
+
**Parameters:**
|
|
216
|
+
- `plane` (string, optional): Plane to sketch on (XY, XZ, YZ). Default: XY
|
|
217
|
+
|
|
218
|
+
#### sketch.end
|
|
219
|
+
End sketch and return entities.
|
|
220
|
+
```bash
|
|
221
|
+
cyclecad sketch.end
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
#### sketch.line
|
|
225
|
+
Draw a line in sketch.
|
|
226
|
+
```bash
|
|
227
|
+
cyclecad sketch.line --x1 0 --y1 0 --x2 100 --y2 0
|
|
228
|
+
```
|
|
229
|
+
**Parameters:**
|
|
230
|
+
- `x1, y1, x2, y2` (numbers): Line start and end points
|
|
231
|
+
|
|
232
|
+
#### sketch.rect
|
|
233
|
+
Draw a rectangle.
|
|
234
|
+
```bash
|
|
235
|
+
cyclecad sketch.rect --x 0 --y 0 --width 80 --height 40
|
|
236
|
+
```
|
|
237
|
+
**Parameters:**
|
|
238
|
+
- `x, y` (numbers, optional): Top-left corner. Default: 0, 0
|
|
239
|
+
- `width, height` (numbers): Rectangle dimensions in mm
|
|
240
|
+
|
|
241
|
+
#### sketch.circle
|
|
242
|
+
Draw a circle.
|
|
243
|
+
```bash
|
|
244
|
+
cyclecad sketch.circle --cx 0 --cy 0 --radius 15
|
|
245
|
+
```
|
|
246
|
+
**Parameters:**
|
|
247
|
+
- `cx, cy` (numbers, optional): Center point. Default: 0, 0
|
|
248
|
+
- `radius` (number): Radius in mm
|
|
249
|
+
|
|
250
|
+
#### sketch.arc
|
|
251
|
+
Draw an arc.
|
|
252
|
+
```bash
|
|
253
|
+
cyclecad sketch.arc --cx 0 --cy 0 --radius 25 --startAngle 0 --endAngle 3.14159
|
|
254
|
+
```
|
|
255
|
+
**Parameters:**
|
|
256
|
+
- `cx, cy` (numbers, optional): Center point
|
|
257
|
+
- `radius` (number): Arc radius in mm
|
|
258
|
+
- `startAngle, endAngle` (numbers, optional): Arc angles in radians
|
|
259
|
+
|
|
260
|
+
#### sketch.clear
|
|
261
|
+
Clear all sketch entities.
|
|
262
|
+
```bash
|
|
263
|
+
cyclecad sketch.clear
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
#### sketch.entities
|
|
267
|
+
List current sketch entities.
|
|
268
|
+
```bash
|
|
269
|
+
cyclecad sketch.entities
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### feature.* — 3D Feature Operations
|
|
273
|
+
|
|
274
|
+
#### feature.extrude
|
|
275
|
+
Extrude sketch into 3D.
|
|
276
|
+
```bash
|
|
277
|
+
cyclecad feature.extrude --height 10
|
|
278
|
+
```
|
|
279
|
+
**Parameters:**
|
|
280
|
+
- `height` (number): Extrusion height in mm
|
|
281
|
+
- `taper` (number, optional): Taper angle in degrees
|
|
282
|
+
|
|
283
|
+
#### feature.revolve
|
|
284
|
+
Revolve sketch around an axis.
|
|
285
|
+
```bash
|
|
286
|
+
cyclecad feature.revolve --angle 360 --axis Z
|
|
287
|
+
```
|
|
288
|
+
**Parameters:**
|
|
289
|
+
- `angle` (number): Revolution angle in degrees
|
|
290
|
+
- `axis` (string, optional): Rotation axis (X, Y, Z). Default: Z
|
|
291
|
+
|
|
292
|
+
#### feature.fillet
|
|
293
|
+
Apply fillet to edges.
|
|
294
|
+
```bash
|
|
295
|
+
cyclecad feature.fillet --radius 5 --edges all
|
|
296
|
+
```
|
|
297
|
+
**Parameters:**
|
|
298
|
+
- `radius` (number): Fillet radius in mm
|
|
299
|
+
- `edges` (string, optional): Which edges (all, or specific edge IDs)
|
|
300
|
+
|
|
301
|
+
#### feature.chamfer
|
|
302
|
+
Apply chamfer to edges.
|
|
303
|
+
```bash
|
|
304
|
+
cyclecad feature.chamfer --size 2 --edges all
|
|
305
|
+
```
|
|
306
|
+
**Parameters:**
|
|
307
|
+
- `size` (number): Chamfer size in mm
|
|
308
|
+
- `edges` (string, optional): Which edges to chamfer
|
|
309
|
+
|
|
310
|
+
#### feature.pattern
|
|
311
|
+
Create a rectangular or circular pattern.
|
|
312
|
+
```bash
|
|
313
|
+
cyclecad feature.pattern --type rectangular --count 3 --spacing 25
|
|
314
|
+
```
|
|
315
|
+
**Parameters:**
|
|
316
|
+
- `type` (string): Pattern type (rectangular or circular)
|
|
317
|
+
- `count` (number): Number of instances
|
|
318
|
+
- `spacing` (number): Spacing between instances in mm
|
|
319
|
+
|
|
320
|
+
### assembly.* — Assembly Management
|
|
321
|
+
|
|
322
|
+
#### assembly.addComponent
|
|
323
|
+
Add a component to the assembly.
|
|
324
|
+
```bash
|
|
325
|
+
cyclecad assembly.addComponent --name "bolt" --meshOrFile cylinder_1 --position "[0, 0, 10]"
|
|
326
|
+
```
|
|
327
|
+
**Parameters:**
|
|
328
|
+
- `name` (string): Component name
|
|
329
|
+
- `meshOrFile` (string or object): Mesh entity ID or file path
|
|
330
|
+
- `position` (array, optional): [x, y, z] position in mm
|
|
331
|
+
|
|
332
|
+
#### assembly.removeComponent
|
|
333
|
+
Remove a component from assembly.
|
|
334
|
+
```bash
|
|
335
|
+
cyclecad assembly.removeComponent --target bolt
|
|
336
|
+
```
|
|
337
|
+
**Parameters:**
|
|
338
|
+
- `target` (string): Component ID or name
|
|
339
|
+
|
|
340
|
+
#### assembly.mate
|
|
341
|
+
Define a mate constraint between components.
|
|
342
|
+
```bash
|
|
343
|
+
cyclecad assembly.mate --target1 bracket --target2 bolt --type coincident
|
|
344
|
+
```
|
|
345
|
+
**Parameters:**
|
|
346
|
+
- `target1, target2` (strings): Component IDs
|
|
347
|
+
- `type` (string, optional): Mate type (coincident, concentric, parallel, tangent)
|
|
348
|
+
|
|
349
|
+
#### assembly.explode
|
|
350
|
+
Explode assembly components for visualization.
|
|
351
|
+
```bash
|
|
352
|
+
cyclecad assembly.explode --target "*" --distance 100
|
|
353
|
+
```
|
|
354
|
+
**Parameters:**
|
|
355
|
+
- `target` (string): Component ID or "*" for all
|
|
356
|
+
- `distance` (number, optional): Explode distance in mm
|
|
357
|
+
|
|
358
|
+
#### assembly.bom
|
|
359
|
+
Generate a bill of materials.
|
|
360
|
+
```bash
|
|
361
|
+
cyclecad assembly.bom --target assembly_1
|
|
362
|
+
```
|
|
363
|
+
**Parameters:**
|
|
364
|
+
- `target` (string, optional): Assembly ID. Default: root assembly
|
|
365
|
+
|
|
366
|
+
### validate.* — Design Validation & Analysis
|
|
367
|
+
|
|
368
|
+
#### validate.dimensions
|
|
369
|
+
Get part dimensions (bounding box).
|
|
370
|
+
```bash
|
|
371
|
+
cyclecad validate.dimensions --target extrude_1
|
|
372
|
+
```
|
|
373
|
+
**Parameters:**
|
|
374
|
+
- `target` (string): Feature or part ID
|
|
375
|
+
|
|
376
|
+
**Output:**
|
|
377
|
+
```json
|
|
378
|
+
{
|
|
379
|
+
"dimensions": {
|
|
380
|
+
"width": 80,
|
|
381
|
+
"height": 40,
|
|
382
|
+
"depth": 30
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
#### validate.wallThickness
|
|
388
|
+
Check minimum wall thickness for manufacturing.
|
|
389
|
+
```bash
|
|
390
|
+
cyclecad validate.wallThickness --target bracket --minWall 0.8
|
|
391
|
+
```
|
|
392
|
+
**Parameters:**
|
|
393
|
+
- `target` (string): Feature ID
|
|
394
|
+
- `minWall` (number, optional): Minimum wall thickness in mm. Default: 0.8
|
|
395
|
+
|
|
396
|
+
#### validate.printability
|
|
397
|
+
Check if part is printable via FDM/SLA/CNC.
|
|
398
|
+
```bash
|
|
399
|
+
cyclecad validate.printability --target bracket --process FDM
|
|
400
|
+
```
|
|
401
|
+
**Parameters:**
|
|
402
|
+
- `target` (string): Feature ID
|
|
403
|
+
- `process` (string, optional): Manufacturing process (FDM, SLA, CNC). Default: FDM
|
|
404
|
+
|
|
405
|
+
#### validate.cost
|
|
406
|
+
Estimate manufacturing cost.
|
|
407
|
+
```bash
|
|
408
|
+
cyclecad validate.cost --target bracket --process CNC --material aluminum --quantity 100
|
|
409
|
+
```
|
|
410
|
+
**Parameters:**
|
|
411
|
+
- `target` (string): Feature ID
|
|
412
|
+
- `process` (string, optional): Process (FDM, SLA, CNC, injection)
|
|
413
|
+
- `material` (string, optional): Material name
|
|
414
|
+
- `quantity` (number, optional): Number of units
|
|
415
|
+
|
|
416
|
+
**Output:**
|
|
417
|
+
```json
|
|
418
|
+
{
|
|
419
|
+
"cost": 45.50,
|
|
420
|
+
"process": "CNC",
|
|
421
|
+
"material": "aluminum",
|
|
422
|
+
"quantity": 100,
|
|
423
|
+
"costPerUnit": 0.4550
|
|
424
|
+
}
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
#### validate.mass
|
|
428
|
+
Estimate part mass (weight).
|
|
429
|
+
```bash
|
|
430
|
+
cyclecad validate.mass --target bracket --material steel
|
|
431
|
+
```
|
|
432
|
+
**Parameters:**
|
|
433
|
+
- `target` (string): Feature ID
|
|
434
|
+
- `material` (string, optional): Material name. Default: steel
|
|
435
|
+
|
|
436
|
+
#### validate.surfaceArea
|
|
437
|
+
Calculate surface area.
|
|
438
|
+
```bash
|
|
439
|
+
cyclecad validate.surfaceArea --target bracket
|
|
440
|
+
```
|
|
441
|
+
**Parameters:**
|
|
442
|
+
- `target` (string): Feature ID
|
|
443
|
+
|
|
444
|
+
#### validate.centerOfMass
|
|
445
|
+
Get geometric center of mass.
|
|
446
|
+
```bash
|
|
447
|
+
cyclecad validate.centerOfMass --target bracket
|
|
448
|
+
```
|
|
449
|
+
**Parameters:**
|
|
450
|
+
- `target` (string): Feature ID
|
|
451
|
+
|
|
452
|
+
#### validate.designReview
|
|
453
|
+
Automated design review with manufacturing analysis.
|
|
454
|
+
```bash
|
|
455
|
+
cyclecad validate.designReview --target bracket
|
|
456
|
+
```
|
|
457
|
+
**Parameters:**
|
|
458
|
+
- `target` (string): Feature ID
|
|
459
|
+
|
|
460
|
+
**Output:**
|
|
461
|
+
```json
|
|
462
|
+
{
|
|
463
|
+
"score": "B",
|
|
464
|
+
"warnings": [
|
|
465
|
+
"Wall thickness approaching minimum",
|
|
466
|
+
"Consider adding fillets for stress reduction"
|
|
467
|
+
],
|
|
468
|
+
"suggestions": [
|
|
469
|
+
"Increase wall thickness by 0.5mm",
|
|
470
|
+
"Add 2mm fillets to corners"
|
|
471
|
+
]
|
|
472
|
+
}
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
### render.* — Viewport Rendering
|
|
476
|
+
|
|
477
|
+
#### render.snapshot
|
|
478
|
+
Render current view as PNG.
|
|
479
|
+
```bash
|
|
480
|
+
cyclecad render.snapshot --width 1200 --height 800
|
|
481
|
+
```
|
|
482
|
+
**Parameters:**
|
|
483
|
+
- `width` (number, optional): Image width in pixels. Default: 800
|
|
484
|
+
- `height` (number, optional): Image height in pixels. Default: 600
|
|
485
|
+
|
|
486
|
+
#### render.multiview
|
|
487
|
+
Render 6 standard orthographic views.
|
|
488
|
+
```bash
|
|
489
|
+
cyclecad render.multiview --width 400 --height 400
|
|
490
|
+
```
|
|
491
|
+
**Parameters:**
|
|
492
|
+
- `width` (number, optional): View width in pixels. Default: 400
|
|
493
|
+
- `height` (number, optional): View height in pixels. Default: 300
|
|
494
|
+
|
|
495
|
+
#### render.highlight
|
|
496
|
+
Highlight a component in the viewport.
|
|
497
|
+
```bash
|
|
498
|
+
cyclecad render.highlight --target bracket --color 0xffff00 --duration 2000
|
|
499
|
+
```
|
|
500
|
+
**Parameters:**
|
|
501
|
+
- `target` (string): Component ID
|
|
502
|
+
- `color` (string, optional): Hex color (0xrrggbb). Default: 0xffff00 (yellow)
|
|
503
|
+
- `duration` (number, optional): Duration in ms (0 = persistent)
|
|
504
|
+
|
|
505
|
+
#### render.hide
|
|
506
|
+
Hide or show a component.
|
|
507
|
+
```bash
|
|
508
|
+
cyclecad render.hide --target bolt --hidden true
|
|
509
|
+
```
|
|
510
|
+
**Parameters:**
|
|
511
|
+
- `target` (string): Component ID
|
|
512
|
+
- `hidden` (boolean, optional): Hide (true) or show (false). Default: true
|
|
513
|
+
|
|
514
|
+
#### render.section
|
|
515
|
+
Enable section cutting (cross-section view).
|
|
516
|
+
```bash
|
|
517
|
+
cyclecad render.section --enabled true --axis Z --position 50
|
|
518
|
+
```
|
|
519
|
+
**Parameters:**
|
|
520
|
+
- `enabled` (boolean, optional): Enable/disable section cut
|
|
521
|
+
- `axis` (string, optional): Cut axis (X, Y, Z). Default: Z
|
|
522
|
+
- `position` (number, optional): Cut position along axis
|
|
523
|
+
|
|
524
|
+
### export.* — File Export
|
|
525
|
+
|
|
526
|
+
#### export.stl
|
|
527
|
+
Export to STL format.
|
|
528
|
+
```bash
|
|
529
|
+
cyclecad export.stl --filename bracket.stl --binary true
|
|
530
|
+
```
|
|
531
|
+
**Parameters:**
|
|
532
|
+
- `filename` (string, optional): Output filename. Default: output.stl
|
|
533
|
+
- `binary` (boolean, optional): Binary STL (true) or ASCII (false). Default: true
|
|
534
|
+
|
|
535
|
+
#### export.obj
|
|
536
|
+
Export to OBJ format.
|
|
537
|
+
```bash
|
|
538
|
+
cyclecad export.obj --filename bracket.obj
|
|
539
|
+
```
|
|
540
|
+
**Parameters:**
|
|
541
|
+
- `filename` (string, optional): Output filename. Default: output.obj
|
|
542
|
+
|
|
543
|
+
#### export.gltf
|
|
544
|
+
Export to glTF 2.0 format.
|
|
545
|
+
```bash
|
|
546
|
+
cyclecad export.gltf --filename bracket.gltf
|
|
547
|
+
```
|
|
548
|
+
**Parameters:**
|
|
549
|
+
- `filename` (string, optional): Output filename. Default: output.gltf
|
|
550
|
+
|
|
551
|
+
#### export.json
|
|
552
|
+
Export to cycleCAD JSON format.
|
|
553
|
+
```bash
|
|
554
|
+
cyclecad export.json --filename bracket.cyclecad.json
|
|
555
|
+
```
|
|
556
|
+
**Parameters:**
|
|
557
|
+
- `filename` (string, optional): Output filename. Default: output.cyclecad.json
|
|
558
|
+
|
|
559
|
+
#### export.step
|
|
560
|
+
Export to STEP format.
|
|
561
|
+
```bash
|
|
562
|
+
cyclecad export.step --filename bracket.step
|
|
563
|
+
```
|
|
564
|
+
**Parameters:**
|
|
565
|
+
- `filename` (string, optional): Output filename. Default: output.step
|
|
566
|
+
|
|
567
|
+
### marketplace.* — Marketplace & Libraries
|
|
568
|
+
|
|
569
|
+
#### marketplace.list
|
|
570
|
+
List marketplace components.
|
|
571
|
+
```bash
|
|
572
|
+
cyclecad marketplace.list --category fasteners
|
|
573
|
+
```
|
|
574
|
+
**Parameters:**
|
|
575
|
+
- `category` (string, optional): Filter by category
|
|
576
|
+
|
|
577
|
+
#### marketplace.search
|
|
578
|
+
Search the marketplace.
|
|
579
|
+
```bash
|
|
580
|
+
cyclecad marketplace.search --query "M5 bolt" --category fasteners
|
|
581
|
+
```
|
|
582
|
+
**Parameters:**
|
|
583
|
+
- `query` (string): Search query
|
|
584
|
+
- `category` (string, optional): Filter by category
|
|
585
|
+
|
|
586
|
+
#### marketplace.publish
|
|
587
|
+
Publish a design to the marketplace.
|
|
588
|
+
```bash
|
|
589
|
+
cyclecad marketplace.publish --name "Bracket v2" --price 50 --category hardware
|
|
590
|
+
```
|
|
591
|
+
**Parameters:**
|
|
592
|
+
- `name` (string): Design name
|
|
593
|
+
- `price` (number, optional): Price (free if not specified)
|
|
594
|
+
- `category` (string, optional): Category
|
|
595
|
+
|
|
596
|
+
### cam.* — Computer-Aided Manufacturing
|
|
597
|
+
|
|
598
|
+
#### cam.slice
|
|
599
|
+
Slice a model for 3D printing.
|
|
600
|
+
```bash
|
|
601
|
+
cyclecad cam.slice --printer ender3 --layer 0.2
|
|
602
|
+
```
|
|
603
|
+
**Parameters:**
|
|
604
|
+
- `printer` (string, optional): Printer profile (ender3, prusa, etc.)
|
|
605
|
+
- `layer` (number, optional): Layer height in mm. Default: 0.2
|
|
606
|
+
|
|
607
|
+
#### cam.toolpath
|
|
608
|
+
Generate CNC toolpath.
|
|
609
|
+
```bash
|
|
610
|
+
cyclecad cam.toolpath --tool endmill --depth 5
|
|
611
|
+
```
|
|
612
|
+
**Parameters:**
|
|
613
|
+
- `tool` (string): Tool type (endmill, ballnose, etc.)
|
|
614
|
+
- `depth` (number, optional): Cut depth in mm
|
|
615
|
+
|
|
616
|
+
### meta.* — API Metadata
|
|
617
|
+
|
|
618
|
+
#### meta.version
|
|
619
|
+
Get API version.
|
|
620
|
+
```bash
|
|
621
|
+
cyclecad meta.version
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
**Output:**
|
|
625
|
+
```json
|
|
626
|
+
{
|
|
627
|
+
"version": "0.1.0",
|
|
628
|
+
"apiVersion": "1.0.0",
|
|
629
|
+
"agent": "cyclecad-cli"
|
|
630
|
+
}
|
|
631
|
+
```
|
|
632
|
+
|
|
633
|
+
#### meta.getSchema
|
|
634
|
+
Get full API schema.
|
|
635
|
+
```bash
|
|
636
|
+
cyclecad meta.getSchema
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
#### meta.getState
|
|
640
|
+
Get current session state.
|
|
641
|
+
```bash
|
|
642
|
+
cyclecad meta.getState
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
#### meta.history
|
|
646
|
+
Get command history.
|
|
647
|
+
```bash
|
|
648
|
+
cyclecad meta.history
|
|
649
|
+
```
|
|
650
|
+
|
|
651
|
+
## Examples
|
|
652
|
+
|
|
653
|
+
### Example 1: Simple Part
|
|
654
|
+
|
|
655
|
+
Create a basic cylindrical part:
|
|
656
|
+
|
|
657
|
+
```bash
|
|
658
|
+
cyclecad shape.cylinder --radius 25 --height 80
|
|
659
|
+
cyclecad feature.fillet --radius 3 --edges all
|
|
660
|
+
cyclecad validate.dimensions --target cylinder_1
|
|
661
|
+
cyclecad export.stl --filename cylinder.stl
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
### Example 2: Batch Manufacturing Workflow
|
|
665
|
+
|
|
666
|
+
```bash
|
|
667
|
+
cyclecad --batch examples/batch-manufacturing.txt
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
This executes:
|
|
671
|
+
- Create a bracket with a rectangular sketch
|
|
672
|
+
- Extrude to 15mm height
|
|
673
|
+
- Add manufacturing-friendly fillets (2mm radius)
|
|
674
|
+
- Check CNC printability
|
|
675
|
+
- Estimate aluminum cost
|
|
676
|
+
- Estimate weight
|
|
677
|
+
- Run design review
|
|
678
|
+
- Export to STL
|
|
679
|
+
|
|
680
|
+
### Example 3: Assembly
|
|
681
|
+
|
|
682
|
+
```bash
|
|
683
|
+
# Create base bracket
|
|
684
|
+
cyclecad sketch.start --plane XY
|
|
685
|
+
cyclecad sketch.rect --width 100 --height 50
|
|
686
|
+
cyclecad sketch.end
|
|
687
|
+
cyclecad feature.extrude --height 20
|
|
688
|
+
|
|
689
|
+
# Create bolt hole
|
|
690
|
+
cyclecad sketch.start --plane XY
|
|
691
|
+
cyclecad sketch.circle --cx 50 --cy 25 --radius 2.5
|
|
692
|
+
cyclecad sketch.end
|
|
693
|
+
cyclecad feature.extrude --height 20
|
|
694
|
+
|
|
695
|
+
# Add components to assembly
|
|
696
|
+
cyclecad assembly.addComponent --name "bolt" --meshOrFile cylinder_1 --position "[50, 25, 0]"
|
|
697
|
+
cyclecad assembly.mate --target1 bracket --target2 bolt --type concentric
|
|
698
|
+
|
|
699
|
+
# Generate BOM
|
|
700
|
+
cyclecad assembly.bom --target assembly_1
|
|
701
|
+
|
|
702
|
+
# Export assembly
|
|
703
|
+
cyclecad export.stl --filename assembly.stl
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
### Example 4: Validation and Cost Estimation
|
|
707
|
+
|
|
708
|
+
```bash
|
|
709
|
+
# Create a part
|
|
710
|
+
cyclecad shape.box --width 80 --height 40 --depth 30
|
|
711
|
+
|
|
712
|
+
# Validate
|
|
713
|
+
cyclecad validate.dimensions --target box_1
|
|
714
|
+
cyclecad validate.wallThickness --target box_1 --minWall 1.0
|
|
715
|
+
cyclecad validate.printability --target box_1 --process CNC
|
|
716
|
+
cyclecad validate.designReview --target box_1
|
|
717
|
+
|
|
718
|
+
# Cost analysis
|
|
719
|
+
cyclecad validate.cost --target box_1 --process CNC --material aluminum --quantity 100
|
|
720
|
+
cyclecad validate.mass --target box_1 --material aluminum
|
|
721
|
+
|
|
722
|
+
# Get surface area
|
|
723
|
+
cyclecad validate.surfaceArea --target box_1
|
|
724
|
+
```
|
|
725
|
+
|
|
726
|
+
### Example 5: Interactive Session
|
|
727
|
+
|
|
728
|
+
```bash
|
|
729
|
+
cyclecad --interactive
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
Then interactively:
|
|
733
|
+
```
|
|
734
|
+
cyclecad> shape.cylinder --radius 25 --height 80
|
|
735
|
+
✓ Command executed: shape.cylinder
|
|
736
|
+
|
|
737
|
+
cyclecad> validate.dimensions --target cylinder_1
|
|
738
|
+
Dimensions:
|
|
739
|
+
Width: 50 mm
|
|
740
|
+
Height: 80 mm
|
|
741
|
+
Depth: 50 mm
|
|
742
|
+
|
|
743
|
+
cyclecad> export.stl --filename my-cylinder.stl
|
|
744
|
+
✓ Command executed: export.stl
|
|
745
|
+
|
|
746
|
+
cyclecad> exit
|
|
747
|
+
Goodbye!
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
## JSON Output for Scripting
|
|
751
|
+
|
|
752
|
+
Use `--json` flag to get parseable JSON output:
|
|
753
|
+
|
|
754
|
+
```bash
|
|
755
|
+
$ cyclecad shape.cylinder --radius 25 --height 80 --json
|
|
756
|
+
{
|
|
757
|
+
"entityId": "cylinder_1711234567890",
|
|
758
|
+
"type": "shape",
|
|
759
|
+
"radius": 25,
|
|
760
|
+
"height": 80,
|
|
761
|
+
"volume": 157079.63,
|
|
762
|
+
"message": "Created cylinder with radius 25mm and height 80mm"
|
|
763
|
+
}
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
Parse with tools like `jq`:
|
|
767
|
+
|
|
768
|
+
```bash
|
|
769
|
+
cyclecad shape.cylinder --radius 25 --height 80 --json | jq '.entityId'
|
|
770
|
+
# Output: "cylinder_1711234567890"
|
|
771
|
+
```
|
|
772
|
+
|
|
773
|
+
## Bash Script Example
|
|
774
|
+
|
|
775
|
+
```bash
|
|
776
|
+
#!/bin/bash
|
|
777
|
+
|
|
778
|
+
# Create multiple parts and export them
|
|
779
|
+
for i in {1..5}; do
|
|
780
|
+
RADIUS=$((20 + i * 5))
|
|
781
|
+
HEIGHT=$((80 + i * 10))
|
|
782
|
+
|
|
783
|
+
echo "Creating cylinder $i (r=$RADIUS, h=$HEIGHT)..."
|
|
784
|
+
|
|
785
|
+
OUTPUT=$(cyclecad shape.cylinder --radius $RADIUS --height $HEIGHT --json)
|
|
786
|
+
ENTITY_ID=$(echo "$OUTPUT" | jq -r '.entityId')
|
|
787
|
+
|
|
788
|
+
cyclecad validate.cost --target "$ENTITY_ID" --process CNC --material aluminum
|
|
789
|
+
cyclecad export.stl --filename "cylinder-$i.stl"
|
|
790
|
+
done
|
|
791
|
+
```
|
|
792
|
+
|
|
793
|
+
## Server Configuration
|
|
794
|
+
|
|
795
|
+
By default, the CLI connects to `http://localhost:3000`. Change this:
|
|
796
|
+
|
|
797
|
+
```bash
|
|
798
|
+
# Use different server
|
|
799
|
+
cyclecad --server http://production.cyclecad.com shape.cylinder --radius 25 --height 80
|
|
800
|
+
|
|
801
|
+
# Or set environment variable
|
|
802
|
+
export CYCLECAD_SERVER=http://production.cyclecad.com
|
|
803
|
+
cyclecad shape.cylinder --radius 25 --height 80
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
## Troubleshooting
|
|
807
|
+
|
|
808
|
+
### "Connection failed"
|
|
809
|
+
Make sure the cycleCAD server is running:
|
|
810
|
+
```bash
|
|
811
|
+
node bin/server.js
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
### "Unknown command"
|
|
815
|
+
List available commands:
|
|
816
|
+
```bash
|
|
817
|
+
cyclecad --list
|
|
818
|
+
cyclecad --describe shape.cylinder
|
|
819
|
+
```
|
|
820
|
+
|
|
821
|
+
### Output hard to read
|
|
822
|
+
Use JSON mode for scripting:
|
|
823
|
+
```bash
|
|
824
|
+
cyclecad validate.cost --target bracket --json --quiet
|
|
825
|
+
```
|
|
826
|
+
|
|
827
|
+
### Need to see what's happening
|
|
828
|
+
Remove `--quiet` flag to see status messages and spinner.
|
|
829
|
+
|
|
830
|
+
## API Server Development
|
|
831
|
+
|
|
832
|
+
To integrate the CLI with the actual cycleCAD application:
|
|
833
|
+
|
|
834
|
+
1. **Setup API Endpoint**: Implement `/api/execute` endpoint in your server that accepts:
|
|
835
|
+
```json
|
|
836
|
+
{
|
|
837
|
+
"method": "shape.cylinder",
|
|
838
|
+
"params": { "radius": 25, "height": 80 }
|
|
839
|
+
}
|
|
840
|
+
```
|
|
841
|
+
|
|
842
|
+
2. **Return Format**: Respond with:
|
|
843
|
+
```json
|
|
844
|
+
{
|
|
845
|
+
"ok": true,
|
|
846
|
+
"result": { "entityId": "cylinder_1", ... }
|
|
847
|
+
}
|
|
848
|
+
```
|
|
849
|
+
|
|
850
|
+
3. **Start Server**: Run your server on port 3000 (or configure with `--server`)
|
|
851
|
+
|
|
852
|
+
4. **Test Commands**: Use the CLI to test your API
|
|
853
|
+
|
|
854
|
+
See `bin/server.js` for a mock implementation that handles all 30+ commands.
|
|
855
|
+
|
|
856
|
+
## Environment Variables
|
|
857
|
+
|
|
858
|
+
```bash
|
|
859
|
+
CYCLECAD_SERVER # Default server URL (overrides --server flag)
|
|
860
|
+
CYCLECAD_FORMAT # Default output format (json, text)
|
|
861
|
+
CYCLECAD_QUIET # Default quiet mode (true/false)
|
|
862
|
+
```
|
|
863
|
+
|
|
864
|
+
## License
|
|
865
|
+
|
|
866
|
+
MIT
|
|
867
|
+
|
|
868
|
+
## Support
|
|
869
|
+
|
|
870
|
+
For issues, feature requests, or contributions:
|
|
871
|
+
- GitHub: https://github.com/vvlars-cmd/cyclecad
|
|
872
|
+
- Issues: https://github.com/vvlars-cmd/cyclecad/issues
|