# manatunga/repopy architecture

> Architecture diagram of the GitHub repository manatunga/repopy, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manatunga/repopy
- Repository: https://github.com/manatunga/repopy

## Overview

repopy is a Python CLI workspace manager. Users select a subcommand, which routes to a command handler and then a supervisor: init scaffolds themed projects, clone fetches a repository and provisions its environment, link pushes a local repository upstream, clean removes artifacts, and info reports workspace metadata. The README documents these capabilities and the four layout presets. The graph includes the shared engines, templates, prompts, and validation layer; unsampled command and engine details are represented only where the README or SOURCE INDEX supports them.

Main entry points: [`src/repopy/orchestrators.py`](https://github.com/manatunga/repopy/blob/main/src/repopy/orchestrators.py) (Workflow supervisors), [`src/repopy/commands/__init__.py`](https://github.com/manatunga/repopy/blob/main/src/repopy/commands/__init__.py) (Command registry), [`src/repopy/commands/init.py`](https://github.com/manatunga/repopy/blob/main/src/repopy/commands/init.py) (Init command), [`src/repopy/commands/clone.py`](https://github.com/manatunga/repopy/blob/main/src/repopy/commands/clone.py) (Clone command)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and commands"]
  node_entrypoint["Application entry<br/>[__main__.py]"]
  node_parser["Argument parser<br/>[cli.py]"]
  node_registry["Command registry<br/>[__init__.py]"]
  node_init_cmd["Init command<br/>[init.py]"]
  node_clone_cmd["Clone command<br/>[clone.py]"]
  node_link_cmd["Link command<br/>[link.py]"]
  node_clean_cmd["Clean command<br/>[clean.py]"]
  node_info_cmd["Info command<br/>[info.py]"]
  node_command_contract["Command contract<br/>[base.py]"]
end

subgraph group_workflow["Workflow supervision"]
  node_supervisors["Workflow supervisors<br/>[orchestrators.py]"]
end

subgraph group_engines["Workspace engines"]
  node_filesystem["Filesystem and venv<br/>[file_system.py]"]
  node_git_engine["Git operations<br/>[git_engine.py]"]
  node_workspace_info["Workspace inspection<br/>[info.py]"]
  node_templates["Scaffold templates<br/>[templates.py]"]
end

subgraph group_support["Prompts and validation"]
  node_prompts["Interactive prompts<br/>[prompts.py]"]
  node_validators["Input validation<br/>[validators.py]"]
  node_dependency_checks["Host checks<br/>[dependencies.py]"]
  node_os_detection["OS detection<br/>[os_detector.py]"]
end

node_user(("CLI user"))

node_user -->|"runs CLI"| node_entrypoint
node_entrypoint -->|"parses arguments"| node_parser
node_parser -->|"loads commands"| node_registry
node_registry -->|"registers"| node_init_cmd
node_registry -->|"registers"| node_clone_cmd
node_registry -->|"registers"| node_link_cmd
node_registry -->|"registers"| node_clean_cmd
node_registry -->|"registers"| node_info_cmd
node_init_cmd -->|"implements"| node_command_contract
node_clone_cmd -->|"implements"| node_command_contract
node_init_cmd -->|"starts workflow"| node_supervisors
node_clone_cmd -->|"starts workflow"| node_supervisors
node_link_cmd -->|"starts workflow"| node_supervisors
node_clean_cmd -->|"starts workflow"| node_supervisors
node_info_cmd -->|"starts workflow"| node_supervisors
node_init_cmd -->|"captures manifest"| node_prompts
node_supervisors -->|"provisions and cleans"| node_filesystem
node_supervisors -->|"clones or links"| node_git_engine
node_supervisors -->|"reads metadata"| node_workspace_info
node_supervisors -->|"requests confirmation"| node_prompts
node_supervisors -->|"validates input"| node_validators
node_supervisors -->|"checks host tools"| node_dependency_checks
node_supervisors -->|"formats info"| node_templates
node_filesystem -->|"writes generated files"| node_templates
node_filesystem -->|"selects venv tools"| node_os_detection
node_prompts -->|"checks project name"| node_validators
node_workspace_info -->|"detects platform"| node_os_detection

click node_entrypoint "https://github.com/manatunga/repopy/blob/main/src/repopy/__main__.py"
click node_parser "https://github.com/manatunga/repopy/blob/main/src/repopy/ui/cli.py"
click node_registry "https://github.com/manatunga/repopy/blob/main/src/repopy/commands/__init__.py"
click node_init_cmd "https://github.com/manatunga/repopy/blob/main/src/repopy/commands/init.py"
click node_clone_cmd "https://github.com/manatunga/repopy/blob/main/src/repopy/commands/clone.py"
click node_link_cmd "https://github.com/manatunga/repopy/blob/main/src/repopy/commands/link.py"
click node_clean_cmd "https://github.com/manatunga/repopy/blob/main/src/repopy/commands/clean.py"
click node_info_cmd "https://github.com/manatunga/repopy/blob/main/src/repopy/commands/info.py"
click node_command_contract "https://github.com/manatunga/repopy/blob/main/src/repopy/commands/base.py"
click node_supervisors "https://github.com/manatunga/repopy/blob/main/src/repopy/orchestrators.py"
click node_filesystem "https://github.com/manatunga/repopy/blob/main/src/repopy/engines/file_system.py"
click node_git_engine "https://github.com/manatunga/repopy/blob/main/src/repopy/engines/git_engine.py"
click node_workspace_info "https://github.com/manatunga/repopy/blob/main/src/repopy/engines/info.py"
click node_templates "https://github.com/manatunga/repopy/blob/main/src/repopy/templates.py"
click node_prompts "https://github.com/manatunga/repopy/blob/main/src/repopy/ui/prompts.py"
click node_validators "https://github.com/manatunga/repopy/blob/main/src/repopy/validators/validators.py"
click node_dependency_checks "https://github.com/manatunga/repopy/blob/main/src/repopy/validators/dependencies.py"
click node_os_detection "https://github.com/manatunga/repopy/blob/main/src/repopy/validators/os_detector.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entrypoint,node_parser,node_registry,node_init_cmd,node_clone_cmd,node_link_cmd,node_clean_cmd,node_info_cmd,node_command_contract,node_user toneBlue
class node_supervisors toneAmber
class node_filesystem,node_git_engine,node_workspace_info,node_templates toneMint
class node_prompts,node_validators,node_dependency_checks,node_os_detection toneRose
```

## Components

### CLI and commands

- [Application entry](https://github.com/manatunga/repopy/blob/main/src/repopy/__main__.py): `src/repopy/__main__.py`
- [Argument parser](https://github.com/manatunga/repopy/blob/main/src/repopy/ui/cli.py): `src/repopy/ui/cli.py`
- [Command registry](https://github.com/manatunga/repopy/blob/main/src/repopy/commands/__init__.py): `src/repopy/commands/__init__.py`
- [Init command](https://github.com/manatunga/repopy/blob/main/src/repopy/commands/init.py): `src/repopy/commands/init.py`
- [Clone command](https://github.com/manatunga/repopy/blob/main/src/repopy/commands/clone.py): `src/repopy/commands/clone.py`
- [Link command](https://github.com/manatunga/repopy/blob/main/src/repopy/commands/link.py): `src/repopy/commands/link.py`
- [Clean command](https://github.com/manatunga/repopy/blob/main/src/repopy/commands/clean.py): `src/repopy/commands/clean.py`
- [Info command](https://github.com/manatunga/repopy/blob/main/src/repopy/commands/info.py): `src/repopy/commands/info.py`
- [Command contract](https://github.com/manatunga/repopy/blob/main/src/repopy/commands/base.py): `src/repopy/commands/base.py`

### Workflow supervision

- [Workflow supervisors](https://github.com/manatunga/repopy/blob/main/src/repopy/orchestrators.py): `src/repopy/orchestrators.py`

### Workspace engines

- [Filesystem and venv](https://github.com/manatunga/repopy/blob/main/src/repopy/engines/file_system.py): `src/repopy/engines/file_system.py`
- [Git operations](https://github.com/manatunga/repopy/blob/main/src/repopy/engines/git_engine.py): `src/repopy/engines/git_engine.py`
- [Workspace inspection](https://github.com/manatunga/repopy/blob/main/src/repopy/engines/info.py): `src/repopy/engines/info.py`
- [Scaffold templates](https://github.com/manatunga/repopy/blob/main/src/repopy/templates.py): `src/repopy/templates.py`

### Prompts and validation

- [Interactive prompts](https://github.com/manatunga/repopy/blob/main/src/repopy/ui/prompts.py): `src/repopy/ui/prompts.py`
- [Input validation](https://github.com/manatunga/repopy/blob/main/src/repopy/validators/validators.py): `src/repopy/validators/validators.py`
- [Host checks](https://github.com/manatunga/repopy/blob/main/src/repopy/validators/dependencies.py): `src/repopy/validators/dependencies.py`
- [OS detection](https://github.com/manatunga/repopy/blob/main/src/repopy/validators/os_detector.py): `src/repopy/validators/os_detector.py`

### Other components

- **CLI user**

## Connections

- CLI user → Application entry: runs CLI (evidence: `README.md`)
- Application entry → Argument parser: parses arguments (evidence: `src/repopy/__main__.py`)
- Argument parser → Command registry: loads commands (evidence: `src/repopy/ui/cli.py`)
- Command registry → Init command: registers (evidence: `src/repopy/commands/__init__.py`)
- Command registry → Clone command: registers (evidence: `src/repopy/commands/__init__.py`)
- Command registry → Link command: registers (evidence: `src/repopy/commands/__init__.py`)
- Command registry → Clean command: registers (evidence: `src/repopy/commands/__init__.py`)
- Command registry → Info command: registers (evidence: `src/repopy/commands/__init__.py`)
- Init command → Command contract: implements (evidence: `src/repopy/commands/init.py`)
- Clone command → Command contract: implements (evidence: `src/repopy/commands/clone.py`)
- Init command → Workflow supervisors: starts workflow (evidence: `src/repopy/commands/init.py`)
- Clone command → Workflow supervisors: starts workflow (evidence: `src/repopy/commands/clone.py`)
- Link command → Workflow supervisors: starts workflow (evidence: `src/repopy/commands/link.py`)
- Clean command → Workflow supervisors: starts workflow (evidence: `src/repopy/commands/clean.py`)
- Info command → Workflow supervisors: starts workflow (evidence: `src/repopy/commands/info.py`)
- Init command → Interactive prompts: captures manifest (evidence: `src/repopy/commands/init.py`)
- Workflow supervisors → Filesystem and venv: provisions and cleans (evidence: `src/repopy/orchestrators.py`)
- Workflow supervisors → Git operations: clones or links (evidence: `src/repopy/orchestrators.py`)
- Workflow supervisors → Workspace inspection: reads metadata (evidence: `src/repopy/orchestrators.py`)
- Workflow supervisors → Interactive prompts: requests confirmation (evidence: `src/repopy/orchestrators.py`)
- Workflow supervisors → Input validation: validates input (evidence: `src/repopy/orchestrators.py`)
- Workflow supervisors → Host checks: checks host tools (evidence: `src/repopy/orchestrators.py`)
- Workflow supervisors → Scaffold templates: formats info (evidence: `src/repopy/orchestrators.py`)
- Filesystem and venv → Scaffold templates: writes generated files (evidence: `src/repopy/engines/file_system.py`)
- Filesystem and venv → OS detection: selects venv tools (evidence: `src/repopy/engines/file_system.py`)
- Interactive prompts → Input validation: checks project name (evidence: `src/repopy/ui/prompts.py`)
- Workspace inspection → OS detection: detects platform (evidence: `src/repopy/engines/info.py`)
