Skip to content

Commit b1b17e0

Browse files
Peter Wangmeta-codesync[bot]
authored andcommitted
update readme
Summary: update readme Reviewed By: zjm-meta Differential Revision: D88068976 Privacy Context Container: L1334777 fbshipit-source-id: de50146f0dd6213364299611c412898f7c0876a2
1 parent 341f39b commit b1b17e0

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

packages/vite-plugin-metaspatial/README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ import { componentDiscoveryXMLPlugin } from '@iwsdk/vite-plugin-metaspatial';
125125
| `outputDir` | `string` | `'public/glxf'` | Directory to output generated GLXF files |
126126
| `watchDebounceMs` | `number` | `500` | Debounce time for file watcher (milliseconds) |
127127
| `formats` | `array` | `['glxf']` | Export formats to generate |
128-
| `metaSpatialCliPath` | `string` | `'/Applications/Meta Spatial Editor.app/Contents/MacOS/CLI'` | Path to Meta Spatial CLI executable |
128+
| `metaSpatialCliPath` | `string` | Platform-specific (see [CLI Path Configuration](#cli-path-configuration)) | Path to Meta Spatial CLI executable. Can also be set via `META_SPATIAL_EDITOR_CLI_PATH` environment variable |
129129
| `verbose` | `boolean` | `false` | Enable verbose logging |
130130
| `enableWatcher` | `boolean` | `true` | Enable file watcher in development mode |
131131
| `ignorePattern` | `RegExp` | `/components\//` | Regex pattern to ignore files/directories |
@@ -163,6 +163,27 @@ Generates:
163163

164164
The `generateGLXF` plugin integrates with Meta Spatial Editor to automatically generate GLXF and GLTF assets from your Meta Spatial projects.
165165

166+
### CLI Path Configuration
167+
168+
The plugin needs to locate the Meta Spatial Editor CLI executable. It uses the following resolution order:
169+
170+
1. **Environment Variable** (highest priority): Set `META_SPATIAL_EDITOR_CLI_PATH` to specify a custom path.
171+
172+
2. **Plugin Option**: Specify `metaSpatialCliPath` in your Vite config
173+
```javascript
174+
generateGLXF({
175+
metaSpatialCliPath: '/custom/path/to/CLI',
176+
})
177+
```
178+
179+
3. **Platform Defaults** (lowest priority):
180+
- **macOS**: `/Applications/Meta Spatial Editor.app/Contents/MacOS/CLI`
181+
- **Windows**: `C:\Program Files\Meta Spatial Editor\v{highest}\Resources\CLI.exe`
182+
- Automatically selects the highest version if multiple versions are installed
183+
- **Linux**: `MetaSpatialEditorCLI` (assumes it's in your system PATH)
184+
185+
> **Note**: The environment variable takes precedence over the plugin option, which takes precedence over platform defaults.
186+
166187
### How It Works
167188

168189
1. **Project Detection**: Scans the `metaSpatialDir` for `.metaspatial` project files

0 commit comments

Comments
 (0)