repopy
A modular, cross-platform Python CLI workspace manager and developer tooling suite designed to automate reproducible local scaffolding, virtual environment creation, and remote repository synchronization.
🌟 Key Features
-
Lifecycle Project Scaffolding (
repopy init): Provisions clean directory structures, dedicated virtual environments, automated.gitignoretemplates, and PEP 621pyproject.tomlorrequirements.txtconfigs. -
Smart Remote Cloning (
repopy clone): Clones remote Git repositories, creates isolated.venvenvironments, previews declared dependencies, and installs them interactively or via flags. -
Upstream Linking (
repopy link): Instantly connects an unlinked local workspace to a remote Git upstream, staging files, executing initial commits, and pushing to the default branch in one step. -
Architectural Themes: Built-in layout presets (
minimal,web_api,cli_package,data_science) tailored to modern packaging standards. -
Transactional Cleanups: Employs defensive rollback mechanisms (
shutil.rmtree) to safely purge half-baked directories if setup fails midway. -
Isolated & Tested: Fully decoupled architecture backed by comprehensive unit and mock test suites.
🛠️ Architecture & Separation of Concerns
repopy is organized into single-responsibility layers:
-
Presentation & Routing (
cli.py,prompts.py,__main__.py): Evaluates native terminal arguments viaargparse, orchestrates interactive prompt flows, and handles OS interrupts gracefully. -
Supervision (
orchestrators.py): Broker layer executing lifecycle validation checks, branch sequencing, rollback triggers and command handoffs. -
Low-Level Engines (
file_system.py,git_engine.py): Decoupled engines handling transactional directory allocations, venv isolation, dependency installation and direct subprocess execution. -
Validation & Translation (
validators.py,dependencies.py,os_detector.py): Sanitizes names and paths, validates Git URLs, verifies host binaries (python,git), and resolves cross-platform paths.
📥 Installation
Install the latest release from PyPI:
pip install repopy
Alternatively, you can install the latest development version directly from the source:
git clone https://github.com/manatunga/repopy.git
cd repopy
pip install -e .
🚀 Usage Guide
1. Initialize a Project (repopy init)
Generate a new workspace interactively or via CLI flags:
# Interactive setup
repopy init my-app
# Non-interactive generation with a specific theme
repopy init my-api -t web_api -s
# Initialize and immediately connect to a remote repository
repopy init my-cli -t cli_package --link <git-url>
Available Themes:
minimal: Bare directory setup withrequirements.txt.web_api: Layered service layout prepared for modern frameworks.cli_package: Modular structure configured with PEP 621 compliantpyproject.toml.data_science: Notebooks, data directories (raw, processed), and pipeline layout.
2. Clone a Remote Project (repopy clone)
Fetch a remote repository, provision a virtual environment, and manage dependencies:
# Interactive mode (previews requirements.txt and prompts for installation)
repopy clone <git-url>
# Custom directory name
repopy clone <git-url> -n custom-folder-name
# Auto-install dependencies without prompting
repopy clone <git-url> -i
# Fetch and provision environment only (skip dependency installation)
repopy clone <git-url> --no-install
3. Link an Existing Workspace (repopy link)
Run inside an existing workspace to push tracking history to an upstream origin:
# Link with default initial commit message
repopy link <git-url>
# Link with custom commit message
repopy link <git-url> -m "feat: initial project structure"
🧪 Testing & Continuous Integration
Run the test suite using pytest:
pytest -v
🗂️ Project Structure
repopy/
├── .github/
│ └── workflows/
│ └── tests.yml # CI test runner pipeline
├── src/
│ └── repopy/
│ ├── __init__.py # Package initialization
│ ├── __main__.py # Application execution entry
│ ├── cli.py # CLI subparser configuration
│ ├── dependencies.py # Binary prerequisite verification
│ ├── file_system.py # Atomic workspace & venv operations
│ ├── git_engine.py # Subprocess Git execution engine
│ ├── orchestrators.py # High-level pipeline management
│ ├── os_detector.py # Cross-platform environment resolver
│ ├── prompts.py # Dynamic terminal questionnaires
│ ├── templates.py # Static asset definitions & manifests
│ └── validators.py # Input sanitation & regex filters
├── tests/
│ ├── test_cli.py # CLI argument parser & flag exclusivity tests
│ ├── test_file_system.py # Workspace scaffolding & requirements parsing tests
│ ├── test_git_engine.py # Subprocess Git mocking & exit code tests
│ ├── test_orchestrators.py # Pipeline logic, prompts, and rollback tests
│ ├── test_prompts.py # Input loop & default manifest tests
│ └── test_validators.py # Path and schema validation tests
├── pyproject.toml # PEP 621 packaging configuration
├── LICENSE # MIT License
└── README.md
📄 License
Distributed under the MIT License. See LICENSE for details.
Release files for repopy 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| repopy-0.3.0.tar.gz | 17.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| repopy-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 32.8 kB
Release files / repopy-0.3.0.tar.gz
| Download URL | repopy-0.3.0.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c1f20f89f71ca6e4079a2e48bd588f92f9d468d67b0247b0184c0b04d8be017
|
|
BLAKE2b-256 checksum How to use checksums |
73bc4d5818b1429c7c0d85e00c5bf8ca8fe3cee8052f8555bae350d4f834b5dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / repopy-0.3.0-py3-none-any.whl
| Download URL | repopy-0.3.0-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c385479c2363feb8e6658497eff7833b3abcca87fe602f9e4fdd46f01a0ae01d
|
|
BLAKE2b-256 checksum How to use checksums |
4f37df6dfff9dfa0a5ac9039920d2fb8aaed2f8153dcc7a68a018e291f3551eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|