ThothCTL’s space management functionality allows you to organize projects within logical spaces. Each space can have its own configuration for version control systems, Terraform registries, and orchestration tools. This helps maintain consistency across related projects and simplifies credential management.
Usage: thothctl init space [OPTIONS]
Initialize a new space
Options:
-s, --space-name TEXT Name of the space [required]
-d, --description TEXT Description of the space
-vcs, --vcs-provider [azure_repos|github|gitlab]
Version Control System provider [default:
azure_repos]
-tr, --terraform-registry TEXT
Terraform registry URL [default:
https://registry.terraform.io]
-ta, --terraform-auth [none|token|env_var]
Terraform registry authentication method
[default: none]
-ot, --orchestration-tool [terragrunt|terramate|none]
Default orchestration tool for the space
[default: terragrunt]
--help Show this message and exit.
Usage: thothctl remove space [OPTIONS]
Remove a space and optionally its associated projects
Options:
-s, --space-name TEXT Name of the space to remove [required]
-rp, --remove-projects Remove all projects associated with this space
--help Show this message and exit.
Usage: thothctl list spaces
List all spaces managed by thothctl
Usage: thothctl space show SPACE_NAME
Show space configuration summary
Usage: thothctl space update SPACE_NAME [OPTIONS]
Update an existing space's configuration
Options:
-d, --description TEXT New description for the space
-vcs, --vcs-provider [azure_repos|github|gitlab]
-ot, --orchestration-tool [terragrunt|terramate|none]
-tr, --terraform-registry TEXT Terraform registry URL
-pr, --policy-repo TEXT Git URL or path for IaC policies
Usage: thothctl space activate SPACE_NAME
Set a space as the active context
Usage: thothctl list projects [OPTIONS]
List all projects managed by thothctl
Options:
-s, --show-space Show space information for each project [default: True]
thothctl init space --space-name development --description "Development environment" --vcs-provider github --terraform-auth token --orchestration-tool terragrunt
This creates a new space named “development” with GitHub as the VCS provider, token-based Terraform registry authentication, and Terragrunt as the orchestration tool.
thothctl init project --project-name my_project --space development
This creates a new project named “my_project” in the “development” space, inheriting all the space’s configurations.
thothctl list spaces
This displays a list of all spaces with their project counts.
thothctl space show platform-team
This displays a full summary of the space including VCS provider, Terraform registry, orchestration tool, governance policies, associated projects, and credentials status.
thothctl list projects
This displays a list of all projects with their associated spaces.
thothctl remove space --space-name development
This removes the “development” space but keeps its projects (they will no longer be associated with any space).
thothctl remove space --space-name development --remove-projects
This removes the “development” space and all projects associated with it.
Each space has the following directory structure:
~/.thothcf/spaces/<space_name>/
├── space.toml # Space configuration file
├── credentials/ # Credentials for various services
├── configs/ # General configurations
├── templates/ # Project templates
├── vcs/ # Version control system configurations
│ └── <provider>.toml # Provider-specific configuration
├── terraform/ # Terraform registry configurations
│ └── registry.toml # Registry configuration
└── orchestration/ # Orchestration tool configurations
└── <tool>.toml # Tool-specific configuration
The main space configuration file:
[space]
name = "development"
version = "1.0.0"
[credentials]
path = "credentials"
[configurations]
path = "configs"
[templates]
path = "templates"
[version_control]
path = "vcs"
default_provider = "github"
providers = ["azure_repos", "github", "gitlab"]
[terraform]
path = "terraform"
registry_url = "https://registry.terraform.io"
auth_method = "token"
[orchestration]
path = "orchestration"
default_tool = "terragrunt"
tools = ["terragrunt", "terramate", "none"]
Example GitHub configuration (vcs/github.toml):
[provider]
provider = "github"
[settings]
organization = ""
project = ""
repository = ""
branch = "main"
auth_method = "pat" # Options: pat, oauth, ssh
Example Terraform registry configuration (terraform/registry.toml):
[registry]
url = "https://registry.terraform.io"
auth_method = "token"
token_env_var = ""
token = ""
[providers]
[providers.aws]
version = "~> 4.0"
source = "hashicorp/aws"
[providers.azure]
version = "~> 3.0"
source = "hashicorp/azurerm"
Example Terragrunt configuration (orchestration/terragrunt.toml):
[terragrunt]
version = "latest"
[terragrunt.remote_state]
backend = "s3"
[terragrunt.remote_state.config]
bucket = ""
key = "${path_relative_to_include()}/terraform.tfstate"
region = "us-east-1"
encrypt = true
[terragrunt.generate]
provider = true
backend = true
thothctl init space \
--space-name development \
--description "Development environment" \
--vcs-provider github \
--terraform-auth token \
--orchestration-tool terragrunt
thothctl init space \
--space-name production \
--description "Production environment" \
--vcs-provider azure_repos \
--terraform-auth env_var \
--orchestration-tool terragrunt
thothctl init space \
--space-name data-team \
--description "Data Engineering Team" \
--vcs-provider gitlab \
--terraform-auth token \
--orchestration-tool terramate
.thothcf directoryFor more detailed logs, run ThothCTL with the --debug flag:
thothctl --debug init space --space-name development