# suxyio/declmysys architecture

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

- Interactive diagram: https://gitdiagram.com/suxyio/declmysys
- Repository: https://github.com/suxyio/declmysys

## Overview

DeclMySys is a declarative Linux system-configuration manager. Users initialize a declaration directory, describe ordered configuration operations in TOML, then list or execute them; execution supports dry runs and command presets such as packages, git clone, and stow. The graph follows the sampled CLI and setup code, plus the subsystem boundaries documented by the tree and README. The internals of listing and execution were not sampled, so those links are limited to the documented entry points and visible package boundaries.

Main entry points: [`internal/subcmds/init.go`](https://github.com/suxyio/declmysys/blob/main/internal/subcmds/init.go) (Initialize directory), [`main.go`](https://github.com/suxyio/declmysys/blob/main/main.go) (CLI entry), [`internal/parse/decls`](https://github.com/suxyio/declmysys/tree/main/internal/parse/decls) (Load declarations), [`internal/subcmds/list.go`](https://github.com/suxyio/declmysys/blob/main/internal/subcmds/list.go) (List declarations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI workflows"]
  node_cli["CLI entry<br/>[main.go]"]
  node_init["Initialize directory<br/>[init.go]"]
  node_list["List declarations<br/>[list.go]"]
  node_run["Run declarations<br/>[run.go]"]
end

subgraph group_config["Configuration inputs"]
  node_configflag["Global config"]
  node_declfiles["Declaration files"]
  node_metadata["Metadata and substitutions"]
  node_templates["Starter templates"]
end

subgraph group_engine["Declaration engine"]
  node_decldata["Load declarations"]
  node_decllist["Filter and format"]
  node_declrun["Priority execution"]
  node_presets["Operation presets<br/>[presets.go]"]
end

subgraph group_execution["System operations"]
  node_commands["Command runner"]
end

node_user(("User"))
node_filesystem[("Local filesystem")]
node_shell["System commands"]
node_git["Git"]

node_user -->|"invokes"| node_cli
node_cli -->|"dispatches"| node_init
node_cli -->|"dispatches"| node_list
node_cli -->|"dispatches"| node_run
node_init -->|"loads config"| node_configflag
node_init -->|"copies template"| node_templates
node_init -->|"substitutes version"| node_metadata
node_init -->|"creates files"| node_filesystem
node_init -.->|"initializes repository"| node_git
node_list -->|"loads declarations"| node_decldata
node_list -->|"lists by priority"| node_decllist
node_run -->|"loads declarations"| node_decldata
node_run -->|"executes selection"| node_declrun
node_decldata -->|"loads metadata"| node_metadata
node_decldata -->|"loads declarations"| node_declfiles
node_declrun -->|"dispatches preset"| node_presets
node_presets -->|"runs commands"| node_commands
node_commands -->|"expands substitutions"| node_metadata
node_commands -->|"executes process"| node_shell

click node_cli "https://github.com/suxyio/declmysys/blob/main/main.go"
click node_init "https://github.com/suxyio/declmysys/blob/main/internal/subcmds/init.go"
click node_list "https://github.com/suxyio/declmysys/blob/main/internal/subcmds/list.go"
click node_run "https://github.com/suxyio/declmysys/blob/main/internal/subcmds/run.go"
click node_configflag "https://github.com/suxyio/declmysys/tree/main/internal/parse/globconf"
click node_declfiles "https://github.com/suxyio/declmysys/tree/main/internal/parse/decls"
click node_metadata "https://github.com/suxyio/declmysys/tree/main/internal/parse/metadata"
click node_templates "https://github.com/suxyio/declmysys/tree/main/internal/templates"
click node_decldata "https://github.com/suxyio/declmysys/tree/main/internal/parse/decls"
click node_decllist "https://github.com/suxyio/declmysys/tree/main/internal/parse/decls"
click node_declrun "https://github.com/suxyio/declmysys/tree/main/internal/parse/decls"
click node_presets "https://github.com/suxyio/declmysys/blob/main/internal/parse/decls/presets.go"
click node_commands "https://github.com/suxyio/declmysys/tree/main/internal/parse/cmdtype"

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,node_init,node_list,node_run,node_user toneBlue
class node_configflag,node_declfiles,node_metadata,node_templates,node_filesystem toneAmber
class node_decldata,node_decllist,node_declrun,node_presets toneMint
class node_commands toneRose
class node_shell,node_git toneIndigo
```

## Components

### CLI workflows

- [CLI entry](https://github.com/suxyio/declmysys/blob/main/main.go): `main.go`
- [Initialize directory](https://github.com/suxyio/declmysys/blob/main/internal/subcmds/init.go): `internal/subcmds/init.go`
- [List declarations](https://github.com/suxyio/declmysys/blob/main/internal/subcmds/list.go): `internal/subcmds/list.go`
- [Run declarations](https://github.com/suxyio/declmysys/blob/main/internal/subcmds/run.go): `internal/subcmds/run.go`

### Configuration inputs

- [Global config](https://github.com/suxyio/declmysys/tree/main/internal/parse/globconf): `internal/parse/globconf`
- [Declaration files](https://github.com/suxyio/declmysys/tree/main/internal/parse/decls): `internal/parse/decls`
- [Metadata and substitutions](https://github.com/suxyio/declmysys/tree/main/internal/parse/metadata): `internal/parse/metadata`
- [Starter templates](https://github.com/suxyio/declmysys/tree/main/internal/templates): `internal/templates`

### Declaration engine

- [Load declarations](https://github.com/suxyio/declmysys/tree/main/internal/parse/decls): `internal/parse/decls`
- [Filter and format](https://github.com/suxyio/declmysys/tree/main/internal/parse/decls): `internal/parse/decls`
- [Priority execution](https://github.com/suxyio/declmysys/tree/main/internal/parse/decls): `internal/parse/decls`
- [Operation presets](https://github.com/suxyio/declmysys/blob/main/internal/parse/decls/presets.go): `internal/parse/decls/presets.go`

### System operations

- [Command runner](https://github.com/suxyio/declmysys/tree/main/internal/parse/cmdtype): `internal/parse/cmdtype`

### Other components

- **User**
- **Local filesystem**
- **System commands**
- **Git**

## Connections

- User → CLI entry: invokes
- CLI entry → Initialize directory: dispatches
- CLI entry → List declarations: dispatches
- CLI entry → Run declarations: dispatches
- Initialize directory → Global config: loads config
- Initialize directory → Starter templates: copies template
- Initialize directory → Metadata and substitutions: substitutes version
- Initialize directory → Local filesystem: creates files
- Initialize directory → Git: initializes repository
- List declarations → Load declarations: loads declarations
- List declarations → Filter and format: lists by priority
- Run declarations → Load declarations: loads declarations
- Run declarations → Priority execution: executes selection
- Load declarations → Metadata and substitutions: loads metadata
- Load declarations → Declaration files: loads declarations
- Priority execution → Operation presets: dispatches preset
- Operation presets → Command runner: runs commands
- Command runner → Metadata and substitutions: expands substitutions
- Command runner → System commands: executes process
