{"id":40892275,"url":"https://github.com/staticaland/boilerplate-compose","last_synced_at":"2026-01-22T02:10:18.680Z","repository":{"id":309385730,"uuid":"1036045429","full_name":"staticaland/boilerplate-compose","owner":"staticaland","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-14T21:24:19.000Z","size":67,"stargazers_count":1,"open_issues_count":4,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-19T11:38:37.996Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/staticaland.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-11T13:30:29.000Z","updated_at":"2025-08-14T21:24:23.000Z","dependencies_parsed_at":"2025-08-11T16:32:02.951Z","dependency_job_id":"7324fb54-7bb4-4f2b-a6cc-43bc54fd5d70","html_url":"https://github.com/staticaland/boilerplate-compose","commit_stats":null,"previous_names":["staticaland/boilerplate-compose"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/staticaland/boilerplate-compose","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticaland%2Fboilerplate-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticaland%2Fboilerplate-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticaland%2Fboilerplate-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticaland%2Fboilerplate-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/staticaland","download_url":"https://codeload.github.com/staticaland/boilerplate-compose/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/staticaland%2Fboilerplate-compose/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28650894,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-22T02:10:17.914Z","updated_at":"2026-01-22T02:10:18.664Z","avatar_url":"https://github.com/staticaland.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# boilerplate-compose\n\nA CLI tool for composing multiple boilerplate templates into a single project setup. Define multiple templates in a YAML configuration file and generate them all at once.\n\n## Features\n\n- **YAML Configuration**: Define multiple templates in a single configuration file\n- **Environment Variables**: Support for variable interpolation using `${VAR}` syntax with .env files\n- **Template Variables**: Support for template variables and variable files\n- **Real Execution**: Execute boilerplate CLI with streaming output and error handling\n- **Dry Run Mode**: Preview commands without executing them\n- **Execution Reporting**: Detailed execution summaries with timing and success/failure counts\n- **Flexible Configuration**: Support for includes, extends, and various template options\n- **Validation**: Built-in configuration validation with clear error messages\n- **Auto-discovery**: Automatically finds `boilerplate-compose.yaml` or `boilerplate-compose.yml` files\n\n## Prerequisites\n\n[Boilerplate CLI](https://github.com/gruntwork-io/boilerplate) installed and available in PATH. With [Mise](https://mise.jdx.dev/dev-tools/backends/aqua.html):\n\n```\nmise use -g aqua:gruntwork-io/boilerplate\n```\n\n## Installation\n\n```bash\ngo build -o boilerplate-compose\n```\n\n## Usage\n\n### Basic Usage\n\n```bash\n# Use default config file (boilerplate-compose.yaml or boilerplate-compose.yml)\n./boilerplate-compose\n\n# Specify a config file\n./boilerplate-compose -f my-compose.yaml\n\n# Dry run - preview commands without executing\n./boilerplate-compose -dry-run\n\n# Verbose output - show detailed boilerplate CLI output\n./boilerplate-compose -verbose\n\n# Custom boilerplate CLI path\n./boilerplate-compose -boilerplate-path /usr/local/bin/boilerplate\n\n# Show version\n./boilerplate-compose -version\n\n# Show help\n./boilerplate-compose -help\n\n# Use custom environment file\n./boilerplate-compose -env-file production.env\n```\n\n### Command Line Options\n\n- `-f`: Path to compose configuration file\n- `-dry-run`: Show what commands would be executed without running them\n- `-verbose`: Show detailed output from boilerplate CLI commands\n- `-boilerplate-path`: Path to boilerplate CLI executable (defaults to PATH lookup)\n- `-env-file`: Path to .env file (defaults to .env in current directory)\n- `-version`: Show version information\n- `-help`: Show help message\n\n### Configuration File\n\nCreate a `boilerplate-compose.yaml` file:\n\n```yaml\ntemplates:\n  frontend:\n    template-url: \"https://github.com/example/react-template\"\n    output-folder: \"./frontend\"\n    vars:\n      project_name: \"my-app\"\n      author: \"john-doe\"\n    non-interactive: true\n\n  backend:\n    template-url: \"https://github.com/example/go-api-template\"\n    output-folder: \"./backend\"\n    var-file: \"backend-vars.yaml\"\n    missing-key-action: \"error\"\n```\n\n### Template Configuration Options\n\nEach template supports the following options:\n\n- `template-url` (required): URL to the template repository\n- `output-folder` (required): Where to generate the template\n- `vars`: Key-value pairs for template variables\n- `var-file`: Path to YAML file with variables (can be string or array)\n- `non-interactive`: Skip interactive prompts\n- `missing-key-action`: Action when template variables are missing (\"error\", \"skip\", etc.)\n- `missing-config-action`: Action when config is missing\n- `no-hooks`: Disable template hooks\n- `no-shell`: Disable shell execution\n- `disable-dependency-prompt`: Skip dependency installation prompts\n\n### Advanced Configuration\n\n```yaml\ntemplates:\n  app:\n    template-url: \"https://github.com/example/app-template\"\n    output-folder: \"./app\"\n    var-file:\n      - \"common-vars.yaml\"\n      - \"app-specific-vars.yaml\"\n\n# Include other compose files\ninclude:\n  - path: \"shared-templates.yaml\"\n\n# Extend from another compose file\nextends:\n  file: \"base-compose.yaml\"\n  template: \"base-template\"\n```\n\n## Environment Variables\n\n`boilerplate-compose` supports environment variable interpolation using Docker Compose-style `${VAR}` syntax, similar to [Docker Compose variable interpolation](https://docs.docker.com/compose/how-tos/environment-variables/variable-interpolation/).\n\n### .env File Support\n\nCreate a `.env` file in your project root:\n\n```bash\n# .env\nTAG=v1.5\nPROJECT_NAME=my-awesome-project\nAUTHOR=john-doe\nBACKEND_VERSION=2.0.0\nTEMPLATE_REPO=https://github.com/example\n```\n\n### Variable Interpolation in Compose Files\n\nUse `${VAR}` syntax in your compose file:\n\n```yaml\n# boilerplate-compose.yaml\ntemplates:\n  frontend:\n    template-url: \"${TEMPLATE_REPO}/react-template\"\n    output-folder: \"./frontend\"\n    vars:\n      project_name: \"${PROJECT_NAME}\"\n      author: \"${AUTHOR}\"\n      version: \"${TAG}\"\n    non-interactive: true\n\n  backend:\n    template-url: \"${TEMPLATE_REPO}/go-api-template\"\n    output-folder: \"./backend\"\n    vars:\n      project_name: \"${PROJECT_NAME}\"\n      author: \"${AUTHOR}\"\n      version: \"${BACKEND_VERSION}\"\n    no-hooks: true\n```\n\n### Environment File Options\n\n```bash\n# Use default .env file (if it exists)\n./boilerplate-compose\n\n# Specify custom environment file\n./boilerplate-compose -env-file production.env\n\n# Multiple environment files (system env + file)\n# System environment variables are loaded first,\n# then .env file variables override them\nexport PROJECT_NAME=override-name\n./boilerplate-compose -env-file production.env\n```\n\n### Variable Resolution Order\n\n1. **System environment variables** are loaded first\n2. **Environment file variables** (`.env` or `-env-file`) override system variables\n3. **Missing variables** remain as `${VAR}` in the output (no error)\n\n### Examples\n\n**Example 1: Development vs Production**\n\n```bash\n# Development (.env)\nTAG=dev\nTEMPLATE_REPO=https://github.com/dev-templates\n\n# Production (production.env)\nTAG=v2.0\nTEMPLATE_REPO=https://github.com/prod-templates\n\n# Use development environment\n./boilerplate-compose\n\n# Use production environment\n./boilerplate-compose -env-file production.env\n```\n\n**Example 2: Complex Variable Usage**\n\n```yaml\ntemplates:\n  web:\n    template-url: \"${TEMPLATE_REPO}/webapp-template\"\n    output-folder: \"./apps/${PROJECT_NAME}\"\n    vars:\n      app_name: \"${PROJECT_NAME}-web\"\n      version: \"${TAG}\"\n      db_host: \"${DB_HOST:-localhost}\"  # Note: default values not supported yet\n```\n\n## Development\n\n### Running Tests\n\n```bash\n# Run all tests\ngo test ./...\n\n# Run tests with verbose output\ngo test ./... -v\n\n# Run specific package tests\ngo test ./config -v\n```\n\n### Project Structure\n\n```\n.\n├── main.go                    # CLI entry point\n├── config/\n│   ├── types.go              # Configuration data structures\n│   ├── loader.go             # YAML parsing and validation\n│   ├── types_test.go         # Type tests\n│   └── loader_test.go        # Loader tests\n├── processor/\n│   ├── template.go           # Template processing logic\n│   ├── orchestrator.go       # Template orchestration\n│   ├── template_test.go      # Template tests\n│   └── orchestrator_test.go  # Orchestrator tests\n├── executor/\n│   ├── cli.go                # CLI execution with streaming\n│   ├── result.go             # Execution result tracking\n│   ├── cli_test.go           # CLI executor tests\n│   └── result_test.go        # Result tests\n├── example-compose.yaml       # Example configuration\n└── boilerplate-compose.yaml  # Default config file\n```\n\n### Execution Output\n\nWhen running templates, boilerplate-compose provides detailed execution reporting:\n\n```\n2025/08/11 16:55:46 Processing 3 templates\n2025/08/11 16:55:46 Processing template: frontend\n2025/08/11 16:55:46 Processing template: backend\n2025/08/11 16:55:46 Processing template: docs\n\n=== Execution Summary ===\nTotal templates: 3\nSuccessful: 3\nFailed: 0\nTotal duration: 47.75µs\n\nTemplate execution times:\n  ✓ frontend: 28.708µs\n  ✓ backend: 6.958µs\n  ✓ docs: 8.333µs\n\nAll templates processed successfully.\n```\n\n### Dry Run Output\n\nUse `-dry-run` to preview what commands will be executed:\n\n```\n=== Template: frontend ===\nCommand that would be executed:\nboilerplate --template-url https://github.com/example/react-template --output-folder ./frontend --var project_name=my-react-app --var author=john-doe --var version=1.0.0 --non-interactive --missing-key-action zero\n\nTemplate details:\n  URL: https://github.com/example/react-template\n  Output: ./frontend\n  Variables:\n    project_name = my-react-app\n    author = john-doe\n    version = 1.0.0\n\n=== Execution Summary ===\nTotal templates: 3\nSuccessful: 3\nFailed: 0\nTotal duration: 47.75µs\n\nTemplate execution times:\n  ✓ frontend: 28.708µs\n  ✓ backend: 6.958µs\n  ✓ docs: 8.333µs\n\nDry run completed. Use without -dry-run to execute.\n```\n\n### Error Handling\n\n- **CLI Validation**: Checks if boilerplate CLI is available before execution\n- **Stop on Failure**: Execution stops on first template failure (unless in dry-run mode)\n- **Clear Error Messages**: Detailed error reporting with template context\n- **Execution Summary**: Shows which templates succeeded or failed\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaticaland%2Fboilerplate-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstaticaland%2Fboilerplate-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstaticaland%2Fboilerplate-compose/lists"}