# vshvedov/rhun architecture

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

- Interactive diagram: https://gitdiagram.com/vshvedov/rhun
- Repository: https://github.com/vshvedov/rhun

## Overview

rhun is a lightweight desktop code editor for reading and editing projects, running commands and coding agents, and inspecting Git changes. The principal workflow is to open a project, edit and search its files, use the built-in terminal or agent panel alongside the code, and review or manage changes with Git. The README documents these capabilities, but the supplied source excerpts focus on build tooling and the website rather than application internals; internal dispatch and many feature connections are therefore left unasserted.

Main entry points: [`src/main.s`](https://github.com/vshvedov/rhun/blob/main/src/main.s) (Desktop App), [`src/app/editor.s`](https://github.com/vshvedov/rhun/blob/main/src/app/editor.s) (Code Editor), [`src/app/syntax.s`](https://github.com/vshvedov/rhun/blob/main/src/app/syntax.s) (Syntax Highlighting), [`src/app/git.s`](https://github.com/vshvedov/rhun/blob/main/src/app/git.s) (Git Operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace"]
  node_search["Project Search<br/>[find.s]"]
  node_explorer["File Explorer<br/>[explorer.s]"]
  node_images["Image Viewing<br/>[imageview.s]"]
end

subgraph group_editing["Editing"]
  node_editor["Code Editor<br/>[editor.s]"]
  node_syntax["Syntax Highlighting<br/>[syntax.s]"]
  node_grammars["Language Grammars"]
  node_vim["Vim Mode<br/>[vim.s]"]
  node_themes["Themes"]
end

subgraph group_tools["Developer Tools"]
  node_terminal["Built-in Terminal<br/>[term.s]"]
  node_terminalview["Terminal View<br/>[termview.s]"]
  node_git["Git Operations<br/>[git.s]"]
  node_gitview["Git Browser<br/>[gitview.s]"]
  node_diff["Diff Review<br/>[diff.s]"]
  node_agents["Agents Panel<br/>[agents.s]"]
  node_commitai["AI Commit Drafts<br/>[commit_ai.s]"]
end

subgraph group_runtime["Desktop Runtime"]
  node_app["Desktop App<br/>[main.s]"]
  node_window["Windowing<br/>[desktop.s]"]
  node_platform["Platform I/O"]
  node_ui["UI Toolkit<br/>[ui.s]"]
end

node_user(("Developer"))

node_user -->|"opens project"| node_app
node_app -.->|"uses"| node_editor
node_app -.->|"uses"| node_explorer
node_app -->|"offers search"| node_search
node_app -->|"offers terminal"| node_terminal
node_app -->|"offers Git"| node_git
node_app -->|"offers panel"| node_agents
node_editor -->|"highlights code"| node_syntax
node_editor -->|"supports mode"| node_vim
node_syntax -.->|"uses grammars"| node_grammars
node_app -->|"offers themes"| node_themes
node_app -.->|"shows terminal"| node_terminalview
node_app -->|"browses history"| node_gitview
node_app -->|"shows changes"| node_diff
node_git -->|"drafts commits"| node_commitai
node_user -.->|"opens images"| node_images
node_app -.->|"runs in"| node_window
node_window -.->|"uses platform"| node_platform
node_app -.->|"renders through"| node_ui

click node_app "https://github.com/vshvedov/rhun/blob/main/src/main.s"
click node_window "https://github.com/vshvedov/rhun/blob/main/src/app/desktop.s"
click node_platform "https://github.com/vshvedov/rhun/tree/main/src/plat"
click node_ui "https://github.com/vshvedov/rhun/blob/main/src/ui/ui.s"
click node_editor "https://github.com/vshvedov/rhun/blob/main/src/app/editor.s"
click node_syntax "https://github.com/vshvedov/rhun/blob/main/src/app/syntax.s"
click node_grammars "https://github.com/vshvedov/rhun/tree/main/runtime/syntax"
click node_vim "https://github.com/vshvedov/rhun/blob/main/src/app/vim.s"
click node_search "https://github.com/vshvedov/rhun/blob/main/src/app/find.s"
click node_explorer "https://github.com/vshvedov/rhun/blob/main/src/app/explorer.s"
click node_terminal "https://github.com/vshvedov/rhun/blob/main/src/app/term.s"
click node_terminalview "https://github.com/vshvedov/rhun/blob/main/src/app/termview.s"
click node_git "https://github.com/vshvedov/rhun/blob/main/src/app/git.s"
click node_gitview "https://github.com/vshvedov/rhun/blob/main/src/app/gitview.s"
click node_diff "https://github.com/vshvedov/rhun/blob/main/src/app/diff.s"
click node_agents "https://github.com/vshvedov/rhun/blob/main/src/app/agents.s"
click node_commitai "https://github.com/vshvedov/rhun/blob/main/src/app/commit_ai.s"
click node_themes "https://github.com/vshvedov/rhun/tree/main/runtime/themes"
click node_images "https://github.com/vshvedov/rhun/blob/main/src/app/imageview.s"

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_search,node_explorer,node_images toneBlue
class node_editor,node_syntax,node_grammars,node_vim,node_themes toneAmber
class node_terminal,node_terminalview,node_git,node_gitview,node_diff,node_agents,node_commitai toneMint
class node_app,node_window,node_platform,node_ui toneRose
class node_user toneIndigo
```

## Components

### Workspace

- [Project Search](https://github.com/vshvedov/rhun/blob/main/src/app/find.s): `src/app/find.s`
- [File Explorer](https://github.com/vshvedov/rhun/blob/main/src/app/explorer.s): `src/app/explorer.s`
- [Image Viewing](https://github.com/vshvedov/rhun/blob/main/src/app/imageview.s): `src/app/imageview.s`

### Editing

- [Code Editor](https://github.com/vshvedov/rhun/blob/main/src/app/editor.s): `src/app/editor.s`
- [Syntax Highlighting](https://github.com/vshvedov/rhun/blob/main/src/app/syntax.s): `src/app/syntax.s`
- [Language Grammars](https://github.com/vshvedov/rhun/tree/main/runtime/syntax): `runtime/syntax`
- [Vim Mode](https://github.com/vshvedov/rhun/blob/main/src/app/vim.s): `src/app/vim.s`
- [Themes](https://github.com/vshvedov/rhun/tree/main/runtime/themes): `runtime/themes`

### Developer Tools

- [Built-in Terminal](https://github.com/vshvedov/rhun/blob/main/src/app/term.s): `src/app/term.s`
- [Terminal View](https://github.com/vshvedov/rhun/blob/main/src/app/termview.s): `src/app/termview.s`
- [Git Operations](https://github.com/vshvedov/rhun/blob/main/src/app/git.s): `src/app/git.s`
- [Git Browser](https://github.com/vshvedov/rhun/blob/main/src/app/gitview.s): `src/app/gitview.s`
- [Diff Review](https://github.com/vshvedov/rhun/blob/main/src/app/diff.s): `src/app/diff.s`
- [Agents Panel](https://github.com/vshvedov/rhun/blob/main/src/app/agents.s): `src/app/agents.s`
- [AI Commit Drafts](https://github.com/vshvedov/rhun/blob/main/src/app/commit_ai.s): `src/app/commit_ai.s`

### Desktop Runtime

- [Desktop App](https://github.com/vshvedov/rhun/blob/main/src/main.s): `src/main.s`
- [Windowing](https://github.com/vshvedov/rhun/blob/main/src/app/desktop.s): `src/app/desktop.s`
- [Platform I/O](https://github.com/vshvedov/rhun/tree/main/src/plat): `src/plat`
- [UI Toolkit](https://github.com/vshvedov/rhun/blob/main/src/ui/ui.s): `src/ui/ui.s`

### Other components

- **Developer**

## Connections

- Developer → Desktop App: opens project (evidence: `README.md`)
- Desktop App → Code Editor: uses
- Desktop App → File Explorer: uses
- Desktop App → Project Search: offers search (evidence: `README.md`)
- Desktop App → Built-in Terminal: offers terminal (evidence: `README.md`)
- Desktop App → Git Operations: offers Git (evidence: `README.md`)
- Desktop App → Agents Panel: offers panel (evidence: `README.md`)
- Code Editor → Syntax Highlighting: highlights code (evidence: `README.md`)
- Code Editor → Vim Mode: supports mode (evidence: `README.md`)
- Syntax Highlighting → Language Grammars: uses grammars
- Desktop App → Themes: offers themes (evidence: `README.md`)
- Desktop App → Terminal View: shows terminal
- Desktop App → Git Browser: browses history (evidence: `README.md`)
- Desktop App → Diff Review: shows changes (evidence: `README.md`)
- Git Operations → AI Commit Drafts: drafts commits (evidence: `README.md`)
- Developer → Image Viewing: opens images
- Desktop App → Windowing: runs in
- Windowing → Platform I/O: uses platform
- Desktop App → UI Toolkit: renders through
