Expand description
Clone command implementation.
This module implements the repository cloning functionality with automatic workspace setup. It provides a seamless developer onboarding experience by cloning a Git repository and automatically initializing or validating workspace configuration.
§What
Provides the clone command that:
- Clones Git repositories (HTTPS and SSH)
- Shows progress during clone operations
- Supports shallow clones with –depth flag
- Supports –force to overwrite existing directories
- Automatically detects workspace configuration (Story 11.3)
- Validates existing configuration (Story 11.3)
- Initializes workspace if no configuration exists (Story 11.4)
§How
The command follows this flow:
- Parse URL and determine destination directory
- Validate destination doesn’t exist (unless –force)
- Remove destination if –force is set
- Clone repository with progress indication
- Detect workspace configuration (Story 11.3)
- Validate configuration or run init (Story 11.3/11.4)
- Display success message with next steps (Story 11.4)
§Why
Cloning with automatic setup:
- Reduces onboarding friction for new developers
- Ensures consistent workspace setup
- Validates configuration immediately
- Provides clear feedback and next steps
§Examples
# Clone to default location (repository name)
workspace clone https://github.com/org/repo.git
# Clone to specific directory
workspace clone https://github.com/org/repo.git ./my-dir
# Clone with configuration overrides
workspace clone https://github.com/org/repo.git \
--strategy independent \
--environments "dev,staging,prod"
# Force clone (remove existing directory)
workspace clone https://github.com/org/repo.git --force
# Shallow clone
workspace clone https://github.com/org/repo.git --depth 1Structs§
- Validation
Check - Represents an individual validation check.
- Validation
Result - Represents the result of a validation operation.
Functions§
- execute_
clone - Executes the clone command.
- validate_
workspace - Validates workspace configuration and directory structure.