@iwsdk/create
v0.3.1
Published
Interactive CLI to scaffold Immersive Web SDK starter apps
Downloads
207
Maintainers
Readme
Quick Start
npm create @iwsdk@latestOr with other package managers:
# pnpm
pnpm create @iwsdk@latest
# yarn
yarn create @iwsdk
# bun
bun create @iwsdkInteractive Prompts
The CLI will guide you through:
- Project name - Directory name for your new project
- Language - TypeScript or JavaScript
- Platform - VR (Virtual Reality) or AR (Augmented Reality)
- XR Features - Hand tracking, layers, anchors, hit-test, plane/mesh detection (tri-state: No/Optional/Required)
- SDK Features - Locomotion (VR), Scene Understanding (AR), Grabbing, Physics
- Meta Spatial Editor - Optional visual scene authoring integration
- Git & Install - Initialize git repo and install dependencies
What You Get
A fully configured project with:
- ⚡ Vite - Fast dev server with HMR
- 🎮 WebXR Emulator - Develop without VR hardware
- 📦 GLTF Optimization - Automatic asset compression
- 🔒 HTTPS - Required for WebXR, auto-configured
- 🏗️ Meta Spatial Editor - Visual scene authoring (optional)
Example
$ npm create @iwsdk@latest
===============================================
IWSDK Create CLI v0.2.2
Node v20.19.0
? Project name › iwsdk-app
? Which language do you want to use? › TypeScript
? What type of experience are you building? › Virtual Reality
? Enable Hand Tracking? › Optional
? Enable WebXR Layers? › Optional
? Enable locomotion? › Yes
? Deploy locomotion engine on a Worker? › Yes (recommended)
? Enable grabbing (one/two-hand, distance)? › Yes
? Enable physics simulation (Havok)? › No
? Enable Meta Spatial Editor integration? › No (Can change later)
? Set up a Git repository? › Yes
? Install dependencies now? › YesCommand Line Options
# Provide project name directly
npm create @iwsdk@latest my-app
# Skip all prompts and use defaults
npm create @iwsdk@latest my-app -- -y
# Use custom CDN for recipes/assets
npm create @iwsdk@latest -- --assets-base https://my-cdn.com/iwsdk| Flag | Description |
| --------------------- | -------------------------------------------------------- |
| [name] | Project name (first positional argument) |
| -y, --yes | Skip prompts and use defaults (VR + TypeScript + manual) |
| --assets-base <url> | Custom CDN base URL for recipes and assets |
Generated Templates
Based on your choices, one of these variants is generated:
| Template ID | Description |
| ------------------- | ------------------------------------- |
| vr-manual-ts | VR + TypeScript + code-only scene |
| vr-manual-js | VR + JavaScript + code-only scene |
| vr-metaspatial-ts | VR + TypeScript + Meta Spatial Editor |
| vr-metaspatial-js | VR + JavaScript + Meta Spatial Editor |
| ar-manual-ts | AR + TypeScript + code-only scene |
| ar-manual-js | AR + JavaScript + code-only scene |
| ar-metaspatial-ts | AR + TypeScript + Meta Spatial Editor |
| ar-metaspatial-js | AR + JavaScript + Meta Spatial Editor |
Requirements
- Node.js 20.19.0 or higher
Documentation
For guides and tutorials, visit: https://iwsdk.dev
License
MIT © Meta Platforms, Inc.
Local Development
# Build the CLI
pnpm --filter @iwsdk/create build
# Run locally
pnpm --filter @iwsdk/create devModule Layout
src/cli.ts— Entrypoint: parses flags, runs prompts, scaffolds projectsrc/prompts.ts— Interactive questions and defaultssrc/recipes.ts— Fetch helpers for CDN-hosted recipessrc/scaffold.ts— Wraps Chef'sbuildProjectand writes filessrc/installer.ts— Dependency installation and next stepssrc/types.ts— Shared types (VariantId,TriState,PromptResult)
How It Works
The CLI uses @pmndrs/chef to apply recipes fetched from jsDelivr CDN. Recipes and assets live in the @iwsdk/starter-assets package.
