Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

voce preview

Compile a Voce IR file and open the result in the default web browser. A convenience command that combines voce compile with a platform-aware browser launch.

Usage

voce preview <FILE>

Arguments

ArgumentDescription
<FILE>Path to a .voce.json IR file (required)

How It Works

  1. Validate – runs the full 9-pass validation suite.
  2. Compile – produces a self-contained HTML file in a temporary location (or dist/ if it exists).
  3. Open – launches the compiled HTML in the default browser using the platform-appropriate command.

Platform Commands

PlatformCommand used
macOSopen <file>
Linuxxdg-open <file>
Windowsstart <file>

Exit Codes

CodeMeaning
0File compiled and browser launch initiated
1Validation failed
2Compilation failed
3Browser could not be opened

Examples

Preview a landing page:

voce preview examples/landing-page.voce.json

Preview after making changes to the IR:

# Edit the IR (or regenerate via AI), then preview
voce preview app.voce.json

Chain with validation for verbose feedback:

voce validate app.voce.json && voce preview app.voce.json

Comparison with compile

voce compilevoce preview
ValidatesYesYes
Writes HTMLTo -o path or dist/To temporary or dist/
Opens browserNoYes
Debug attributes--debug flagNot available
Custom output path-o flagNot available

For production builds, use voce compile. For quick iteration during development, use voce preview.

Notes

  • The preview command always compiles a fresh copy. It does not cache previous builds.
  • Debug attributes (data-voce-id) are not included in preview builds. Use voce compile --debug if you need them, then open the output file manually.
  • If no default browser is configured on Linux, xdg-open may fail silently. Set the BROWSER environment variable as a fallback.
  • The compiled HTML is fully self-contained with no external dependencies, so it renders correctly when opened as a local file.