# amrskh/angkorfetch architecture

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

- Interactive diagram: https://gitdiagram.com/amrskh/angkorfetch
- Repository: https://github.com/amrskh/angkorfetch

## Overview

AngkorFetch is a cross-platform terminal system-information tool. The principal workflow is to run the CLI, collect system and hardware details, then display a terminal-adaptive summary; `--hinfo` requests additional hardware diagnostics, while help and version are separate CLI modes. The runtime is implemented in one Rust source file, so its logical stages share that path. The excerpts show selected probes and output logic, but omit much of the dispatch and collection code; edges based on documented behavior cite the README.

Main entry points: [`src/main.rs`](https://github.com/amrskh/angkorfetch/blob/main/src/main.rs) (System summary)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI"]
  node_cli["Command handling<br/>[main.rs]"]
end

subgraph group_collection["Information collection"]
  node_summary["System summary<br/>[main.rs]"]
  node_hardware["Hardware diagnostics<br/>[main.rs]"]
  node_sysinfo["System metrics<br/>[main.rs]"]
  node_osprobes["OS hardware probes<br/>[main.rs]"]
  node_context["Runtime context<br/>[main.rs]"]
end

subgraph group_output["Terminal output"]
  node_adaptive["Adaptive layout<br/>[main.rs]"]
  node_render["Colored output<br/>[main.rs]"]
end

node_user(("User"))
node_os{{"Operating system interfaces"}}
node_terminal(("Terminal"))

node_user -->|"runs"| node_cli
node_cli -->|"shows summary"| node_summary
node_cli -->|"requests details"| node_hardware
node_summary -.->|"collects metrics"| node_sysinfo
node_summary -.->|"queries hardware"| node_osprobes
node_summary -.->|"collects context"| node_context
node_hardware -.->|"queries details"| node_osprobes
node_osprobes -->|"reads OS data"| node_os
node_sysinfo -.->|"reads metrics"| node_os
node_summary -->|"adapts output"| node_adaptive
node_hardware -.->|"formats details"| node_adaptive
node_adaptive -.->|"checks capabilities"| node_terminal
node_adaptive -->|"selects layout"| node_render
node_render -.->|"prints output"| node_terminal

click node_cli "https://github.com/amrskh/angkorfetch/blob/main/src/main.rs"
click node_summary "https://github.com/amrskh/angkorfetch/blob/main/src/main.rs"
click node_hardware "https://github.com/amrskh/angkorfetch/blob/main/src/main.rs"
click node_sysinfo "https://github.com/amrskh/angkorfetch/blob/main/src/main.rs"
click node_osprobes "https://github.com/amrskh/angkorfetch/blob/main/src/main.rs"
click node_context "https://github.com/amrskh/angkorfetch/blob/main/src/main.rs"
click node_adaptive "https://github.com/amrskh/angkorfetch/blob/main/src/main.rs"
click node_render "https://github.com/amrskh/angkorfetch/blob/main/src/main.rs"

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_user toneBlue
class node_summary,node_hardware,node_sysinfo,node_osprobes,node_context toneAmber
class node_adaptive,node_render toneMint
class node_os,node_terminal toneIndigo
```

## Components

### CLI

- [Command handling](https://github.com/amrskh/angkorfetch/blob/main/src/main.rs): `src/main.rs`

### Information collection

- [System summary](https://github.com/amrskh/angkorfetch/blob/main/src/main.rs): `src/main.rs`
- [Hardware diagnostics](https://github.com/amrskh/angkorfetch/blob/main/src/main.rs): `src/main.rs`
- [System metrics](https://github.com/amrskh/angkorfetch/blob/main/src/main.rs): `src/main.rs`
- [OS hardware probes](https://github.com/amrskh/angkorfetch/blob/main/src/main.rs): `src/main.rs`
- [Runtime context](https://github.com/amrskh/angkorfetch/blob/main/src/main.rs): `src/main.rs`

### Terminal output

- [Adaptive layout](https://github.com/amrskh/angkorfetch/blob/main/src/main.rs): `src/main.rs`
- [Colored output](https://github.com/amrskh/angkorfetch/blob/main/src/main.rs): `src/main.rs`

### Other components

- **User**
- **Operating system interfaces**
- **Terminal**

## Connections

- User → Command handling: runs (evidence: `README.md`)
- Command handling → System summary: shows summary (evidence: `README.md`)
- Command handling → Hardware diagnostics: requests details (evidence: `README.md`)
- System summary → System metrics: collects metrics (evidence: `src/main.rs`)
- System summary → OS hardware probes: queries hardware (evidence: `src/main.rs`)
- System summary → Runtime context: collects context (evidence: `src/main.rs`)
- Hardware diagnostics → OS hardware probes: queries details (evidence: `src/main.rs`)
- OS hardware probes → Operating system interfaces: reads OS data (evidence: `src/main.rs`)
- System metrics → Operating system interfaces: reads metrics
- System summary → Adaptive layout: adapts output (evidence: `README.md`)
- Hardware diagnostics → Adaptive layout: formats details (evidence: `src/main.rs`)
- Adaptive layout → Terminal: checks capabilities
- Adaptive layout → Colored output: selects layout (evidence: `README.md`)
- Colored output → Terminal: prints output
