Package Exports
- valence-cli
- valence-cli/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (valence-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Valence CLI
The ultimate scaffolding tool for hybrid 3D applications.
Valence CLI automates the creation and management of high-performance desktop applications using Angular, Electron, and Babylon.js. It provides a robust, pre-configured environment with TypeScript support, build orchestration, and "production-ready" defaults.
🚀 Installation
npm install -g valence-cli✨ Quick Start
Create a new project with the Valence Identity template (includes 3D scene, SVG logo, and debug HUD):
valence new my-game
cd my-game
valence start🛠 Commands
valence new <name>
Scaffolds a new high-performance project. You will be prompted to select your engine:
- 3D (Babylon.js): Full 3D capabilities with Havok Physics, XR, and Inspector support.
- 2D (Phaser): Fast 2D game engine with configured scenes and arcade physics.
Both environments include:
- Angular: Latest CLI, SCSS, Routing.
- Electron: TypeScript Main/Preload processes, securely configured.
- Forge: Configured for building
.exe/.zip/ installers. - Valence UI: Premium glassmorphic HUD with FPS and status tracking.
valence start
Runs the application in Development Mode:
- Cleans previous builds.
- Builds Angular (Dev config).
- Compiles Electron (TypeScript).
- Launches Electron window with live reload enabled.
valence build
Compiles the application for Production:
- Outputs to
dist/browser(Angular) anddist/electron(Main Process). - Optimizes assets.
- Enforces relative paths (
baseHref="./") for Electron compatibility.
valence test
Runs the project's automated test suite (if configured).
valence package
Packages the application for distribution:
- Runs
valence build. - Executes Electron Forge to generate installers (e.g., Windows Squirrel.exe, Zip).
- Artifacts saved to
out/.
valence publish
Automates the release pipeline:
- Bumps project version (patch).
- Updates
README.mdversion badges. - Builds & Packages.
- Generates
RELEASES_README.mdentry. - Publishes via Electron Forge.
🎮 Gameplay Services
Valence can automatically inject core game systems into your project.
valence add <feature>
Core Systems
input: Unified Action Mapping (Keyboard/Gamepad) via Angular Signals.audio: Channel-based audio manager (Master/Music/SFX) using Howler.js.storage: Secure, atomic file I/O for save games (Write-Temp-Rename pattern) via Electron IPC.settings: Centralized configuration manager (Audio/Graphics) persisted to storage.state: Strict Game State Machine (Boot, Menu, Gameplay, Paused) via Signals.
3D Features (Babylon.js)
physics: Installs Havok engine (WASM) & initializes physics.inspector: Installs & binds Babylon Inspector toCtrl+I.gui: Installslil-guidebug panel.materials: Installs@babylonjs/materials.skybox: Creates environmental skybox.xr: Initializes WebXR (VR/AR) experience.
Universal Features
tailwind: Configures TailwindCSS with Angular.multiplayer: Scaffolds Colyseus server & client.pipeline: Enables Asset Optimization Pipeline (sharp).native: Scaffolds Rust (Neon) native module.
🎲 Generators
valence generate scene <name>
Alias: valence g scene <name>
Scaffolds a new Scene component:
- 3D: Pre-wired Babylon.js
Scenewith Camera/Light/Resize handling. - 2D: Pre-wired Phaser
Sceneclass with lifecycle methods.
valence generate bridge <name>
Alias: valence g bridge <name>
Generates a type-safe IPC communication channel:
- Main Process: Registers
ipcMain.handle. - Preload: Exposes
contextBridgeAPI. - Service: Creates Angular service wrapper.
valence codegen assets
Scans src/assets and generates typed constants in core/asset-keys.ts for IntelliSense.
🩺 Diagnostics
valence doctor
Diagnoses your development environment (Node, NPM, Git).
valence verify
Performs deep health check of project structure and configuration.