Installation & Setup
Welcome to Lesson 1.2! In this lesson, you'll set up your HoloScript development environment and verify everything is working correctly.
Prerequisites
Before starting, ensure you have:
- Node.js 18.0 or higher
- A code editor (VS Code recommended)
- A VR headset (optional for testing, but recommended)
Installing HoloScript
Using npm (Recommended)
bash
npm install -g @holoscript/cliUsing pnpm
bash
pnpm add -g @holoscript/cliUsing yarn
bash
yarn global add @holoscript/cliVerify Installation
After installation, verify HoloScript is working:
bash
holoscript --version
# Output: holoscript 1.0.0
holoscript help
# Shows available commandsVS Code Extension
Install the HoloScript VS Code extension for the best development experience:
- Open VS Code
- Press
Ctrl+Shift+X(Cmd+Shift+X on Mac) - Search for "HoloScript"
- Click "Install" on the official extension
Features Included
- Syntax highlighting for
.hs,.hsplus, and.holofiles - IntelliSense with auto-completion for traits and properties
- Error diagnostics showing problems as you type
- Code formatting with a single keystroke
- Hover documentation for traits and built-in functions
Create Your First Project
Let's create a new HoloScript project:
bash
# Create a new directory
mkdir my-first-vr-scene
cd my-first-vr-scene
# Initialize the project
holoscript init
# This creates:
# .
# ├── holoscript.config.json
# ├── package.json
# ├── src/
# │ └── main.holo
# └── assets/Project Structure
my-first-vr-scene/
├── holoscript.config.json # Project configuration
├── package.json # npm dependencies
├── src/
│ ├── main.holo # Entry point
│ └── components/ # Reusable components
└── assets/
├── models/ # 3D models (.glb, .gltf)
├── textures/ # Images and textures
└── audio/ # Sound filesConfiguration File
The holoscript.config.json file contains your project settings:
json
{
"name": "my-first-vr-scene",
"version": "1.0.0",
"entry": "src/main.holo",
"targets": ["web", "oculus", "steamvr"],
"compiler": {
"strictMode": true,
"optimizations": true
},
"linter": {
"rules": {
"no-unused": "warn",
"require-geometry": "error"
}
}
}Running the Dev Server
Start the development server to see your scene:
bash
holoscript dev
# ✓ Server running at http://localhost:3000
# ✓ Hot reload enabled
# ✓ WebXR availableOpen http://localhost:3000 in a WebXR-compatible browser.
Connecting Your VR Headset
Oculus Quest
- Enable Developer Mode on your Quest
- Connect via USB or use Air Link
- Open the Oculus Browser
- Navigate to
http://your-computer-ip:3000 - Click "Enter VR"
SteamVR
- Start SteamVR
- Open a web browser in VR
- Navigate to
http://localhost:3000 - Click "Enter VR"
Troubleshooting
"holoscript: command not found"
bash
# Verify npm global bin is in PATH
npm bin -g
export PATH="$PATH:$(npm bin -g)"WebXR Not Available
Ensure you're using a compatible browser:
- Chrome 79+ on Windows/Android
- Firefox with WebXR enabled
- Oculus Browser on Quest
Port Already in Use
bash
holoscript dev --port 3001Quiz
Test your understanding:
- What command installs HoloScript globally?
- Which file types does HoloScript support?
- What port does the dev server use by default?
- Where should you put 3D model files?
- What file is the project configuration stored in?
Answers
npm install -g @holoscript/cli.hs,.hsplus, and.holo- Port 3000
assets/models/holoscript.config.json
Next Steps
In the next lesson, you'll create your first VR scene with interactive objects.
Estimated time: 20 minutes
Difficulty: ⭐ Beginner
Next: Lesson 1.3 - Your First Scene