thothctl

ThothCTL Use Cases

This directory contains comprehensive guides for using ThothCTL in real-world scenarios. Each use case demonstrates how ThothCTL enables modern infrastructure development workflows.

πŸ€– AI-Powered Development Lifecycle (AI-DLC)

Complete AI-assisted IaC development workflow with Kiro CLI and MCP integration.

What you’ll learn:

Key Features:


πŸ”’ DevSecOps SDLC Guide

8-phase DevSecOps lifecycle for Infrastructure as Code projects.

What you’ll learn:

Key Features:

Quick Start: DevSecOps Quick Start Guide


πŸ“¦ Space Management

Organize projects with logical boundaries and multi-tenancy support.

What you’ll learn:


βœ… Check Command

Validate environments, IaC, costs, and change impact.

What you’ll learn:


πŸ“Š Inventory Command

Track dependencies and versions with professional reports.

What you’ll learn:


πŸš€ Quick Start Workflows

1. Bootstrap Complete Environment

# Install all development tools
thothctl init env

# Creates: Terraform, Terragrunt, OpenTofu, Checkov, Trivy, Kiro CLI, etc.

2. Create Project from Scaffold

# Create a space
thothctl init space --space-name lab-github

# Create project from template
thothctl init project --project-name my-infra --reuse --space lab-github

# Choose from official scaffolds:
# - terraform-scaffold
# - terragrunt-scaffold
# - tofu-scaffold
# - cdk-scaffold
# - cloudformation-scaffold

3. DevSecOps Workflow

# Full pipeline (all phases)
thothctl workflow devsecops --phase all

# Pre-deployment gate (test + secure)
thothctl workflow devsecops --phase pre-deploy --enforcement hard

# Individual phases
thothctl workflow devsecops --phase plan      # Cost + blast radius
thothctl workflow devsecops --phase develop   # Environment + structure + docs
thothctl workflow devsecops --phase build     # Inventory + versions
thothctl workflow devsecops --phase secure    # Checkov + Trivy + OPA
thothctl workflow devsecops --phase monitor   # Drift detection

# Or run individual commands directly:
thothctl check iac -type cost-analysis
thothctl scan iac -t checkov -t trivy
thothctl inventory iac --check-versions

4. AI-Assisted Development

# Start MCP server
thothctl mcp server

# In another terminal, use Kiro CLI
kiro-cli chat --agent thoth

# Example AI conversation:
# User: "Scan my Terraform code for security issues"
# AI: [Executes scan, analyzes results, suggests fixes]

πŸ“‹ Command Categories

Initialization

Validation & Analysis

Security & Compliance

Workflow (Composite Operations)

Documentation

Dependency Management

Project Management

Code Generation

AI Integration

Maintenance

πŸŽ“ Learning Path

Beginner

  1. Quick Start Guide
  2. Space Management
  3. DevSecOps Quick Start

Intermediate

  1. DevSecOps SDLC Guide
  2. Check Command
  3. Inventory Command

Advanced

  1. AI Development Lifecycle
  2. Framework Architecture
  3. Software Architecture

πŸ”§ Integration Patterns

CI/CD Integration

GitHub Actions:

- name: Security Scan
  run: thothctl scan iac -t checkov -t trivy --enforcement hard --output sarif

- name: Cost Analysis
  run: thothctl check iac -type cost-analysis

GitLab CI:

security_scan:
  script:
    - thothctl scan iac -t checkov -t trivy --enforcement hard
    - thothctl check iac -type blast-radius

Pre-commit Hooks

# .pre-commit-config.yaml
- repo: local
  hooks:
    - id: thothctl-scan
      name: ThothCTL Security Scan
      entry: thothctl scan iac -t checkov
      language: system

AI-Powered Code Review

# Start MCP server for AI assistant integration
thothctl mcp server

# Or use the AI review directly
thothctl ai-review analyze -d ./terraform -p ollama

πŸ—οΈ Architecture Patterns

Multi-Environment Setup

organization/
β”œβ”€β”€ spaces/
β”‚   β”œβ”€β”€ dev/              # Development space
β”‚   β”œβ”€β”€ staging/          # Staging space
β”‚   └── prod/             # Production space
└── projects/
    β”œβ”€β”€ networking/       # Shared networking
    β”œβ”€β”€ compute/          # Compute resources
    └── data/             # Data infrastructure

Multi-Tool Projects

project/
β”œβ”€β”€ terraform/            # Terraform IaC
β”œβ”€β”€ terragrunt/          # Terragrunt configs
β”œβ”€β”€ cloudformation/      # CloudFormation templates
└── cdk/                 # CDK code

🎯 Best Practices

Security

Cost Management

Documentation

Collaboration

πŸ’‘ Need Help?

πŸš€ What’s Next?

After mastering these use cases, explore: