# meshforge > meshforge is a pure-Rust, CPU-only 3D modelling and rigging kernel (MIT OR Apache-2.0) for native, wasm and AI agents. Agents drive it with JSON commands (create primitives, select, extrude, inset, bevel, booleans, modifiers, UV unwrap, decimate, auto-weights, glTF export) through the `meshforge` CLI or the Rust `meshforge::command::Session`; every reply is JSON with counts, bounding box and warnings, or an error with a hint saying how to fix it. Everything below, plus the full CLI guide and command reference, as one plain-text file: [llms-full.txt](llms-full.txt). ## Install - Rust toolchain: `cargo install meshforge-cli` (installs the `meshforge` binary; pure Rust, no C toolchain) - Homebrew (macOS, Linux): `brew tap partiigames/tap && brew trust partiigames/tap && brew install meshforge` - Prebuilt archives (Linux x86_64/aarch64, macOS x86_64/arm64, Windows x86_64) with SHA256SUMS: https://github.com/PartiiGames/meshforge/releases/latest - Rust library: `cargo add meshforge` - npm / npx: not published yet (coming soon) ## Command protocol - Send one JSON object with an `"op"` field, or a JSON array of them (applied in order): `meshforge apply --session NAME.mfs -e ''`. The session file keeps the state between calls; `-o file.glb` writes the asset. - Reply: one JSON object on stdout. Success `{"ok":true,...}`; failure `{"ok":false,"error":{"code","message","hint",...}}` and exit code 1. A failed command changes nothing. Usage errors exit 2. - CLI replies are brief by default (news, `applied`, and an `objects` summary: `tris`, `shells`, `boundary_loops`, `bbox`); `--full` gives every field. - Unknown fields are errors: never guess field names. `meshforge ops --text` lists every op; `meshforge ops OP1 OP2` prints each op's fields, types and defaults in one line; `meshforge ops --all` is the whole API as JSON; `--format json-schema|gbnf` gives grammars. - Select geometry by meaning, not ids: `{"op":"select","object":"crate","select":{"faces_facing":[0,1,0]}}`, `{"tag":"top"}`, `in_box`, edge selectors such as `{"sharper_than_deg":30}`. Edit commands without ids act on the selection. - Conventions: Y up, front faces +Z, metres, counter-clockwise winding. Ids are stable unless a reply says `"renumbered":true` (boolean, subdivide, decimate). - Look before you ship: `meshforge preview NAME.mfs -o view.png` renders four views; back faces show magenta hatching. With `--json`, the reply counts them in `back_faces_visible` (0 for a closed, correctly wound prop); the default text reply does not. - Ship: `export_glb` or `-o file.glb`, then `meshforge validate file.glb` (exit 1 on errors). - Budgets: every command predicts its face count first and fails with `budget_exceeded` instead of running away (`set_limits`). - There is no MCP server yet; agents call the CLI. Example: ```sh meshforge apply --session crate.mfs -e '[{"op":"create_primitive","kind":"cube","name":"crate"},{"op":"bevel","object":"crate","select":{"sharper_than_deg":30},"width":0.05,"segments":3}]' meshforge apply --session crate.mfs -o crate.glb meshforge validate crate.glb --text ``` ## Reference The reference documents main, which is ahead of the 0.4.0 release; features marked "since 0.5.0" are not in 0.4.0 yet. - [Command reference](commands.html): every JSON command, selectors, result fields, error codes (source: https://github.com/PartiiGames/meshforge/blob/main/docs/command-api.md) - [CLI guide](cli.html): apply, session files, preview, info, validate, ops, weights, transfer; a worked chair (source: https://github.com/PartiiGames/meshforge/blob/main/docs/cli.md) - [Quick start](quickstart.html): a real 30-second CLI session with its output - AGENTS.md, the agent loop and a complete example: https://github.com/PartiiGames/meshforge/blob/main/AGENTS.md - SKILL.md, the same as a drop-in agent skill: https://github.com/PartiiGames/meshforge/blob/main/SKILL.md - Browser and node runtime (wasm, three.js, workers): https://github.com/PartiiGames/meshforge/blob/main/docs/partii-runtime.md ## Optional - Benchmarks against headless Blender (speed, memory, quality per op): https://github.com/PartiiGames/meshforge/blob/main/bench-results/blender-568f752/board.md - Repository: https://github.com/PartiiGames/meshforge - Changelog: https://github.com/PartiiGames/meshforge/blob/main/CHANGELOG.md - Licence: MIT OR Apache-2.0; third-party notices: https://github.com/PartiiGames/meshforge/blob/main/NOTICE - meshforge is built with AI coding agents.