Quick Start¶
Quick Start Using Docker¶
- Create a YAML configuration file for your project structure. See sample configuration here.
- Run the following command to generate the project structure:
docker run \
-v $(pwd):/workdir \
-u $(id -u):$(id -g) \
ghcr.io/httpdss/struct:main generate \
file:///workdir/example/structure.yaml \
/workdir/example_output
Quick Start Using Docker Alpine¶
docker run \
-v $(pwd):/workdir \
-u $(id -u):$(id -g) \
ghcr.io/httpdss/struct:alpine generate \
file:///workdir/example/structure.yaml \
/workdir/example_output
For testing, you can run an alpine Docker container and install the script inside it:
Inside the container:
apk add python-pip git vim
pip install git+https://github.com/httpdss/struct.git
mkdir example
cd example/
touch structure.yaml
vim structure.yaml # copy the content from the example folder
struct generate structure.yaml .
Note: The
file://
protocol is automatically added for.yaml
files, sostructure.yaml
andfile://structure.yaml
work identically. Additionally, if your file is named.struct.yaml
in the current directory and you want to generate into the current directory, you can just runstruct generate
.
Discovering Available Structures¶
Before generating, see what structures are available:
This shows all built-in structures you can use.
Auto-Completion
If you've enabled auto-completion, you can press Tab
after struct generate
to see all available structures!
First Example¶
After installing STRUCT, try this simple example:
This will create a new terraform module structure in the ./my-terraform-module
directory.
Or try a simple project structure:
Bootstrap a new project¶
Start with a minimal .struct.yaml:
This writes a basic .struct.yaml with hooks, a README, and a reference to the run-struct workflow.
Next Steps¶
- Learn about YAML Configuration
- Explore Template Variables
- Check out Usage Examples