# ThothCTL CLI Commands Audit

Audit of actual CLI commands (from source code) vs what documentation references.

## Actual Commands (from source)

```
thothctl
├── ai-review
│   ├── analyze
│   ├── apply-fix
│   ├── configure
│   ├── configure-decisions
│   ├── decide
│   ├── history
│   ├── improve
│   ├── orchestrate
│   ├── override
│   ├── report
│   └── serve
├── check
│   ├── environment
│   ├── iac
│   ├── project
│   │   └── iac
│   └── space
├── dashboard
│   └── launch
├── document
│   └── iac
├── generate
│   ├── component
│   └── stacks
├── init
│   ├── env
│   ├── project
│   ├── space
│   └── template
├── inventory
│   ├── check
│   └── iac
├── list
│   ├── projects
│   ├── spaces
│   └── templates
├── mcp
│   ├── register
│   ├── server
│   ├── status
│   └── stop
├── project
│   ├── bootstrap
│   ├── cleanup
│   ├── convert
│   └── upgrade
├── remove
│   ├── project
│   └── space
├── scan
│   └── iac
├── space
│   ├── activate
│   └── update
└── upgrade
```

## Template-Related Commands (verified options)

### `thothctl init project`
```
Options:
  -p, --project-name        Project name (required, prompted)
  -pt, --project-type       terraform|terraform-terragrunt|tofu|cdkv2|terraform_module|terragrunt|custom
  -sc, --setup-conf         Setup project configuration (flag, default: true)
  -vcss, --version-control-systems-service   azure_repos|github|gitlab
  -reuse, --reuse           Reuse templates from IDP catalog (flag)
  -az-org, --az-org-name    Azure organization name
  -gh-user, --github-username  GitHub username/org
  -s, --space               Space name
  --batch                   Batch mode with defaults
  --context, -ctx           Path to architecture/spec file for .kiro/steering/
  -l, --language            CDK language: typescript|python|java|csharp|go
```

### `thothctl init template`
```
Options:
  -pt, --project-type       terraform|terragrunt|terraform_module|tofu|cdkv2 (required)
  -url, --template-url      GitHub repository URL for the template
```

### `thothctl project convert`
```
Options:
  -tm, --make-terramate-stacks   Create Terramate stacks (flag)
  -mpro, --make-project          Create project from template (flag)
  -mtem, --make-template         Create template from project (flag)
  -tpt, --template-project-type  terraform|terraform-terragrunt|terragrunt|tofu|cdkv2|terraform_module|custom
  -br, --branch-name             Branch name for Terramate (default: main)
```

### `thothctl project upgrade`
```
Options:
  -p, --project-path        Path to project directory (default: .)
  --dry-run                 Show changes without applying
  --force                   Force update even with local modifications
  -i, --interactive         Allow selective file import
```

### `thothctl generate component`
```
Options:
  -ct, --component-type     Component type (from .thothcf.toml folders field)
  -cn, --component-name     Component name
  -cph, --component-path    Component path (e.g., ./modules)
```

### `thothctl generate stacks`
```
Options:
  -c, --config-file         Path to YAML config file
  -s, --stack-name          Stack name (without config file)
  -m, --modules             Comma-separated module list
  -o, --output-dir          Output directory
  --create-example          Create example stack config file (flag)
```

### `thothctl list templates`
Lists available templates (from space or global).

## Documentation Issues Found & Fixed

| Issue | Location | Status |
|-------|----------|--------|
| `thothctl generate template` (doesn't exist) | create_template.md | ✅ Fixed |
| `thothctl template publish` (doesn't exist) | create_template.md | ✅ Fixed |
| `thothctl template register` (doesn't exist) | create_template.md | ✅ Fixed |
| `--template-path` option (doesn't exist on init project) | platform_engineering_templates.md | ✅ Fixed |
| Jinja2 `{{ }}` syntax in template examples | platform_engineering_templates.md | ✅ Fixed |
| `.tf.j2` file extensions (not used) | platform_engineering_templates.md | ✅ Fixed |
| Fake `template.yaml` config block (not generated by ThothCTL) | platform_engineering_templates.md | ✅ Fixed |
| `template_engine.md` empty | template_engine/template_engine.md | ✅ Fixed |
| `thothctl validate` (old command, now `thothctl check`) | iac_devsecops_use_case.md | ⚠️ Legacy doc, not critical |

## Commands That DO NOT Exist (but were documented)

| Fake Command | What to Use Instead |
|--------------|-------------------|
| `thothctl generate template` | `thothctl project convert --make-template` |
| `thothctl template publish` | Push template Git repo manually |
| `thothctl template register` | `thothctl init template --template-url <url>` |
| `thothctl validate` | `thothctl check iac` or `thothctl check project iac` |
| `--template-path` on `init project` | `--reuse --space <name>` or `project convert --make-project` |

## Notes

- The `thothctl upgrade` command (top-level) upgrades **thothctl itself**, not projects
- The `thothctl project upgrade` command upgrades **project scaffold files** from remote template
- `thothctl init template` only configures a custom URL for a project type — it doesn't create templates
- Template creation is exclusively done via `thothctl project convert --make-template`
