# bokrsteski/greenman architecture

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

- Interactive diagram: https://gitdiagram.com/bokrsteski/greenman
- Repository: https://github.com/bokrsteski/greenman

## Overview

Greenman is a directory-organization tool. Its primary workflow is to invoke the CLI with a target directory and optional filters, then organize files into type-named directories or unwrap files from directories back into the target. The CLI also offers help and a known-types listing. The GUI is documented as in development; the sampled GUI currently only creates a window. The GUI and CLI cores are separate implementations; only the CLI core’s file operations and command wiring are shown in detail.

Main entry points: [`greenman_for_CLI/CLIgreenman.py`](https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/CLIgreenman.py) (CLI Commands), [`greenman_for_CLI/greenmancore.py`](https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/greenmancore.py) (Organize Files), [`greenman_GUI/GUIgreenman.py`](https://github.com/bokrsteski/greenman/blob/main/greenman_GUI/GUIgreenman.py) (GUI Window)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI"]
  node_cli_app["CLI Commands<br/>[CLIgreenman.py]"]
  node_help["Help<br/>[CLIgreenman.py]"]
  node_knownlist["Known Types<br/>[CLIgreenman.py]"]
end

subgraph group_runtime["Organization Runtime"]
  node_cli_core["CLI Core<br/>[greenmancore.py]"]
  node_organize["Organize Files<br/>[greenmancore.py]"]
  node_unwrap["Unwrap Files<br/>[greenmancore.py]"]
  node_type_map["Type Mapping<br/>[greenmancore.py]"]
end

subgraph group_gui["GUI"]
  node_gui_app["GUI Window<br/>[GUIgreenman.py]"]
  node_gui_core["GUI Core<br/>[greenmancore.py]"]
end

node_user(("User"))
node_target_dir["Target Directory"]

node_user -->|"runs commands"| node_cli_app
node_cli_app -->|"dispatches to"| node_organize
node_cli_app -->|"dispatches to"| node_unwrap
node_cli_app -->|"dispatches to"| node_help
node_cli_app -->|"dispatches to"| node_knownlist
node_cli_app -->|"imports"| node_cli_core
node_organize -->|"matches extensions"| node_type_map
node_unwrap -->|"checks known names"| node_type_map
node_knownlist -->|"lists entries"| node_type_map
node_organize -->|"moves files"| node_target_dir
node_unwrap -->|"extracts files"| node_target_dir
node_user -.->|"opens GUI"| node_gui_app

click node_cli_app "https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/CLIgreenman.py"
click node_help "https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/CLIgreenman.py"
click node_knownlist "https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/CLIgreenman.py"
click node_cli_core "https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/greenmancore.py"
click node_organize "https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/greenmancore.py"
click node_unwrap "https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/greenmancore.py"
click node_type_map "https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/greenmancore.py"
click node_gui_app "https://github.com/bokrsteski/greenman/blob/main/greenman_GUI/GUIgreenman.py"
click node_gui_core "https://github.com/bokrsteski/greenman/blob/main/greenman_GUI/greenmancore.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_cli_app,node_help,node_knownlist,node_user toneBlue
class node_cli_core,node_organize,node_unwrap,node_type_map toneAmber
class node_gui_app,node_gui_core toneMint
class node_target_dir toneIndigo
```

## Components

### CLI

- [CLI Commands](https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/CLIgreenman.py): `greenman_for_CLI/CLIgreenman.py`
- [Help](https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/CLIgreenman.py): `greenman_for_CLI/CLIgreenman.py`
- [Known Types](https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/CLIgreenman.py): `greenman_for_CLI/CLIgreenman.py`

### Organization Runtime

- [CLI Core](https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/greenmancore.py): `greenman_for_CLI/greenmancore.py`
- [Organize Files](https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/greenmancore.py): `greenman_for_CLI/greenmancore.py`
- [Unwrap Files](https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/greenmancore.py): `greenman_for_CLI/greenmancore.py`
- [Type Mapping](https://github.com/bokrsteski/greenman/blob/main/greenman_for_CLI/greenmancore.py): `greenman_for_CLI/greenmancore.py`

### GUI

- [GUI Window](https://github.com/bokrsteski/greenman/blob/main/greenman_GUI/GUIgreenman.py): `greenman_GUI/GUIgreenman.py`
- [GUI Core](https://github.com/bokrsteski/greenman/blob/main/greenman_GUI/greenmancore.py): `greenman_GUI/greenmancore.py`

### Other components

- **User**
- **Target Directory**

## Connections

- User → CLI Commands: runs commands (evidence: `README.md`)
- CLI Commands → Organize Files: dispatches to (evidence: `greenman_for_CLI/CLIgreenman.py`)
- CLI Commands → Unwrap Files: dispatches to (evidence: `greenman_for_CLI/CLIgreenman.py`)
- CLI Commands → Help: dispatches to (evidence: `greenman_for_CLI/CLIgreenman.py`)
- CLI Commands → Known Types: dispatches to (evidence: `greenman_for_CLI/CLIgreenman.py`)
- CLI Commands → CLI Core: imports (evidence: `greenman_for_CLI/CLIgreenman.py`)
- Organize Files → Type Mapping: matches extensions (evidence: `greenman_for_CLI/greenmancore.py`)
- Unwrap Files → Type Mapping: checks known names (evidence: `greenman_for_CLI/greenmancore.py`)
- Known Types → Type Mapping: lists entries (evidence: `greenman_for_CLI/CLIgreenman.py`)
- Organize Files → Target Directory: moves files (evidence: `greenman_for_CLI/greenmancore.py`)
- Unwrap Files → Target Directory: extracts files (evidence: `greenman_for_CLI/greenmancore.py`)
- User → GUI Window: opens GUI
