Skip to content

CLI Reference

TerraCi command-line interface reference.

Global Options

These options are available for all commands:

FlagShortDescription
--config-cPath to configuration file
--dir-dWorking directory
--verbose-vEnable verbose output
--help-hShow help

Commands

CommandDescription
generateGenerate CI pipeline (GitLab CI or GitHub Actions)
validateValidate project structure
graphShow dependency graph (DOT, PlantUML, list, levels)
initInitialize configuration (interactive TUI wizard)
costEstimate AWS costs from plan files
summaryPost plan results to MR/PR
policyPull and check OPA policies
tfupdateResolve Terraform dependency versions and sync lock files
versionShow version information

Usage

bash
terraci [command] [flags]

Examples

bash
# Generate pipeline (GitLab CI)
terraci generate -o .gitlab-ci.yml

# Generate pipeline (GitHub Actions)
terraci generate -o .github/workflows/terraform.yml

# Validate with verbose output
terraci validate -v

# Use custom config
terraci -c custom.yaml generate

# Work in different directory
terraci -d /path/to/project validate

# Filter modules by segment
terraci generate --filter environment=production --filter region=us-east-1

Exit Codes

CodeDescription
0Success
1General error
2Configuration error
3Validation error (circular dependencies, etc.)

Environment Variables

VariableDescription
TERRACI_CONFIGDefault config file path
TERRACI_DIRDefault working directory

Version

bash
terraci version

Output:

terraci version v0.1.0
  commit: abc1234
  built:  2024-01-15T10:30:00Z

Released under the MIT License.