# chickensoft-games/godotenv architecture

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

- Interactive diagram: https://gitdiagram.com/chickensoft-games/godotenv
- Repository: https://github.com/chickensoft-games/godotenv

## Overview

##### Project type and purpose
- Project: GodotEnv – a cross-platform .NET command-line tool
- Purpose:
– Manage Godot versions (download, extract, install, switch via symlink, set environment variable)
– Manage Godot addons (install from remote git, local repos, symlink, zip, resolve dependencies)
– Configure settings via commands (config list, set)
- Not a web app or microservice – it is a monolithic CLI application with well-defined internal modules and external dependencies (file system, network, OS environment, git).

##### File structure
- Top-level directories:
– GodotEnv/ : production code
– GodotEnv.Tests/ : unit and integration tests
– TestPackage/ : example package demonstrating addon usage (secondary example)
- GodotEnv/src common modules:
– common/clients (EnvVar, File, Network, Zip, ZipClientTerminal)
– common/models (Config, ExecutionContext, Asset, CLI command interface, OS types)
– common/utilities (Computer, Log, ProcessRunner, Shell, SystemInfo)
- GodotEnv/src features: three feature areas, each with Commands, Domain, Models, Serializers (for godot management and addons), plus Config commands
- Configuration & build: .csproj, solution files, GitHub workflows, omnisharp.json

##### README for insights
- Architecture isn’t drawn explicitly but command structure is clear—commands map to feature modules
- External interactions: git, HTTP downloads, file system, OS environment variables
- Caching layers: Godot zip cache, addons cache
- Dependency resolution: flat graph, domain classes handle graphs

##### Detail without overcomplicating
- Core modules and their responsibilities
- How commands flow through layers to external systems
- Avoid splitting into absurd microservices—this is a single CLI binary

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "CLI Layer"
        CLI["Main.cs - CLI Entry Point"]:::cli
        Dispatcher["Command Dispatcher (ICliCommand)"]:::cli
    end

    CLI -->|"parse commands"| Dispatcher

    subgraph "Feature Modules"
        subgraph "Godot Management"
            GCMD["Godot Commands"]:::feature
            GDOM["Godot Domain Services"]:::feature
            GMOD["Godot Models"]:::feature
            GSER["Godot Serializers"]:::feature
        end
        subgraph "Addons Management"
            ACMD["Addons Commands"]:::feature
            ADOM["Addons Domain Services"]:::feature
            AMOD["Addons Models"]:::feature
        end
        subgraph "Config Management"
            CCMD["Config Commands"]:::feature
            Repository["ConfigRepository"]:::feature
        end
    end

    Dispatcher -->|"route to Godot"| GCMD
    Dispatcher -->|"route to Addons"| ACMD
    Dispatcher -->|"route to Config"| CCMD

    GCMD -->|"invoke services"| GDOM
    GDOM -->|"manipulate state via"| GMOD
    GDOM -->|"serialize versions via"| GSER

    ACMD -->|"invoke services"| ADOM
    ADOM -->|"manipulate state via"| AMOD

    CCMD -->|"invoke persistence"| Repository

    subgraph "Common Services & Utilities"
        Clients["Clients"]:::common
        Utils["Utilities"]:::common
    end

    GCMD --> Clients
    ACMD --> Clients
    CCMD --> Clients
    Clients -->|"use utilities"| Utils

    subgraph "Core Models & Contexts"
        CoreModels["Shared Models & Contexts"]:::common
    end

    Clients -->|"models & context"| CoreModels
    GDOM --> CoreModels
    ADOM --> CoreModels
    CCMD --> CoreModels

    subgraph "External Dependencies"
        FS["File System"]:::external
        NET["Network (HTTP)"]:::external
        GIT["Git"]:::external
        OS["OS Environment"]:::external
    end

    Clients -->|"file IO"| FS
    Clients -->|"download zip"| NET
    Clients -->|"clone repo"| GIT
    Clients -->|"set/read env var"| OS

    click CLI "https://github.com/chickensoft-games/godotenv/blob/main/GodotEnv/src/Main.cs"
    click Dispatcher "https://github.com/chickensoft-games/godotenv/blob/main/GodotEnv/src/common/models/ICliCommand.cs"
    click Repository "https://github.com/chickensoft-games/godotenv/blob/main/GodotEnv/src/common/domain/ConfigRepository.cs"
    click GCMD "https://github.com/chickensoft-games/godotenv/tree/main/GodotEnv/src/features/godot/commands"
    click GDOM "https://github.com/chickensoft-games/godotenv/tree/main/GodotEnv/src/features/godot/domain"
    click GMOD "https://github.com/chickensoft-games/godotenv/tree/main/GodotEnv/src/features/godot/models"
    click GSER "https://github.com/chickensoft-games/godotenv/tree/main/GodotEnv/src/features/godot/serializers"
    click ACMD "https://github.com/chickensoft-games/godotenv/tree/main/GodotEnv/src/features/addons/commands"
    click ADOM "https://github.com/chickensoft-games/godotenv/tree/main/GodotEnv/src/features/addons/domain"
    click AMOD "https://github.com/chickensoft-games/godotenv/tree/main/GodotEnv/src/features/addons/models"
    click CCMD "https://github.com/chickensoft-games/godotenv/tree/main/GodotEnv/src/features/config/commands"
    click Clients "https://github.com/chickensoft-games/godotenv/tree/main/GodotEnv/src/common/clients"
    click Utils "https://github.com/chickensoft-games/godotenv/tree/main/GodotEnv/src/common/utilities"
    click CoreModels "https://github.com/chickensoft-games/godotenv/tree/main/GodotEnv/src/common/models"

    classDef cli fill:#D0E6FF,stroke:#0366D6;
    classDef feature fill:#E0F8E0,stroke:#2E8B57;
    classDef common fill:#FFE4B5,stroke:#CD950C;
    classDef external fill:#E8E8E8,stroke:#A9A9A9;
```
