Skip to content

Conversation

@oleks-dev
Copy link
Owner

Introduce the debugging capabilities, allowing for interactive and detailed control over template execution.

1. Debug Mode

  • Interactive Debugging: Users can now interact with the template execution step-by-step using keyboard inputs (e.g., c to continue, r to repeat steps, l to list variables, s to show steps, etc.).
  • Dynamic Reloading: If the template changes during execution, the system detects this between the steps and reloads the template, ensuring up-to-date processing.

2. Variable Handling

  • prepare_variables Method moved out from engine:
    • Processes CLI options and environment variables to populate template variables.
    • Ensures required variables are present, raising errors if missing.
    • Uses replace_env_vars to substitute environment variables into default values.

3. Debug Output

  • console_print_debug: Prints debug messages with a [debug] prefix for clarity.
  • models_equal: Compares two models (e.g., template models) for equality, useful during template reloading or validation.

4. Test Coverage for Debug Features

  • New Test Cases:
    • Simulate key presses (c, r, l, s, h) to verify debug mode interactions.
    • Ensure the tool handles dynamic template changes and provides expected debug outputs.

@oleks-dev oleks-dev merged commit 91465af into main Oct 12, 2025
6 checks passed
@oleks-dev oleks-dev deleted the debug_mode branch October 12, 2025 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants