Command-Line Tools for Authors

VIBE comes with powerful command-line tools that can help you develop and debug templates faster, without needing to run the full web server. You run them from your terminal in the root directory of the VIBE application.

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:

    python app.py validate
    

  • Validate a single, specific template:

    python app.py validate my_template_id
    
    (Where my_template_id is the ID you used in the main config.yml TEMPLATE_SOURCES block).

Example Output:

INFO --- Validation Summary ---
INFO All targeted template(s) validated successfully. count=1
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:

    python app.py validate-components
    

  • Validate a single component:

    python app.py validate-components clauses.indemnity
    

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:

python app.py inspect /path/to/the/user_file.vibestate

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.