# gavinnl/pseudonix architecture

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

- Interactive diagram: https://gitdiagram.com/gavinnl/pseudonix
- Repository: https://github.com/gavinnl/pseudonix

## Overview

PseudoNix is an embeddable, header-only Linux-like process environment. Its main workflow registers and spawns coroutine processes, then advances them through the System scheduler; process streams support pipelines, while the shell offers interactive command execution and scripts. The library also provides a virtual filesystem with host and archive mounts, plus an optional ImGui terminal. Relationships below are limited to the README and sampled source references; unsampled implementation details are not inferred.

Main entry points: [`include/PseudoNix/System.h`](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/System.h) (System scheduler), [`include/PseudoNix/FileSystem.h`](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/FileSystem.h) (Virtual filesystem), [`include/PseudoNix/FileSystemMount.h`](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/FileSystemMount.h) (Mount interface), [`include/PseudoNix/Shell.h`](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/Shell.h) (Shell process)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Process Runtime"]
  node_system["System scheduler<br/>[System.h]"]
  node_process["Process coroutines<br/>[task.h]"]
  node_streams["Process I/O streams"]
end

subgraph group_shell["Shell Interface"]
  node_shellproc["Shell process<br/>[Shell.h]"]
  node_launcher["Terminal launcher<br/>[Launcher.h]"]
end

subgraph group_filesystem["Virtual Filesystem"]
  node_mountcmd["Host mount commands<br/>[HostMount.h]"]
  node_vfs["Virtual filesystem<br/>[FileSystem.h]"]
  node_mountapi["Mount interface<br/>[FileSystemMount.h]"]
  node_hostmount["Host filesystem mount<br/>[HostMount.h]"]
  node_archivemount["Archive mount<br/>[ArchiveMount.h]"]
  node_fshelpers["Filesystem path helpers"]
end

subgraph group_ui["Terminal UI"]
  node_imguiterminal["ImGui terminal<br/>[ImGuiTerminal.h]"]
  node_imguiconsole["ImGui console widget"]
end

subgraph group_internals["Coroutine Utilities"]
  node_task["Coroutine task type<br/>[task.h]"]
  node_generator["Coroutine generator<br/>[generator.h]"]
  node_defer["Scope-exit helper<br/>[defer.h]"]
  node_helpers["General helpers<br/>[helpers.h]"]
end

node_user(("Application user"))

node_user -->|"spawns processes"| node_system
node_system -->|"resumes coroutines"| node_process
node_system -->|"uses process I/O"| node_streams
node_shellproc -->|"dispatches commands"| node_system
node_user -->|"enters commands"| node_launcher
node_launcher -->|"launches shell"| node_system
node_system -->|"uses filesystem"| node_vfs
node_vfs -->|"dispatches mount operations"| node_mountapi
node_hostmount -->|"implements mount interface"| node_mountapi
node_archivemount -->|"implements mount interface"| node_mountapi
node_vfs -->|"normalizes paths"| node_fshelpers
node_mountcmd -->|"mounts host paths"| node_vfs
node_imguiterminal -->|"uses console widget"| node_imguiconsole
node_imguiterminal -->|"connects to runtime"| node_system
node_shellproc -->|"uses scope cleanup"| node_defer
node_mountapi -->|"returns directory entries"| node_generator
node_system -->|"uses coroutine tasks"| node_task
node_system -->|"uses utilities"| node_helpers

click node_system "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/System.h"
click node_process "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/task.h"
click node_streams "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/ReaderWriterStream.h"
click node_shellproc "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/Shell.h"
click node_launcher "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/Launcher.h"
click node_mountcmd "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/HostMount.h"
click node_vfs "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/FileSystem.h"
click node_mountapi "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/FileSystemMount.h"
click node_hostmount "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/HostMount.h"
click node_archivemount "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/ArchiveMount.h"
click node_fshelpers "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/FileSystemHelpers.h"
click node_imguiterminal "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/ImGuiTerminal.h"
click node_imguiconsole "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/ImGuiConsoleWidget.h"
click node_task "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/task.h"
click node_generator "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/generator.h"
click node_defer "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/defer.h"
click node_helpers "https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/helpers.h"

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_system,node_process,node_streams,node_user toneBlue
class node_shellproc,node_launcher toneAmber
class node_mountcmd,node_vfs,node_mountapi,node_hostmount,node_archivemount,node_fshelpers toneMint
class node_imguiterminal,node_imguiconsole toneRose
class node_task,node_generator,node_defer,node_helpers toneIndigo
```

## Components

### Process Runtime

- [System scheduler](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/System.h): `include/PseudoNix/System.h`
- [Process coroutines](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/task.h): `include/PseudoNix/task.h`
- [Process I/O streams](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/ReaderWriterStream.h): `include/PseudoNix/ReaderWriterStream.h`

### Shell Interface

- [Shell process](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/Shell.h): `include/PseudoNix/Shell.h`
- [Terminal launcher](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/Launcher.h): `include/PseudoNix/Launcher.h`

### Virtual Filesystem

- [Host mount commands](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/HostMount.h): `include/PseudoNix/HostMount.h`
- [Virtual filesystem](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/FileSystem.h): `include/PseudoNix/FileSystem.h`
- [Mount interface](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/FileSystemMount.h): `include/PseudoNix/FileSystemMount.h`
- [Host filesystem mount](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/HostMount.h): `include/PseudoNix/HostMount.h`
- [Archive mount](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/ArchiveMount.h): `include/PseudoNix/ArchiveMount.h`
- [Filesystem path helpers](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/FileSystemHelpers.h): `include/PseudoNix/FileSystemHelpers.h`

### Terminal UI

- [ImGui terminal](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/ImGuiTerminal.h): `include/PseudoNix/ImGuiTerminal.h`
- [ImGui console widget](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/ImGuiConsoleWidget.h): `include/PseudoNix/ImGuiConsoleWidget.h`

### Coroutine Utilities

- [Coroutine task type](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/task.h): `include/PseudoNix/task.h`
- [Coroutine generator](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/generator.h): `include/PseudoNix/generator.h`
- [Scope-exit helper](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/defer.h): `include/PseudoNix/defer.h`
- [General helpers](https://github.com/gavinnl/pseudonix/blob/main/include/PseudoNix/helpers.h): `include/PseudoNix/helpers.h`

### Other components

- **Application user**

## Connections

- Application user → System scheduler: spawns processes (evidence: `README.md`)
- System scheduler → Process coroutines: resumes coroutines (evidence: `README.md`)
- System scheduler → Process I/O streams: uses process I/O (evidence: `include/PseudoNix/System.h`)
- Shell process → System scheduler: dispatches commands (evidence: `include/PseudoNix/Shell.h`)
- Application user → Terminal launcher: enters commands (evidence: `README.md`)
- Terminal launcher → System scheduler: launches shell (evidence: `README.md`)
- System scheduler → Virtual filesystem: uses filesystem (evidence: `include/PseudoNix/System.h`)
- Virtual filesystem → Mount interface: dispatches mount operations (evidence: `include/PseudoNix/FileSystem.h`)
- Host filesystem mount → Mount interface: implements mount interface (evidence: `include/PseudoNix/HostMount.h`)
- Archive mount → Mount interface: implements mount interface (evidence: `include/PseudoNix/ArchiveMount.h`)
- Virtual filesystem → Filesystem path helpers: normalizes paths (evidence: `include/PseudoNix/FileSystem.h`)
- Host mount commands → Virtual filesystem: mounts host paths (evidence: `include/PseudoNix/HostMount.h`)
- ImGui terminal → ImGui console widget: uses console widget (evidence: `include/PseudoNix/ImGuiTerminal.h`)
- ImGui terminal → System scheduler: connects to runtime (evidence: `include/PseudoNix/ImGuiTerminal.h`)
- Shell process → Scope-exit helper: uses scope cleanup (evidence: `include/PseudoNix/Shell.h`)
- Mount interface → Coroutine generator: returns directory entries (evidence: `include/PseudoNix/FileSystemMount.h`)
- System scheduler → Coroutine task type: uses coroutine tasks (evidence: `include/PseudoNix/System.h`)
- System scheduler → General helpers: uses utilities (evidence: `include/PseudoNix/System.h`)
