User Guide¶
Learn how to use Cultivator to automate Terragrunt workflows in CI and locally.
Sections¶
- Features - What Cultivator can do
- CLI Reference - How to use Cultivator commands
- GitHub Actions - Integrate with GitHub Actions
- GitLab Pipelines - Integrate with GitLab CI/CD
- Configuration - Configure your setup
Quick Overview¶
Cultivator is a lightweight CLI that discovers Terragrunt stacks and orchestrates execution:
- Call cultivator
- Discovers stacks
- Applies filters
- Executes Terragrunt
- Shows results
Use Cases¶
Local Development¶
Run plans locally to validate changes before committing:
Pull Request CI¶
Test changes safely on PRs—no approval required until review:
# GitHub Actions or GitLab CI can run this automatically
cultivator plan --root=live --env=dev --non-interactive
Main Branch Deployment¶
Apply approved changes after merging to main:
Cross-Environment Promotion¶
Test in one environment, apply in others:
# Test in staging
cultivator plan --root=live --env=staging --tags=critical
# Apply to production after manual approval
cultivator apply --root=live --env=prod --tags=critical --auto-approve
Key Concepts¶
Stack Discovery¶
Cultivator recursively walks the root directory, finds all terragrunt.hcl files, and maintains a registry of available stacks.
Scope Filters¶
Use multiple filters to narrow execution:
--env=dev- by environment name--include=envs/prod/* --include=envs/staging/*- by path pattern--exclude=experimental- exclude paths--tags=critical,prod- by inline tags (recommended:# cultivator:tags = critical,prod)
Dependency Ordering¶
Cultivator parses dependency blocks in Terragrunt configs and runs stacks in the correct order automatically.
Parallelism¶
Run independent stacks concurrently. Default: number of CPUs. Override with --parallelism=N.
Integration Paths¶
GitHub Actions¶
Add a workflow file to run Cultivator on PR and main branch:
- See GitHub Actions for setup and examples
- Features: matrix strategies, secrets integration, caching, artifacts
GitLab CI/CD¶
Define jobs in .gitlab-ci.yml to orchestrate Cultivator:
- See GitLab Pipelines for setup and examples
- Features: parallel jobs, dependency stages, caching, environment-based deployment
Local CLI Usage¶
Run Cultivator directly in your terminal:
- Build from source or download binary
- Execute:
./cultivator plan --root=live --env=dev - Review output and commit changes
Getting Help¶
- Features - Explore what Cultivator can do
- CLI Reference - Deep dive into commands, flags, and exit codes
- Configuration - Full config file reference
- FAQ - Common questions answered
- Architecture - Understand how Cultivator works