# fastfetch-cli/fastfetch architecture

> Architecture diagram of the GitHub repository fastfetch-cli/fastfetch, 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/fastfetch-cli/fastfetch
- Repository: https://github.com/fastfetch-cli/fastfetch

## Overview

Fastfetch is a cross-platform system-information CLI: it accepts command-line and JSONC configuration, gathers selected system facts, and presents them with configurable formatting and a logo. The graph preserves major user-facing capability branches and representative detection stages; many module implementations are grouped because the tree is extensive. Edges are limited to README-described behavior or relationships visible in the supplied excerpts and SOURCE INDEX; unsampled dispatch details are left unasserted.

Main entry points: [`src/fastfetch.c`](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/fastfetch.c) (Fastfetch entry), [`src/modules`](https://github.com/fastfetch-cli/fastfetch/tree/dev/src/modules) (Module collection), [`src/common/impl/printing.c`](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/common/impl/printing.c) (Formatted output), [`src/modules/gpu/gpu.c`](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/modules/gpu/gpu.c) (GPU module)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and configuration"]
  node_cli["Fastfetch entry<br/>[fastfetch.c]"]
  node_options["Display options<br/>[display.c]"]
  node_logo_options["Logo options<br/>[logo.c]"]
  node_json_config["JSONC configuration<br/>[jsonconfig.h]"]
end

subgraph group_modules["Information modules"]
  node_modules["Module collection"]
  node_gpu_module["GPU module<br/>[gpu.c]"]
  node_disk_module["Disk module<br/>[disk.c]"]
  node_display_module["Display module<br/>[display.c]"]
  node_packages_module["Packages module<br/>[packages.c]"]
end

subgraph group_runtime["Detection and platform"]
  node_detection["Platform detection"]
  node_gpu_detection["GPU detection"]
  node_disk_detection["Disk detection"]
  node_display_detection["Display detection"]
  node_packages_detection["Package detection"]
end

subgraph group_presentation["Output and shared support"]
  node_logo["Logo rendering<br/>[logo.c]"]
  node_image["Logo images<br/>[image.c]"]
  node_printing["Formatted output<br/>[printing.c]"]
  node_shared["Shared runtime utilities"]
  node_yyjson["JSON engine<br/>[yyjson.c]"]
end

node_user(("CLI user"))

node_user -->|"runs"| node_cli
node_cli -.->|"configures"| node_options
node_cli -->|"uses"| node_json_config
node_cli -->|"calls"| node_logo
node_cli -.->|"selects modules"| node_modules
node_options -->|"parses settings"| node_json_config
node_logo_options -->|"configures"| node_logo
node_modules -.->|"includes"| node_gpu_module
node_modules -.->|"includes"| node_disk_module
node_modules -.->|"includes"| node_display_module
node_modules -.->|"includes"| node_packages_module
node_gpu_module -->|"reads facts"| node_gpu_detection
node_disk_module -->|"reads facts"| node_disk_detection
node_display_module -->|"reads facts"| node_display_detection
node_packages_module -->|"reads facts"| node_packages_detection
node_detection -.->|"covers"| node_gpu_detection
node_logo -->|"uses"| node_image
node_gpu_module -->|"formats output"| node_printing
node_disk_module -->|"formats output"| node_printing
node_display_module -->|"formats output"| node_printing
node_packages_module -->|"formats output"| node_printing
node_cli -->|"uses utilities"| node_shared
node_json_config -.->|"uses"| node_yyjson

click node_cli "https://github.com/fastfetch-cli/fastfetch/blob/dev/src/fastfetch.c"
click node_options "https://github.com/fastfetch-cli/fastfetch/blob/dev/src/options/display.c"
click node_logo_options "https://github.com/fastfetch-cli/fastfetch/blob/dev/src/options/logo.c"
click node_json_config "https://github.com/fastfetch-cli/fastfetch/blob/dev/src/common/jsonconfig.h"
click node_modules "https://github.com/fastfetch-cli/fastfetch/tree/dev/src/modules"
click node_gpu_module "https://github.com/fastfetch-cli/fastfetch/blob/dev/src/modules/gpu/gpu.c"
click node_disk_module "https://github.com/fastfetch-cli/fastfetch/blob/dev/src/modules/disk/disk.c"
click node_display_module "https://github.com/fastfetch-cli/fastfetch/blob/dev/src/modules/display/display.c"
click node_packages_module "https://github.com/fastfetch-cli/fastfetch/blob/dev/src/modules/packages/packages.c"
click node_detection "https://github.com/fastfetch-cli/fastfetch/tree/dev/src/detection"
click node_gpu_detection "https://github.com/fastfetch-cli/fastfetch/tree/dev/src/detection/gpu"
click node_disk_detection "https://github.com/fastfetch-cli/fastfetch/tree/dev/src/detection/disk"
click node_display_detection "https://github.com/fastfetch-cli/fastfetch/tree/dev/src/detection/displayserver"
click node_packages_detection "https://github.com/fastfetch-cli/fastfetch/tree/dev/src/detection/packages"
click node_logo "https://github.com/fastfetch-cli/fastfetch/blob/dev/src/logo/logo.c"
click node_image "https://github.com/fastfetch-cli/fastfetch/blob/dev/src/logo/image/image.c"
click node_printing "https://github.com/fastfetch-cli/fastfetch/blob/dev/src/common/impl/printing.c"
click node_shared "https://github.com/fastfetch-cli/fastfetch/tree/dev/src/common"
click node_yyjson "https://github.com/fastfetch-cli/fastfetch/blob/dev/src/3rdparty/yyjson/yyjson.c"

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_options,node_logo_options,node_json_config,node_user toneBlue
class node_modules,node_gpu_module,node_disk_module,node_display_module,node_packages_module toneAmber
class node_detection,node_gpu_detection,node_disk_detection,node_display_detection,node_packages_detection toneMint
class node_logo,node_image,node_printing,node_shared,node_yyjson toneRose
```

## Components

### CLI and configuration

- [Fastfetch entry](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/fastfetch.c): `src/fastfetch.c`
- [Display options](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/options/display.c): `src/options/display.c`
- [Logo options](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/options/logo.c): `src/options/logo.c`
- [JSONC configuration](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/common/jsonconfig.h): `src/common/jsonconfig.h`

### Information modules

- [Module collection](https://github.com/fastfetch-cli/fastfetch/tree/dev/src/modules): `src/modules`
- [GPU module](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/modules/gpu/gpu.c): `src/modules/gpu/gpu.c`
- [Disk module](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/modules/disk/disk.c): `src/modules/disk/disk.c`
- [Display module](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/modules/display/display.c): `src/modules/display/display.c`
- [Packages module](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/modules/packages/packages.c): `src/modules/packages/packages.c`

### Detection and platform

- [Platform detection](https://github.com/fastfetch-cli/fastfetch/tree/dev/src/detection): `src/detection`
- [GPU detection](https://github.com/fastfetch-cli/fastfetch/tree/dev/src/detection/gpu): `src/detection/gpu`
- [Disk detection](https://github.com/fastfetch-cli/fastfetch/tree/dev/src/detection/disk): `src/detection/disk`
- [Display detection](https://github.com/fastfetch-cli/fastfetch/tree/dev/src/detection/displayserver): `src/detection/displayserver`
- [Package detection](https://github.com/fastfetch-cli/fastfetch/tree/dev/src/detection/packages): `src/detection/packages`

### Output and shared support

- [Logo rendering](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/logo/logo.c): `src/logo/logo.c`
- [Logo images](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/logo/image/image.c): `src/logo/image/image.c`
- [Formatted output](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/common/impl/printing.c): `src/common/impl/printing.c`
- [Shared runtime utilities](https://github.com/fastfetch-cli/fastfetch/tree/dev/src/common): `src/common`
- [JSON engine](https://github.com/fastfetch-cli/fastfetch/blob/dev/src/3rdparty/yyjson/yyjson.c): `src/3rdparty/yyjson/yyjson.c`

### Other components

- **CLI user**

## Connections

- CLI user → Fastfetch entry: runs (evidence: `README.md`)
- Fastfetch entry → Display options: configures
- Fastfetch entry → JSONC configuration: uses (evidence: `src/fastfetch.c`)
- Fastfetch entry → Logo rendering: calls (evidence: `src/fastfetch.c`)
- Fastfetch entry → Module collection: selects modules
- Display options → JSONC configuration: parses settings (evidence: `src/options/display.c`)
- Logo options → Logo rendering: configures (evidence: `src/options/logo.c`)
- Module collection → GPU module: includes (evidence: `src/modules/gpu/gpu.c`)
- Module collection → Disk module: includes (evidence: `src/modules/disk/disk.c`)
- Module collection → Display module: includes (evidence: `src/modules/display/display.c`)
- Module collection → Packages module: includes (evidence: `src/modules/packages/packages.c`)
- GPU module → GPU detection: reads facts (evidence: `src/modules/gpu/gpu.c`)
- Disk module → Disk detection: reads facts (evidence: `src/modules/disk/disk.c`)
- Display module → Display detection: reads facts (evidence: `src/modules/display/display.c`)
- Packages module → Package detection: reads facts (evidence: `src/modules/packages/packages.c`)
- Platform detection → GPU detection: covers
- Logo rendering → Logo images: uses (evidence: `src/logo/logo.c`)
- GPU module → Formatted output: formats output (evidence: `src/modules/gpu/gpu.c`)
- Disk module → Formatted output: formats output (evidence: `src/modules/disk/disk.c`)
- Display module → Formatted output: formats output (evidence: `src/modules/display/display.c`)
- Packages module → Formatted output: formats output (evidence: `src/modules/packages/packages.c`)
- Fastfetch entry → Shared runtime utilities: uses utilities (evidence: `src/fastfetch.c`)
- JSONC configuration → JSON engine: uses
