Basic Usage

    Learn the core commands and workflows for StructKit.

    Subcommands

    • generate — Generate the project structure based on the YAML configuration
    • generate-schema — Generate JSON schema for available structure templates
    • validate — Validate the YAML configuration file
    • info — Display information about a structure definition
    • list — List the available structs
    • init — Initialize a basic .structkit.yaml
    • completion — Manage shell completions
    Terminalbash
    structkit -h

    Generate Command

    Finding Available Structures

    Terminalbash
    structkit list
    
    # With auto-completion
    structkit generate <Tab>

    Using Defaults

    If you have a .structkit.yaml in the current directory:

    Terminalbash
    structkit generate

    Simple Example

    Terminalbash
    structkit generate terraform/modules/generic ./my-terraform-module

    YAML File Usage

    Terminalbash
    # Both of these work identically
    structkit generate my-config.yaml ./output
    structkit generate file://my-config.yaml ./output

    Diff Preview

    Terminalbash
    structkit generate --dry-run --diff file://structure.yaml ./output

    Complete Example

    Terminalbash
    structkit generate \
      --log=DEBUG \
      --dry-run \
      --backup=/path/to/backup \
      --file-strategy=rename \
      --log-file=/path/to/logfile.log \
      terraform-module \
      ./my-terraform-module

    Command Options

    • --log — Set logging level (DEBUG, INFO, WARNING, ERROR)
    • --dry-run — Preview actions without making changes
    • --diff — Show unified diffs for files that would be created/modified
    • --backup — Specify backup directory for existing files
    • --file-strategy — Choose how to handle existing files (overwrite, skip, append, rename, backup)
    • --log-file — Write logs to specified file
    • --mappings-file — Provide external mappings file (can be used multiple times)

    Generate Schema Command

    Terminalbash
    # Generate schema to stdout
    structkit generate-schema
    
    # Save schema to file
    structkit generate-schema -o schema.json
    
    # With custom structures path
    structkit generate-schema -s /path/to/custom/structures -o schema.json

    Other Commands

    Initialize a Project

    Terminalbash
    structkit init
    
    # Or specify a directory
    structkit init ./my-project

    Validate Configuration

    Terminalbash
    structkit validate my-structure.yaml

    List Available Structures

    Terminalbash
    structkit list

    Show Information

    Terminalbash
    structkit info <structure_definition>