ThothCTL Check Space Command¶
Overview¶
The thothctl check space command provides comprehensive diagnostics for space configuration and setup. This command validates space configuration, VCS settings, credentials status, and project usage to help troubleshoot space-related issues.
Command Structure¶
Usage: thothctl check space [OPTIONS]
Check space configuration and diagnostics
Options:
-s, --space-name TEXT Name of the space to check [required]
--help Show this message and exit.
Basic Usage¶
Check Space Configuration¶
This validates the specified space's configuration and provides comprehensive diagnostics.
Validation Output¶
The command provides professional Rich-formatted output with multiple diagnostic sections:
Space Overview¶
- Space name and description
- Configuration file status
- Directory structure validation
- Creation and modification timestamps
VCS Configuration¶
- Version control system provider (GitHub, Azure Repos, GitLab)
- Repository settings and authentication method
- Configuration file validation
- Connection status
Credentials Status¶
- Authentication token availability
- Credential file locations
- Security status and recommendations
- Token expiration warnings (if applicable)
Project Usage¶
- List of projects using this space
- Project count and status
- Space utilization metrics
- Project health indicators
Example Output¶
โน๏ธ ๐ Checking space configuration: labvel-devsecops
๐ Space Overview: labvel-devsecops
โโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Property โ Value โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ Name โ labvel-devsecops โ
โ Version โ 1.0.0 โ
โ Path โ /home/labvel/.thothcf/spaces/labvel-devsecops โ
โ Config Path โ configs โ
โ Credentials Path โ credentials โ
โโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ VCS Configuration
โโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโ
โ Setting โ Value โ Status โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ Default Provider โ github โ โ
Configured โ
โ Available Providers โ azure_repos, github, gitlab โ โ
Set โ
โ VCS Path โ vcs โ โ
Set โ
โโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโ
๐ Credentials Status
โโโโโโโโโโโโโณโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโ
โ Type โ File โ Status โ Details โ
โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ
โ VCS โ vcs.enc โ โ
Available โ Size: 292 bytes โ
โ TERRAFORM โ terraform.enc โ โ Missing โ Not configured โ
โ CLOUD โ cloud.enc โ โ Missing โ Not configured โ
โโโโโโโโโโโโโดโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโ
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ ๐ Projects โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ No projects are currently using space 'labvel-devsecops' โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
Use Cases¶
Space Troubleshooting¶
When experiencing issues with space configuration:
This helps identify: - Missing configuration files - Invalid VCS settings - Credential issues - Project association problems
Pre-deployment Validation¶
Before deploying projects in a space:
Ensures the space is properly configured and ready for project operations.
Credential Verification¶
To verify credential setup and security:
Shows credential status and provides security recommendations.
Configuration Validation¶
The command validates several configuration aspects:
Space Directory Structure¶
~/.thothcf/spaces/{space_name}/
โโโ config.toml # Space configuration
โโโ credentials.toml # VCS credentials
โโโ vcs/ # VCS-specific settings
โโโ terraform/ # Terraform registry settings
โโโ orchestration/ # Orchestration tool settings
Configuration Files¶
config.toml¶
[space]
name = "development"
description = "Development environment space"
created_at = "2024-01-15T10:30:00Z"
[vcs]
provider = "github"
auth_method = "token"
[terraform]
registry = "registry.terraform.io"
[orchestration]
tool = "terragrunt"
credentials.toml¶
[github]
token = "ghp_xxxxxxxxxxxxxxxxxxxx"
username = "developer"
[azure_repos]
# Azure DevOps credentials (if applicable)
[gitlab]
# GitLab credentials (if applicable)
Error Scenarios¶
Space Not Found¶
Solution: Verify space name or create the space usingthothctl init space.
Missing Configuration¶
Solution: Reinitialize the space or manually create the configuration file.Invalid Credentials¶
Solution: Update credentials using space initialization or manual configuration.VCS Connection Issues¶
Solution: Verify network connectivity and credential validity.Integration with Other Commands¶
Space Initialization¶
# Create a new space
thothctl init space --space-name development --vcs-provider github
# Check the newly created space
thothctl check space --space-name development
Project Creation¶
# Create project in space
thothctl init project --project-name my-app --space development
# Verify space configuration before project creation
thothctl check space --space-name development
Space Management¶
# List all spaces
thothctl list spaces
# Check specific space
thothctl check space --space-name production
# Remove space (with validation)
thothctl remove space --space-name old-space
Best Practices¶
- Regular Health Checks: Run space checks periodically to ensure configuration integrity
- Pre-Project Validation: Always check space configuration before creating new projects
- Credential Rotation: Use space checks to monitor credential status and expiration
- Environment Consistency: Validate space configuration across different environments
- Troubleshooting Workflow: Use space checks as the first step in diagnosing space-related issues
Troubleshooting¶
Common Issues¶
Permission Denied¶
Solution: Check file permissions and ensure proper access to the ThothCTL configuration directory.Network Connectivity¶
Solution: Verify network connectivity and firewall settings for VCS provider access.Corrupted Configuration¶
Solution: Backup and recreate the space configuration or restore from a known good state.Debugging¶
Enable debug mode for detailed diagnostic information:
This provides: - Detailed file system operations - Network connection attempts - Configuration parsing details - Credential validation steps
Exit Codes¶
- Exit Code 0: Space configuration is valid and healthy
- Exit Code 1: Space configuration issues detected or space not found
Related Documentation¶
- Space Configuration: Understanding ThothCTL spaces
- Init Space Command: Creating and configuring spaces
- List Spaces Command: Viewing available spaces
- Remove Space Command: Removing spaces safely