Skip to content

Writing the .struct.yaml file

Kenneth Belitzky edited this page Jun 17, 2025 · 1 revision

Description

STRUCT can generate the content through 2 methods:

  1. Calling out the structures to a destination directory
struct generate configs/codeowners <destination_directory>
  1. Writing the structures to a .struct.yaml file generally located in the root of your project.
files:
  - README.md:
      content: |
        # My Project
        This is a sample project.
folders:
  - ./:
    struct:
      - configs/codeowners

Sections inside the .struct.yaml file

📄 files

The files section is used to define the list of file paths that STRUCT will generate or modify. Each file can define a content block, use the file keyword to get content from remote location or use user_prompt to specify a prompt that will be sent to OpenAI to generate the content of the file.

Example of files block

files:
  - README.md:
      content: |
        # My Project
        This is a sample project.
  - LICENSE:
      file: https://raw.githubusercontent.com/httpdss/struct/main/LICENSE
  - CONTRIBUTING.md:
      user_prompt: "Write a contributing guide for my project"

📁 folders

The folders section is used to define the list of folders that STRUCT will process. Each folder can have a struct key that lists the structures to be applied to that folder. The structure can be a specific structure name (custom or built-in). You can also use the with keyword to specify the values for the variables defined in the variables section.

Example of folders block

folders:
  - ./:
    struct:
      - configs/codeowners
      - github/templates
    with:
      app_name: "MyApp"

⚙️ variables

The variables section is used to define variables that can be used in the files. These variables can be referenced in the content of the files using the {{@ variable_name @}} syntax. This allows for dynamic content generation based on the values of the variables.

Example of variables block

variables:
  - app_name:
      description: "The name of the application"
      default: "MyApp"
Clone this wiki locally