# akene-uzezi/sprout architecture

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

- Interactive diagram: https://gitdiagram.com/akene-uzezi/sprout
- Repository: https://github.com/akene-uzezi/sprout

## Overview

Sprout is a small CLI for scaffolding Go projects. A user supplies a target path and optional module name; the Cobra command handler selects or enters that directory, then calls a utility to initialize the module and create starter directories and code. The utility invokes the external Go tool and writes the generated project. The README documents a language option, but the sampled handler only scaffolds when that option is empty; no other language path is evidenced. The graph reflects the sampled implementation and documented usage.

Main entry points: [`internal/util/util.go`](https://github.com/akene-uzezi/sprout/blob/main/internal/util/util.go) (Module initialization), [`main.go`](https://github.com/akene-uzezi/sprout/blob/main/main.go) (Cobra commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI"]
  node_commands["Cobra commands<br/>[main.go]"]
  node_handler["Scaffold handler<br/>[main.go]"]
end

subgraph group_scaffold["Scaffolding"]
  node_module_init["Module initialization<br/>[util.go]"]
  node_layout_writer["Layout and starter writer<br/>[util.go]"]
end

node_user(("Project creator"))
node_go_tool["Go tool"]
node_project_files["Generated project"]

node_user -->|"runs with path"| node_commands
node_commands -->|"dispatches"| node_handler
node_handler -->|"selects module setup"| node_module_init
node_module_init -->|"runs go mod init"| node_go_tool
node_module_init -->|"calls after init"| node_layout_writer
node_layout_writer -->|"writes layout and code"| node_project_files

click node_commands "https://github.com/akene-uzezi/sprout/blob/main/main.go"
click node_handler "https://github.com/akene-uzezi/sprout/blob/main/main.go"
click node_module_init "https://github.com/akene-uzezi/sprout/blob/main/internal/util/util.go"
click node_layout_writer "https://github.com/akene-uzezi/sprout/blob/main/internal/util/util.go"

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_commands,node_handler toneBlue
class node_module_init,node_layout_writer toneAmber
class node_user,node_go_tool,node_project_files toneIndigo
```

## Components

### CLI

- [Cobra commands](https://github.com/akene-uzezi/sprout/blob/main/main.go): `main.go`
- [Scaffold handler](https://github.com/akene-uzezi/sprout/blob/main/main.go): `main.go`

### Scaffolding

- [Module initialization](https://github.com/akene-uzezi/sprout/blob/main/internal/util/util.go): `internal/util/util.go`
- [Layout and starter writer](https://github.com/akene-uzezi/sprout/blob/main/internal/util/util.go): `internal/util/util.go`

### Other components

- **Project creator**
- **Go tool**
- **Generated project**

## Connections

- Project creator → Cobra commands: runs with path (evidence: `README.md`)
- Cobra commands → Scaffold handler: dispatches (evidence: `main.go`)
- Scaffold handler → Module initialization: selects module setup (evidence: `main.go`)
- Module initialization → Go tool: runs go mod init (evidence: `internal/util/util.go`)
- Module initialization → Layout and starter writer: calls after init (evidence: `internal/util/util.go`)
- Layout and starter writer → Generated project: writes layout and code (evidence: `internal/util/util.go`)
