The thothctl remove space command allows you to remove spaces that are tracked by ThothCTL. This helps you maintain a clean and organized development environment by removing spaces that are no longer needed.
thothctl remove space [OPTIONS]
| Option | Description |
|---|---|
-s, --space-name TEXT |
Name of the space to remove (required) |
-rp, --remove-projects |
Remove all projects associated with this space |
--help |
Show help message and exit |
To remove a space from ThothCTL tracking:
thothctl remove space --space-name my-space
This command removes the space from ThothCTL’s tracking system but does not remove any projects associated with the space. Projects that were in the space will remain tracked by ThothCTL but will no longer be associated with any space.
To remove a space and all projects associated with it:
thothctl remove space --space-name my-space --remove-projects
This command removes both the space and all projects associated with it from ThothCTL’s tracking system.
When you remove a space using the remove space command:
--remove-projects flag is specified, it also removes all projects associated with the spacethothctl list spacesRemove spaces that are no longer needed or used:
# List all spaces to identify candidates for removal
thothctl list spaces
# Remove an old space
thothctl remove space --space-name old-space
Remove a space before reorganizing your project structure:
# Remove the space from tracking
thothctl remove space --space-name space-to-reorganize
# Create new spaces and reassign projects
thothctl init space --space-name new-space
Mark a space as retired by removing it from active tracking:
# Remove the space and its projects from tracking
thothctl remove space --space-name retired-space --remove-projects
If a space’s tracking information becomes corrupted or incorrect, you can remove it and re-add it:
# Remove the space from tracking
thothctl remove space --space-name problematic-space
# Re-initialize the space
thothctl init space --space-name problematic-space
To remove multiple spaces, run the command for each space:
thothctl remove space --space-name space1
thothctl remove space --space-name space2
thothctl remove space --space-name space3
To identify and remove spaces that have no projects:
# List spaces to identify empty ones
thothctl list spaces
# Look for spaces with "0 projects" and remove them
thothctl remove space --space-name empty-space
If you try to remove a space that doesn’t exist in the tracking system, ThothCTL will display an error message:
thothctl remove space --space-name non-existent-space
# This will show an error indicating the space doesn't exist
When removing a space without the --remove-projects flag:
When removing a space with the --remove-projects flag: