Skip to content

The template generator built for platform teams

Boilerplate is an open source template generator by Gruntwork. Define your _boilerplate_ once, then generate code repeatedly with a single command.

Define a boilerplate.yml with your variables, write Go-template files, and run one command. Boilerplate handles prompts, defaults, validation, and rendering.

boilerplate.yml
variables:
- name: ProjectName
description: The name of your project
type: string
- name: EnableDocker
description: Include Docker configuration?
type: bool
default: true

Boilerplate is designed for platform teams who need to generate infrastructure code, create app starter templates, enforce standards, and automate workflows across an entire organization.

Run it anywhere

Boilerplate is a single Go binary with zero runtime dependencies. Download it, run it on your laptop, in CI/CD, or in a container. No Python, no Node, no version conflicts.

Easily capture variables

Boilerplate accepts variable values interactively, from the CLI, via YAML files, or through environment variables.

Build powerful templates

Boilerplate extends Go templates to include serious templating power including 40+ built-in functions, partials, conditionals, capturing shell command output, and more.

And there's more

  • Composable templates — Build complex scaffolds from smaller, reusable templates using the dependency system.
  • Variable validation — Seven variable types with built-in validators including required, regex, email, URL, and semver.
  • Hooks — Run shell commands before or after rendering to format code, install dependencies, or run tests.
  • Remote templates — Fetch templates from Git repos, S3, GCS, or HTTP URLs.
  • Snippets — Embed code from source files in generated docs to keep examples always in sync.
  • Non-interactive mode — Run fully headless in CI/CD pipelines with --non-interactive, --var-file, and environment variables.