Skip to content

Quick Start

Quick Start Using Docker

  1. Create a YAML configuration file for your project structure. See sample configuration here.
  2. 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:

docker run -it --entrypoint="" python:3.10-alpine sh -l

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, so structure.yaml and file://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 run struct generate.

Discovering Available Structures

Before generating, see what structures are available:

struct list

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:

struct generate terraform/modules/generic ./my-terraform-module

This will create a new terraform module structure in the ./my-terraform-module directory.

Or try a simple project structure:

struct generate project/nodejs ./my-node-app

Bootstrap a new project

Start with a minimal .struct.yaml:

struct init

This writes a basic .struct.yaml with hooks, a README, and a reference to the run-struct workflow.

Next Steps