-
-
Notifications
You must be signed in to change notification settings - Fork 2
Writing the .struct.yaml file
STRUCT can generate the content through 2 methods:
- Calling out the structures to a destination directory
struct generate configs/codeowners <destination_directory>- Writing the structures to a
.struct.yamlfile generally located in the root of your project.
files:
- README.md:
content: |
# My Project
This is a sample project.
folders:
- ./:
struct:
- configs/codeownersThe 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.
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"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.
folders:
- ./:
struct:
- configs/codeowners
- github/templates
with:
app_name: "MyApp"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.
variables:
- app_name:
description: "The name of the application"
default: "MyApp"