Command-Line Tools for Authors¶
VIBE comes with powerful command-line tools that can help you develop and debug templates faster. You run them from your terminal in the root directory of the VIBE application.
Running the Server (run)¶
Starts the VIBE web server so you can test your templates in a browser.
By default, the server starts on port 5001 with debug mode enabled. You can customize this:
vibe run --port 8000 # Use a different port
vibe run --no-debug # Disable debug mode
vibe run --use-reloader # Auto-restart when files change
Once running, open http://127.0.0.1:5001/ (or your custom port) in a web browser to see the template selection page.
Creating a New Template (create)¶
Generates a new template skeleton with a starter config.yml and template.md, and registers it in the main config.yml.
This creates a folder under templates/my-new-template/ with a basic working template that you can start editing right away. The template name is automatically converted to a URL-friendly slug.
Validating Templates (validate)¶
This is the most important tool for an author. It runs a full static analysis on your template and questions, checking for common errors like undefined variables, mismatched types, and invalid syntax.
How to Run:
-
Validate all templates:
-
Validate a single, specific template:
(Where
my_template_idis the ID you used in the mainconfig.ymlTEMPLATE_SOURCESblock).
Options:
--detailsor-d: Show detailed error and warning messages with line numbers.--verboseor-v: Show debug/info logs during validation.
Example Output:
If errors are found, they will be printed with the file name and line number, helping you fix them quickly. Running validate often can save you a lot of time.
Validating Components (validate-components)¶
This command works just like validate, but it specifically targets and validates your reusable components.
How to Run:
-
Validate all discovered components:
-
Validate a single component:
-
Validate components within a specific template:
Inspecting Saved State (inspect)¶
Sometimes a user might send you a .vibestate file that they saved from an interview. The inspect tool lets you securely open and view the contents of this file to see exactly what answers they provided.
How to Run:
Output: The tool will print a clean summary of the saved state, including:
- The template ID and version.
- Which questions were asked.
- A neatly formatted list of all the answers in the
current_state.
Security Warning:
By default, inspect verifies the file's digital signature to ensure it hasn't been tampered with. If the signature is invalid, it will refuse to open the file. If you are absolutely certain the file is from a trusted source and want to inspect it anyway, you can use the --no-verify flag, but do so with extreme caution.
Testing Template Expressions (eval)¶
An interactive environment for testing Jinja expressions against your template's questions and data. This is useful for verifying that your template logic works as expected before running the full server.
How to Run:
This opens an interactive prompt where you can type Jinja expressions and see their output immediately:
Options:
--templateor-t: Load a template's questions as context variables.--stateor-s: Load a.vibestatefile to use real saved answers.--set VAR=VALUE: Set a variable value (repeatable, supports dot notation like--set 'address.city=Stockholm').--localeor-l: Set the locale for linguistic filters (e.g.,--locale sv).
Interactive Commands:
| Command | Description |
|---|---|
$vars |
List all variables in the current context |
$questions |
Show the template's question definitions |
$context |
Pretty-print the full context tree |
$locale |
Show the current locale |
$locale = sv |
Change the locale dynamically |
$reload |
Reload the template and/or state from disk |
$help |
Show all available commands |
$exit |
Exit the REPL |
Scaffolding UI Overrides (scaffold)¶
Copies stock UI template files or CSS into your template bundle so you can customize them. This saves you from having to find and copy the built-in files manually.
How to Run:
-
List available files you can override:
-
Copy specific files into your template's override folder:
-
Overwrite existing overrides:
After scaffolding, edit the copied files in your template's ui/ directory. See the UI Customization Guide for details on what you can override and how.