@metamesh/cli 0.18.0 → 0.20.0
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/CHANGELOG.md +65 -0
- package/README.md +66 -45
- package/dist/authoring/artifacts.d.ts +1 -1
- package/dist/authoring/artifacts.d.ts.map +1 -1
- package/dist/authoring/artifacts.js +5 -10
- package/dist/authoring/artifacts.js.map +1 -1
- package/dist/authoring/environment.d.ts.map +1 -1
- package/dist/authoring/environment.js +2 -0
- package/dist/authoring/environment.js.map +1 -1
- package/dist/authoring/execution-process.d.ts +1 -2
- package/dist/authoring/execution-process.d.ts.map +1 -1
- package/dist/authoring/execution-process.js +6 -5
- package/dist/authoring/execution-process.js.map +1 -1
- package/dist/authoring/export-capture.d.ts +22 -0
- package/dist/authoring/export-capture.d.ts.map +1 -0
- package/dist/authoring/export-capture.js +76 -0
- package/dist/authoring/export-capture.js.map +1 -0
- package/dist/authoring/render/client-bundle.js +172 -172
- package/dist/authoring/render/client-bundle.js.map +4 -4
- package/dist/authoring/render/scene.d.ts.map +1 -1
- package/dist/authoring/render/scene.js +2 -1
- package/dist/authoring/render/scene.js.map +1 -1
- package/dist/authoring/run.d.ts.map +1 -1
- package/dist/authoring/run.js +1 -2
- package/dist/authoring/run.js.map +1 -1
- package/dist/authoring/types.d.ts +4 -6
- package/dist/authoring/types.d.ts.map +1 -1
- package/dist/authoring/types.js.map +1 -1
- package/dist/authoring.d.ts +2 -0
- package/dist/authoring.d.ts.map +1 -1
- package/dist/authoring.js +1 -0
- package/dist/authoring.js.map +1 -1
- package/dist/docs/guides/agent-authoring.md +45 -243
- package/dist/docs/guides/local-authoring.md +216 -0
- package/dist/docs/guides/package.md +66 -45
- package/dist/docs/manifest.json +126 -52
- package/dist/docs/reference/authoring/AUTHORING_PROTOCOL_VERSION.md +1 -1
- package/dist/docs/reference/authoring/AuthoringDiagnostic.md +1 -1
- package/dist/docs/reference/authoring/AuthoringEnvironment.md +1 -1
- package/dist/docs/reference/authoring/AuthoringError.md +1 -1
- package/dist/docs/reference/authoring/AuthoringFailure-type.md +1 -1
- package/dist/docs/reference/authoring/AuthoringKind.md +1 -1
- package/dist/docs/reference/authoring/AuthoringPhase.md +2 -2
- package/dist/docs/reference/authoring/CaptureExportFormat.md +10 -0
- package/dist/docs/reference/authoring/CaptureExportOptions.md +17 -0
- package/dist/docs/reference/authoring/CaptureExportResult.md +15 -0
- package/dist/docs/reference/authoring/CapturedBuffer.md +1 -1
- package/dist/docs/reference/authoring/CapturedGeometry.md +1 -1
- package/dist/docs/reference/authoring/CapturedPart.md +1 -1
- package/dist/docs/reference/authoring/CapturedResource.md +1 -1
- package/dist/docs/reference/authoring/CapturedRun.md +1 -1
- package/dist/docs/reference/authoring/CapturedRunManifest.md +2 -3
- package/dist/docs/reference/authoring/CheckOptions.md +1 -1
- package/dist/docs/reference/authoring/CheckSuccess.md +1 -1
- package/dist/docs/reference/authoring/DocumentationEntry.md +1 -1
- package/dist/docs/reference/authoring/DocumentationManifest.md +1 -1
- package/dist/docs/reference/authoring/DocumentationSearchResult.md +1 -1
- package/dist/docs/reference/authoring/InstalledAuthoringPackage.md +1 -1
- package/dist/docs/reference/authoring/RenderCamera.md +1 -1
- package/dist/docs/reference/authoring/RenderFormat.md +1 -1
- package/dist/docs/reference/authoring/RenderOptions.md +1 -1
- package/dist/docs/reference/authoring/RenderResult.md +1 -1
- package/dist/docs/reference/authoring/RenderView.md +1 -1
- package/dist/docs/reference/authoring/RenderedImage.md +1 -1
- package/dist/docs/reference/authoring/RunOptions.md +1 -3
- package/dist/docs/reference/authoring/RunSuccess.md +1 -1
- package/dist/docs/reference/authoring/authoringFailure-value.md +1 -1
- package/dist/docs/reference/authoring/checkAuthoringSource.md +1 -1
- package/dist/docs/reference/authoring/discoverAuthoringEnvironment.md +1 -1
- package/dist/docs/reference/authoring/exportCapturedRun.md +10 -0
- package/dist/docs/reference/authoring/inspectCapturedRun.md +1 -1
- package/dist/docs/reference/authoring/installAuthoringBrowser.md +1 -1
- package/dist/docs/reference/authoring/readCapturedRun.md +1 -1
- package/dist/docs/reference/authoring/renderCapturedRun.md +1 -1
- package/dist/docs/reference/authoring/runAuthoringSource.md +1 -1
- package/dist/docs/reference/authoring/searchAuthoringDocumentation.md +1 -1
- package/dist/docs/reference/authoring/showAuthoringDocumentation.md +1 -1
- package/dist/metamesh.js +13 -4
- package/dist/metamesh.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# Check and render with the CLI
|
|
2
|
+
|
|
3
|
+
Look up installed APIs, check TypeScript, run local models, and inspect, render, or export the captured result.
|
|
4
|
+
|
|
5
|
+
Use the `metamesh` CLI from your terminal, scripts, or coding agent. It finds the installed API
|
|
6
|
+
documentation, checks TypeScript, runs models, and produces captures you can inspect, render,
|
|
7
|
+
and export. You choose how these tools fit into your workflow.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
**Run source you trust**
|
|
12
|
+
|
|
13
|
+
Local model code runs with your ordinary Node permissions. The disposable child process is not a
|
|
14
|
+
security sandbox.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Install and discover the environment
|
|
19
|
+
|
|
20
|
+
Use Node.js 24 or newer. The package APIs publish ES modules only. TypeScript API consumers
|
|
21
|
+
use TypeScript 6.0 or newer with `strict` checking and `NodeNext` or `Bundler` resolution;
|
|
22
|
+
the CLI includes its source-checking compiler.
|
|
23
|
+
|
|
24
|
+
Install Modeling for your model code and the CLI for the local authoring workflow:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pnpm add @metamesh/modeling
|
|
28
|
+
pnpm add -D @metamesh/cli
|
|
29
|
+
pnpm exec metamesh environment --json
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`environment` reports project-resolved versions, documentation locations, available capabilities,
|
|
33
|
+
and `authoringProtocolVersion: 1`. An agent integration should check that protocol value before
|
|
34
|
+
using the commands. Fix missing packages, mismatched releases, or an unsupported protocol before
|
|
35
|
+
authoring.
|
|
36
|
+
|
|
37
|
+
Add the Generator SDK as a direct dependency when defining Generators, and Testkit when writing
|
|
38
|
+
automated tests. Ordinary models need only Modeling and the CLI as direct dependencies. Keep
|
|
39
|
+
installed MetaMesh packages on matching releases.
|
|
40
|
+
|
|
41
|
+
| Component | Responsibility |
|
|
42
|
+
| ------------------------- | --------------------------------------------------------------------------------------------- |
|
|
43
|
+
| `@metamesh/modeling` | Geometry operations, synchronous generation, engine sessions, and completed snapshots |
|
|
44
|
+
| `@metamesh/generator-sdk` | Serializable controls, parameter types and validation, and Generator module envelopes |
|
|
45
|
+
| `@metamesh/cli` | Installed documentation lookup, TypeScript checking, captured runs, inspection, and rendering |
|
|
46
|
+
| `@metamesh/testkit` | Generation runners, fixtures, and assertions for your test framework |
|
|
47
|
+
|
|
48
|
+
Every public package exposes its offline documentation manifest through `./docs/manifest.json`.
|
|
49
|
+
The CLI searches the packages installed in the selected project. Find a topic in the bounded index,
|
|
50
|
+
then read the returned document ID:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pnpm exec metamesh docs show modeling/guide/standalone-model
|
|
54
|
+
pnpm exec metamesh docs search "cylinder"
|
|
55
|
+
pnpm exec metamesh docs show modeling/reference/model/cylinder
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Start with the [standalone model example](https://metamesh.studio/docs/develop/standalone-model), or use the
|
|
59
|
+
[construction map](https://metamesh.studio/docs/develop/geometry-recipes#choose-a-technique) to choose an approach
|
|
60
|
+
for your shape. You can also search for a shape or symbol and read its recipe or reference.
|
|
61
|
+
Search matches distinct words in titles, headings, keywords, and summaries. Exact titles, IDs, and imports take priority;
|
|
62
|
+
equally complete intent matches favor guides.
|
|
63
|
+
|
|
64
|
+
Documentation is resolved from the selected project through package exports. No global installation
|
|
65
|
+
or documentation fetched from a moving Git branch replaces the installed version.
|
|
66
|
+
|
|
67
|
+
For optional portable skills and project instructions, see
|
|
68
|
+
[Work with a coding agent](agent-authoring.md). Use `--project PATH` consistently when
|
|
69
|
+
targeting another directory so discovery, lookup, and execution resolve the same installation.
|
|
70
|
+
|
|
71
|
+
## Model entries
|
|
72
|
+
|
|
73
|
+
A model entry default-exports a `ModelProgram` and imports the installed package directly.
|
|
74
|
+
Studio's virtual `@metamesh/project` module isn't available in local Node projects.
|
|
75
|
+
|
|
76
|
+
Save the complete, rendered [standalone example](https://metamesh.studio/docs/develop/standalone-model) as `model.ts`,
|
|
77
|
+
then check and run it:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pnpm exec metamesh typecheck model.ts --kind model
|
|
81
|
+
pnpm exec metamesh run model.ts --kind model
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Both commands check TypeScript types using the nearest project TypeScript configuration, or an
|
|
85
|
+
explicit `--tsconfig`, with strict checking enforced. You can use ordinary local imports and
|
|
86
|
+
installed dependencies. `typecheck` doesn't evaluate your source.
|
|
87
|
+
|
|
88
|
+
Use `--params values.json` for a model's JSON parameter map; the default is `{}`. Models do not
|
|
89
|
+
receive injected Generator services. A standalone module can prepare licensed local fonts before
|
|
90
|
+
constructing its synchronous generation program.
|
|
91
|
+
|
|
92
|
+
To record which local fonts you used, also pass `--font-fixtures fonts.json`. The CLI verifies those
|
|
93
|
+
bytes and records their declared font selections and immutable revisions in the capture; the model
|
|
94
|
+
still prepares its own fonts and receives no injected services. Arbitrary filesystem or network
|
|
95
|
+
reads aren't intercepted, so the CLI can't infer their asset identities. The source fingerprint
|
|
96
|
+
covers bundled source, while fixture descriptors provide explicit asset provenance.
|
|
97
|
+
|
|
98
|
+
## Generator entries
|
|
99
|
+
|
|
100
|
+
Install the Generator SDK alongside Modeling and the CLI to define controls and package metadata:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pnpm add @metamesh/generator-sdk
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
A Generator entry named-exports `definition` and default-exports its module envelope:
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
import { defineGenerator } from "@metamesh/generator-sdk";
|
|
112
|
+
import { defineGeneratorModel } from "@metamesh/generator-sdk/modeling";
|
|
113
|
+
import { box } from "@metamesh/modeling";
|
|
114
|
+
|
|
115
|
+
export const definition = defineGenerator({
|
|
116
|
+
id: "plate",
|
|
117
|
+
version: "0.1.0",
|
|
118
|
+
title: "Plate",
|
|
119
|
+
groups: [],
|
|
120
|
+
parameters: [{ id: "width", label: "Width", type: "number", default: 30, min: 1 }],
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
export default defineGeneratorModel(definition, ({ params, part }) =>
|
|
124
|
+
part("plate", box({ size: [params.width, 20, 6] }))
|
|
125
|
+
);
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
`defineGeneratorModel` from the optional SDK `/modeling` adapter infers controls, prepared services,
|
|
131
|
+
and assertion parameter IDs. It declares the ordinary Modeling program and package identity;
|
|
132
|
+
the host still owns normalization, asset preparation, execution, and cleanup.
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
pnpm exec metamesh typecheck generator.ts --kind generator
|
|
136
|
+
pnpm exec metamesh run generator.ts --kind generator --overrides values.json
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Generator runs merge declared defaults with explicit overrides, then validate strictly. Unknown
|
|
140
|
+
keys, invalid values, and unsupported combinations produce diagnostics. They are not silently
|
|
141
|
+
clamped or repaired. Use assertions for relationships between parameters.
|
|
142
|
+
|
|
143
|
+
Generators with Font controls supply a local font-fixture descriptor with `--font-fixtures fonts.json`.
|
|
144
|
+
Fixtures resolve beside that descriptor and must match their immutable revisions. Missing
|
|
145
|
+
bytes and revision mismatches fail before generation; the CLI does not fetch catalog fonts.
|
|
146
|
+
|
|
147
|
+
## Inspect the captured result
|
|
148
|
+
|
|
149
|
+
Each run creates a unique directory under `.metamesh/runs`, or the explicit output parent. Use the
|
|
150
|
+
run directory reported by that command as `RUN_DIRECTORY` below:
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
pnpm exec metamesh inspect RUN_DIRECTORY
|
|
154
|
+
pnpm exec metamesh inspect RUN_DIRECTORY --part plate
|
|
155
|
+
pnpm exec metamesh export RUN_DIRECTORY --format 3mf --output plate.3mf
|
|
156
|
+
pnpm exec metamesh browser install
|
|
157
|
+
pnpm exec metamesh render RUN_DIRECTORY
|
|
158
|
+
pnpm exec metamesh render RUN_DIRECTORY --views top --format webp --transparent
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
**Inspect and render the same result**
|
|
164
|
+
|
|
165
|
+
Both commands read the captured geometry without rerunning source. Your measurements and images
|
|
166
|
+
describe one completed run, even after its engine session has closed.
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
Inspection reports part IDs, placements, colors, measurements, diagnostics, and execution provenance.
|
|
171
|
+
Captures remain usable when their directory moves. Corrupt or incomplete artifacts are rejected.
|
|
172
|
+
|
|
173
|
+
Rendering requires the separately installed pinned Chromium. It is never downloaded implicitly;
|
|
174
|
+
checking, generation, and inspection work without it. Standard orthographic views are isometric,
|
|
175
|
+
front, top, and right. The default is an isometric 1024 × 1024 PNG on a neutral background. WebP is
|
|
176
|
+
lossless; PNG and WebP both support explicit transparent output. Images record their run, camera,
|
|
177
|
+
renderer, and browser versions. Compare pixels only within the pinned capture environment.
|
|
178
|
+
|
|
179
|
+
`export` reads the completed capture and writes `3mf`, `stl`, or `glb` without rerunning source.
|
|
180
|
+
The required `--output` selects the destination file; the result reports format limitations as
|
|
181
|
+
structured diagnostics. A failed attempt never exposes an older successful result as its output.
|
|
182
|
+
Match the captured parameters and source fingerprint to the revision you intended to verify.
|
|
183
|
+
|
|
184
|
+
## Test models
|
|
185
|
+
|
|
186
|
+
Add Testkit when you want repeatable assertions in your own test runner:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
pnpm add -D @metamesh/testkit
|
|
190
|
+
pnpm exec metamesh docs show testkit/guide/testing
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Testkit runs plain models and Generator entries and supplies geometry assertions. Test the real
|
|
194
|
+
entry point with defaults, limits, and representative combinations. For cached models, exercise
|
|
195
|
+
edits within one session and compare with uncached output; isolated runs cannot verify reuse.
|
|
196
|
+
The installed testing guide owns the runner, fixture, and assertion signatures.
|
|
197
|
+
|
|
198
|
+
Compare bounds in millimetres, area in square millimetres, and volume in cubic millimetres with
|
|
199
|
+
explicit absolute tolerances. Use renders alongside assertions: closed topology alone does not
|
|
200
|
+
establish fit, strength, or adequate wall thickness.
|
|
201
|
+
|
|
202
|
+
Testkit has no compiler, renderer, or browser dependency. The CLI owns those tools and exposes
|
|
203
|
+
reusable Node functions under `@metamesh/cli/authoring` for integrations that don't spawn a command.
|
|
204
|
+
|
|
205
|
+
## Command results
|
|
206
|
+
|
|
207
|
+
Add `--json` for one structured result on stdout; bounded author logs go to stderr. The default
|
|
208
|
+
output is concise text. Exit codes are:
|
|
209
|
+
|
|
210
|
+
- `0`: success;
|
|
211
|
+
- `1`: source, parameter, or generation failure;
|
|
212
|
+
- `2`: invocation, environment, artifact, or tooling failure.
|
|
213
|
+
|
|
214
|
+
Runs default to a 30-second execution deadline and can lower engine resource ceilings.
|
|
215
|
+
|
|
216
|
+
Modeling and the Generator SDK remain independent of the CLI and its local Node tooling.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# `@metamesh/cli`
|
|
2
2
|
|
|
3
|
-
Check
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Check and run MetaMesh models from your terminal. Save generated geometry, inspect its dimensions,
|
|
4
|
+
and render previews from the same result. The `metamesh` command also reads documentation for
|
|
5
|
+
your installed packages, and its tools are available through a Node.js API.
|
|
6
6
|
|
|
7
7
|
> **Preview:** `0.x` minor releases may break compatibility. Patches remain compatible within the
|
|
8
8
|
> same minor line.
|
|
@@ -20,62 +20,78 @@ The executable and Node API require Node.js 24 or newer. The API publishes ES mo
|
|
|
20
20
|
TypeScript source and API consumers need TypeScript 6.0 or newer with `strict` checking and
|
|
21
21
|
`NodeNext` or `Bundler` module resolution. The CLI includes its source-checking compiler.
|
|
22
22
|
|
|
23
|
-
Add Generator SDK
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
Add the [Generator SDK](https://github.com/JasonKoolman/metamesh/blob/main/packages/generator-sdk/README.md)
|
|
24
|
+
to author Generators, or [Testkit](https://github.com/JasonKoolman/metamesh/blob/main/packages/testkit/README.md)
|
|
25
|
+
to import testing helpers directly. Standalone models need neither as a direct dependency.
|
|
26
|
+
Only rendering needs Chromium; checking, generation, and inspection work without a browser.
|
|
26
27
|
|
|
27
28
|
## Local workflow
|
|
28
29
|
|
|
29
|
-
Save a
|
|
30
|
-
|
|
30
|
+
Save this plate with a through hole as `model.ts`:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { box, cylinder, generate } from "@metamesh/modeling";
|
|
34
|
+
|
|
35
|
+
export default generate(({ part }) => {
|
|
36
|
+
const plate = box({ size: [30, 20, 6] });
|
|
37
|
+
const bore = cylinder({ height: 8, radius: 3, sizing: "face" });
|
|
38
|
+
return part("plate", plate.subtract(bore));
|
|
39
|
+
});
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
From the same project, discover the installed packages, check the source, and capture a run:
|
|
31
43
|
|
|
32
44
|
```bash
|
|
33
45
|
pnpm exec metamesh environment --json
|
|
34
46
|
pnpm exec metamesh docs search "sweep"
|
|
35
47
|
pnpm exec metamesh docs show modeling/guide/concepts
|
|
36
48
|
pnpm exec metamesh typecheck model.ts --kind model
|
|
37
|
-
pnpm exec metamesh run model.ts --kind model
|
|
49
|
+
pnpm exec metamesh run model.ts --kind model
|
|
38
50
|
pnpm exec metamesh inspect RUN_DIRECTORY
|
|
51
|
+
pnpm exec metamesh export RUN_DIRECTORY --format 3mf --output plate.3mf
|
|
39
52
|
```
|
|
40
53
|
|
|
41
|
-
Replace `RUN_DIRECTORY` with the path reported by `run`.
|
|
42
|
-
from the current project; use `--project PATH`
|
|
43
|
-
|
|
44
|
-
before generation.
|
|
54
|
+
Replace `RUN_DIRECTORY` with the path reported by `run`. Export that capture as 3MF, STL, or GLB.
|
|
55
|
+
Commands resolve packages and paths from the current project; use `--project PATH`
|
|
56
|
+
to select another. `environment` reports package versions, local documentation, and the supported
|
|
57
|
+
authoring protocol. Version mismatches fail before generation.
|
|
45
58
|
|
|
59
|
+
Local model entries default-export a `ModelProgram` created with Modeling's `generate` helper.
|
|
46
60
|
For Generators, use `--kind generator` with a named `definition` export and a default Generator
|
|
47
|
-
module.
|
|
48
|
-
|
|
49
|
-
|
|
61
|
+
module. Local entries import from the installed packages; Studio's virtual `@metamesh/project`
|
|
62
|
+
module is unavailable here.
|
|
63
|
+
|
|
64
|
+
Use `--params values.json` for a standalone model's complete input map, or
|
|
65
|
+
`--overrides values.json` for a Generator. Generator overrides merge with defaults and undergo
|
|
66
|
+
strict validation. Standalone model parameters pass through directly. The Node API uses the
|
|
67
|
+
matching `params` and `overrides` fields, selected by `kind`.
|
|
50
68
|
|
|
51
69
|
## Authoring tools
|
|
52
70
|
|
|
53
|
-
| Command | Purpose
|
|
54
|
-
| --------------------------- |
|
|
55
|
-
| `environment` | Discover project-local packages, capabilities, and documentation.
|
|
56
|
-
| `docs search` / `docs show` | Find and read exact-version guides and API references offline.
|
|
57
|
-
| `typecheck` | Check TypeScript and entry-point export types without executing the model.
|
|
58
|
-
| `run` | Check and execute source, capture geometry and diagnostics
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
use `--overrides values.json`; those values merge with definition defaults before strict
|
|
74
|
-
validation. The Node API uses the matching `params` and `overrides` fields, discriminated by `kind`.
|
|
71
|
+
| Command | Purpose |
|
|
72
|
+
| --------------------------- | -------------------------------------------------------------------------- |
|
|
73
|
+
| `environment` | Discover project-local packages, capabilities, and documentation. |
|
|
74
|
+
| `docs search` / `docs show` | Find and read exact-version guides and API references offline. |
|
|
75
|
+
| `typecheck` | Check TypeScript and entry-point export types without executing the model. |
|
|
76
|
+
| `run` | Check and execute source, then capture geometry and diagnostics. |
|
|
77
|
+
| `export` | Save a capture as STL, 3MF, or GLB. |
|
|
78
|
+
| `inspect` | Read captured parts, bounds, measurements, and diagnostics. |
|
|
79
|
+
| `render` | Create standard views from a capture. |
|
|
80
|
+
| `setup` | Print skill installation and project-instruction guidance. |
|
|
81
|
+
|
|
82
|
+
`run` executes source in a disposable child process with a 30-second default deadline and saves
|
|
83
|
+
attempts under `.metamesh/runs`. Each capture records the source identity, effective parameters,
|
|
84
|
+
and geometry hashes. `inspect`, `export`, and `render` validate the saved buffers and read that same result
|
|
85
|
+
without rerunning the source.
|
|
86
|
+
|
|
87
|
+
Source runs with your account's permissions. The child process is not a security sandbox; run
|
|
88
|
+
source you trust. Use `--json` for structured stdout; author logs are bounded and sent to stderr.
|
|
89
|
+
Exit codes are 0 for success, 1 for source or generation failure, and 2 for invocation, environment,
|
|
90
|
+
artifact, or tooling failure. Each command's `--help` lists its options and limits.
|
|
75
91
|
|
|
76
92
|
## Render a capture
|
|
77
93
|
|
|
78
|
-
Install the pinned Chromium
|
|
94
|
+
Install the CLI's pinned Chromium version, then choose views of the captured model:
|
|
79
95
|
|
|
80
96
|
```bash
|
|
81
97
|
pnpm exec metamesh browser install
|
|
@@ -97,16 +113,21 @@ if (result.success) {
|
|
|
97
113
|
```
|
|
98
114
|
|
|
99
115
|
`@metamesh/cli/authoring` also exposes environment discovery, documentation lookup, source checking,
|
|
100
|
-
and rendering.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
116
|
+
export, and rendering.
|
|
117
|
+
|
|
118
|
+
For coding agents, `metamesh setup` prints skill installation and project-instruction guidance
|
|
119
|
+
without changing files. The portable `metamesh-developer` skill describes the authoring workflow
|
|
120
|
+
and uses installed package documentation for API details.
|
|
121
|
+
Install a reviewed skill snapshot from
|
|
122
|
+
[`metamesh-studio/metamesh-skills`](https://github.com/metamesh-studio/metamesh-skills) using your
|
|
123
|
+
agent's skill tooling. The [agent guide](https://metamesh.studio/docs/develop/agent-authoring)
|
|
124
|
+
explains how the skills and CLI fit into your own workflow.
|
|
104
125
|
|
|
105
126
|
## Documentation
|
|
106
127
|
|
|
107
128
|
Resolve `@metamesh/cli/docs/manifest.json` for exact-version Markdown guidance and API references,
|
|
108
|
-
or run `pnpm exec metamesh docs show cli/guide/
|
|
109
|
-
[authoring guide](https://
|
|
129
|
+
or run `pnpm exec metamesh docs show cli/guide/local-authoring`. The
|
|
130
|
+
[authoring guide](https://metamesh.studio/docs/develop/cli)
|
|
110
131
|
covers entry contracts, parameters, fonts, captures, and rendering. See
|
|
111
132
|
[Contributing](https://github.com/JasonKoolman/metamesh/blob/main/CONTRIBUTING.md) for package development.
|
|
112
133
|
|