@zappar/mattercraft-cli
v0.2.1
Published
Build Mattercraft projects from the command line or programmatically
Readme
@zappar/mattercraft-cli
A CLI (and programmatic API) for building Mattercraft projects. Export your project from the Mattercraft editor, run a single command, and get production-ready output — no bundler config needed.
Under the hood it uses Vite with the @zappar/mattercraft-vite-plugin preconfigured. You don't need to think about any of that.
Installation
npm install @zappar/mattercraft-cliOr just run it directly with npx — no install required:
npx @zappar/mattercraft-cliCLI Usage
Point it at a directory containing your exported Mattercraft project:
mattercraft ./my-projectThat's it. Built files end up in ./my-project/dist.
Options
mattercraft [root] [options]
Arguments:
root Project root directory (default: ".")
Options:
-o, --out <dir> Output directory (default: "dist")
-b, --base <path> Base public path (default: "/")
-h, --help Show this help messageCI/CD
Drop this into your pipeline and you're done:
npx @zappar/mattercraft-cli ./my-project --out ./buildProgrammatic Usage
If you'd rather call it from your own scripts or tooling:
import { build } from '@zappar/mattercraft-cli';
await build({
root: './my-project',
outDir: 'build',
base: '/my-app/',
});build(options?)
Builds the project and writes output to disk.
| Option | Type | Default | Description |
| -------- | -------- | ------- | ----------------------------------- |
| root | string | "." | Project root containing index.html |
| outDir | string | "dist"| Where to write the built files |
| base | string | "/" | Base public path for asset URLs |
Throws if no index.html is found in the root directory.
Requirements
- Node 24 or later
License
Proprietary - Zappar Limited
