
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@moicad/cli
Advanced tools
Command-line interface for moicad - Modern JavaScript CAD Platform.
Provides a local web UI, headless build tools, and API server for CAD operations.
npm install -g @moicad/cli
# or
bun add -g @moicad/cli
npm install @moicad/cli
# or
bun add @moicad/cli
# Launch web UI (opens browser at localhost:42069)
moicad
# Start server without opening browser
moicad serve
# Compile a file to JSON
moicad build model.scad
# Export to STL
moicad export model.scad -f stl
# Initialize new project
moicad init my-project
moicad or moicad launch [file]Starts the local web server and opens the browser.
# Launch with default file
moicad
# Open specific file
moicad launch cube.scad
# Custom port
moicad launch --port 3000
Options:
--port, -p <number> - Server port (default: 42069)--host <string> - Bind host (default: localhost)--no-open - Don't open browser automaticallymoicad serveStarts the API server without opening a browser. Useful for:
# Start server on default port
moicad serve
# Custom port and host
moicad serve --port 8080 --host 0.0.0.0
Options:
--port, -p <number> - Server port (default: 42069)--host <string> - Bind host (default: localhost)moicad build <file> [options]Compiles OpenSCAD or JavaScript code to geometry JSON (headless).
# Build to stdout
moicad build model.scad
# Save to file
moicad build model.scad -o output.json
# JavaScript file
moicad build model.js
# With animation (specify time value)
moicad build animation.scad -t 0.5
Options:
-o, --output <file> - Output file path-t, --time <number> - Animation time value (0-1)--pretty - Pretty-print JSON output--stats - Include geometry statisticsOutput Format:
{
"geometry": {
"vertices": [...],
"indices": [...],
"normals": [...],
"bounds": { "min": [x,y,z], "max": [x,y,z] },
"stats": {
"vertexCount": 1234,
"faceCount": 567,
"volume": 1000.5
}
},
"success": true,
"executionTime": 45.2
}
moicad export <file> [options]Exports geometry to STL, OBJ, or other formats.
# Export to STL
moicad export model.scad -f stl
# Custom output filename
moicad export model.scad -f stl -o custom-name.stl
# Export to OBJ
moicad export model.js -f obj
# Animation frame export
moicad export animation.scad -f stl -t 0.5 -o frame-50.stl
Options:
-f, --format <format> - Output format (stl, obj) [required]-o, --output <file> - Output filename-t, --time <number> - Animation time value (0-1)--ascii - Use ASCII STL format (default: binary)moicad init [name]Creates a new moicad project with starter files.
# Create project in current directory
moicad init
# Create project in new directory
moicad init my-cad-project
# With template
moicad init my-project --template javascript
Options:
--template <name> - Project template (openscad, javascript, typescript)--no-install - Skip dependency installationGenerated Structure:
my-project/
├── package.json
├── README.md
├── models/
│ ├── example.scad
│ └── example.js
└── .gitignore
moicad --versionShows version information.
moicad --version
# moicad CLI v0.1.0
# SDK v0.1.10
moicad --updateUpdates moicad to the latest version.
moicad --update
When running moicad launch or moicad serve, a local API server starts with these endpoints:
POST /api/evaluateEvaluates OpenSCAD or JavaScript code to geometry.
Request:
{
"code": "cube(10);",
"language": "openscad",
"t": 0.5 // Optional: animation time (0-1)
}
Response:
{
"geometry": { /* ... */ },
"success": true,
"errors": [],
"executionTime": 45.2
}
POST /api/parseParses OpenSCAD code to AST.
Request:
{
"code": "sphere(5);"
}
Response:
{
"ast": [ /* ... */ ],
"success": true,
"errors": []
}
POST /api/exportExports geometry to STL/OBJ format.
Request:
{
"geometry": { /* ... */ },
"format": "stl"
}
Response: Binary file (application/octet-stream)
GET /healthHealth check endpoint.
Response:
{
"status": "ok",
"timestamp": 1234567890
}
# Server port
MOICAD_PORT=42069
# Server host
MOICAD_HOST=localhost
# Log level
MOICAD_LOG_LEVEL=info
Create .moicadrc.json in your project:
{
"port": 42069,
"host": "localhost",
"autoOpen": true,
"editor": {
"defaultLanguage": "openscad",
"theme": "vs-dark"
}
}
Use the CLI as a library in your Node/Bun scripts:
import { createServer, evaluateFile, exportFile } from '@moicad/cli';
// Start server programmatically
const server = createServer({ port: 42069 });
// Evaluate file
const result = await evaluateFile('model.scad');
console.log(result.geometry);
// Export file
await exportFile('model.scad', 'output.stl', { format: 'stl' });
Add to .vscode/tasks.json:
{
"label": "moicad: Build",
"type": "shell",
"command": "moicad build ${file}",
"problemMatcher": []
}
- name: Install moicad
run: npm install -g @moicad/cli
- name: Build models
run: moicad build models/*.scad
FROM oven/bun:latest
RUN bun add -g @moicad/cli
EXPOSE 42069
CMD ["moicad", "serve", "--host", "0.0.0.0"]
# Use a different port
moicad launch --port 3000
# Use sudo (macOS/Linux)
sudo npm install -g @moicad/cli
# Or use local install
npm install @moicad/cli
npx moicad launch
The CLI loads the full-featured @moicad/gui CADEditor component via CDN. Features include:
All dependencies (React, Three.js, Monaco) are loaded from CDN, so the CLI binary stays lightweight.
The CLI server (packages/cli/src/server.ts) serves a minimal HTML page that:
@moicad/gui/components CADEditor from CDN/api/evaluate, /api/parse, /api/export)This approach provides:
packages/guiThe CLI dynamically serves manifold.wasm from the @moicad/sdk package with proper caching headers:
node_modules/@moicad/sdk/../manifold-3d/manifold.wasmnode_modules/manifold-3d/manifold.wasmpublic, max-age=31536000 (1 year)# Clone repository
git clone https://github.com/moikas/moicad.git
cd moicad
# Install dependencies
bun install
# Build CLI
cd packages/cli
bun run build
# Link for local development
bun link
# Test CLI
moicad --version
# Development mode (with live editing)
bun run dev:server # Terminal 1
cd packages/gui && bun run dev # Terminal 2 (optional, for GUI development)
MIT
FAQs
Modern JavaScript CAD Platform - CLI tool
The npm package @moicad/cli receives a total of 0 weekly downloads. As such, @moicad/cli popularity was classified as not popular.
We found that @moicad/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.