Skip to content

Display variable descriptions in interactive mode prompts #116

Closed

Description

@httpdss

Feature Request: Display Variable Descriptions in Interactive Mode

Current Behavior

When running struct generate in interactive mode, users are prompted for missing variables with only the variable name and default value:

❓ Enter value for my_variable [default_value]: 

Desired Behavior

When a variable has a description field in the YAML configuration, it should be displayed in the interactive prompt to help users understand what the variable is for:

❓ Enter value for my_variable [default_value]: 
   Description: The name of your project

Example Configuration

variables:
  - project_name:
      type: string
      description: "The name of your project"
      default: "MyProject"
  - environment:
      type: string
      description: "Target deployment environment"
      enum: ["dev", "staging", "prod"]
      default: "dev"

Expected Output

❓ Enter value for project_name [MyProject]: 
   Description: The name of your project
❓ Enter value for environment [dev] (1) dev, (2) staging, (3) prod: 
   Description: Target deployment environment

Implementation Notes

  • The change should be in struct_module/template_renderer.py in the prompt_for_missing_vars method
  • Should support both description and help fields (for backward compatibility)
  • Should only display the description if it exists in the variable configuration
  • Should maintain current functionality for variables without descriptions
  • Should work for both regular variables and enum variables

Benefits

  • Improved user experience in interactive mode
  • Better understanding of what each variable represents
  • More self-documenting configurations
  • Reduces need to check YAML file while running interactive generation

Activity

  1. added a commit that references this issue on Sep 22, 2025
    e1be8ba
  2. added a commit that references this issue on Oct 25, 2025
    3a7450f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions