# zhugecaomao/altrun architecture

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

## Overview

ALTRun is a Windows launcher centered on an Alt+Space search window: a user query is matched against registered providers, results are ranked, and the selected result is executed or acted on. The map also preserves documented file search, clipboard, snippets, system commands, settings, and extensions. The README identifies module responsibilities and the startup entry point; sampled source did not include runtime modules, so uncertain call wiring is omitted.

Main entry points: [`Src/Core/ProviderRegistry.ahk`](https://github.com/zhugecaomao/altrun/blob/main/Src/Core/ProviderRegistry.ahk) (Provider registry), [`Src/UI/SearchWindow.ahk`](https://github.com/zhugecaomao/altrun/blob/main/Src/UI/SearchWindow.ahk) (Search window), [`Src/Core/App.ahk`](https://github.com/zhugecaomao/altrun/blob/main/Src/Core/App.ahk) (App lifecycle), [`Src/Providers/FileSearchProvider.ahk`](https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/FileSearchProvider.ahk) (File search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Launcher and UI"]
  node_entry["Startup entry<br/>[ALTRun.ahk]"]
  node_app["App lifecycle<br/>[App.ahk]"]
  node_searchui["Search window<br/>[SearchWindow.ahk]"]
  node_prefs["Preferences UI"]
  node_themes["Themes<br/>[ThemeManager.ahk]"]
end

subgraph group_search["Search and ranking"]
  node_searchquery["Query model<br/>[SearchQuery.ahk]"]
  node_registry["Provider registry"]
  node_matcher["Fuzzy matching<br/>[FuzzyMatcher.ahk]"]
  node_result["Result model<br/>[ResultItem.ahk]"]
  node_actions["Action catalog<br/>[ActionCatalog.ahk]"]
  node_index["Local file index<br/>[FileIndex.ahk]"]
end

subgraph group_providers["Search providers"]
  node_applications["Application search"]
  node_files["File search"]
  node_calculator["Calculator"]
  node_web["Web search"]
  node_clipboard["Clipboard history"]
  node_system["System commands<br/>[SystemProvider.ahk]"]
  node_custom["Commands and snippets"]
  node_terminal["Terminal commands"]
end

subgraph group_state["Settings and usage"]
  node_usage["Usage learning<br/>[Usage.ahk]"]
  node_settings["App settings<br/>[AppSettings.ahk]"]
  node_themefiles["Theme definitions"]
end

subgraph group_extensions["Extensions"]
  node_selection["Selection actions"]
  node_snippets["Snippet expansion"]
  node_dialogtools["Dialog navigation"]
  node_pttools["PT toolbox<br/>[PTToolsWindow.ahk]"]
  node_autodate["Auto date<br/>[AutoDate.ahk]"]
  node_updater["Update checker<br/>[UpdateChecker.ahk]"]
end

node_user(("User"))
node_everything["Everything search"]
node_github["GitHub releases"]

node_user -->|"launches"| node_entry
node_entry -->|"starts"| node_app
node_user -->|"enters query"| node_searchui
node_searchui -->|"parses input"| node_searchquery
node_searchui -->|"requests results"| node_registry
node_registry -->|"dispatches search"| node_applications
node_registry -->|"dispatches search"| node_files
node_registry -->|"dispatches search"| node_calculator
node_registry -->|"dispatches search"| node_web
node_registry -->|"dispatches search"| node_clipboard
node_registry -->|"dispatches search"| node_system
node_registry -->|"dispatches search"| node_custom
node_registry -->|"dispatches search"| node_terminal
node_files -->|"queries index"| node_index
node_files -.->|"queries when available"| node_everything
node_registry -->|"ranks matches"| node_matcher
node_registry -->|"returns results"| node_result
node_searchui -->|"displays results"| node_result
node_searchui -->|"requests actions"| node_actions
node_searchui -->|"records selection"| node_usage
node_app -->|"loads settings"| node_settings
node_prefs -->|"edits settings"| node_settings
node_themes -->|"loads themes"| node_themefiles
node_searchui -->|"invokes selection tools"| node_selection
node_custom -->|"supports expansion"| node_snippets
node_app -->|"enables extensions"| node_dialogtools
node_app -->|"enables toolbox"| node_pttools
node_app -->|"enables extension"| node_autodate
node_app -->|"checks updates"| node_updater
node_updater -->|"checks releases"| node_github

click node_entry "https://github.com/zhugecaomao/altrun/blob/main/ALTRun.ahk"
click node_app "https://github.com/zhugecaomao/altrun/blob/main/Src/Core/App.ahk"
click node_searchui "https://github.com/zhugecaomao/altrun/blob/main/Src/UI/SearchWindow.ahk"
click node_prefs "https://github.com/zhugecaomao/altrun/blob/main/Src/UI/PreferencesWindow.ahk"
click node_searchquery "https://github.com/zhugecaomao/altrun/blob/main/Src/Core/SearchQuery.ahk"
click node_registry "https://github.com/zhugecaomao/altrun/blob/main/Src/Core/ProviderRegistry.ahk"
click node_matcher "https://github.com/zhugecaomao/altrun/blob/main/Src/Core/FuzzyMatcher.ahk"
click node_result "https://github.com/zhugecaomao/altrun/blob/main/Src/Core/ResultItem.ahk"
click node_actions "https://github.com/zhugecaomao/altrun/blob/main/Src/Core/ActionCatalog.ahk"
click node_applications "https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/ApplicationProvider.ahk"
click node_files "https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/FileSearchProvider.ahk"
click node_calculator "https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/CalculatorProvider.ahk"
click node_web "https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/WebSearchProvider.ahk"
click node_clipboard "https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/ClipboardProvider.ahk"
click node_system "https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/SystemProvider.ahk"
click node_custom "https://github.com/zhugecaomao/altrun/tree/main/Src/Providers"
click node_terminal "https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/TerminalProvider.ahk"
click node_index "https://github.com/zhugecaomao/altrun/blob/main/Src/Core/FileIndex.ahk"
click node_usage "https://github.com/zhugecaomao/altrun/blob/main/Src/Core/Usage.ahk"
click node_settings "https://github.com/zhugecaomao/altrun/blob/main/Src/Core/AppSettings.ahk"
click node_themes "https://github.com/zhugecaomao/altrun/blob/main/Src/UI/ThemeManager.ahk"
click node_themefiles "https://github.com/zhugecaomao/altrun/tree/main/Resources/Themes"
click node_selection "https://github.com/zhugecaomao/altrun/blob/main/Src/Extensions/SelectionActions.ahk"
click node_snippets "https://github.com/zhugecaomao/altrun/blob/main/Src/Extensions/SnippetExpander.ahk"
click node_dialogtools "https://github.com/zhugecaomao/altrun/tree/main/Src/Extensions"
click node_pttools "https://github.com/zhugecaomao/altrun/blob/main/Src/Extensions/PTToolsWindow.ahk"
click node_autodate "https://github.com/zhugecaomao/altrun/blob/main/Src/Extensions/AutoDate.ahk"
click node_updater "https://github.com/zhugecaomao/altrun/blob/main/Src/Extensions/UpdateChecker.ahk"

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_entry,node_app,node_searchui,node_prefs,node_themes,node_user toneBlue
class node_searchquery,node_registry,node_matcher,node_result,node_actions,node_index toneAmber
class node_applications,node_files,node_calculator,node_web,node_clipboard,node_system,node_custom,node_terminal toneMint
class node_usage,node_settings,node_themefiles toneRose
class node_selection,node_snippets,node_dialogtools,node_pttools,node_autodate,node_updater,node_everything,node_github toneIndigo
```

## Components

### Launcher and UI

- [Startup entry](https://github.com/zhugecaomao/altrun/blob/main/ALTRun.ahk): `ALTRun.ahk`
- [App lifecycle](https://github.com/zhugecaomao/altrun/blob/main/Src/Core/App.ahk): `Src/Core/App.ahk`
- [Search window](https://github.com/zhugecaomao/altrun/blob/main/Src/UI/SearchWindow.ahk): `Src/UI/SearchWindow.ahk`
- [Preferences UI](https://github.com/zhugecaomao/altrun/blob/main/Src/UI/PreferencesWindow.ahk): `Src/UI/PreferencesWindow.ahk`
- [Themes](https://github.com/zhugecaomao/altrun/blob/main/Src/UI/ThemeManager.ahk): `Src/UI/ThemeManager.ahk`

### Search and ranking

- [Query model](https://github.com/zhugecaomao/altrun/blob/main/Src/Core/SearchQuery.ahk): `Src/Core/SearchQuery.ahk`
- [Provider registry](https://github.com/zhugecaomao/altrun/blob/main/Src/Core/ProviderRegistry.ahk): `Src/Core/ProviderRegistry.ahk`
- [Fuzzy matching](https://github.com/zhugecaomao/altrun/blob/main/Src/Core/FuzzyMatcher.ahk): `Src/Core/FuzzyMatcher.ahk`
- [Result model](https://github.com/zhugecaomao/altrun/blob/main/Src/Core/ResultItem.ahk): `Src/Core/ResultItem.ahk`
- [Action catalog](https://github.com/zhugecaomao/altrun/blob/main/Src/Core/ActionCatalog.ahk): `Src/Core/ActionCatalog.ahk`
- [Local file index](https://github.com/zhugecaomao/altrun/blob/main/Src/Core/FileIndex.ahk): `Src/Core/FileIndex.ahk`

### Search providers

- [Application search](https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/ApplicationProvider.ahk): `Src/Providers/ApplicationProvider.ahk`
- [File search](https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/FileSearchProvider.ahk): `Src/Providers/FileSearchProvider.ahk`
- [Calculator](https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/CalculatorProvider.ahk): `Src/Providers/CalculatorProvider.ahk`
- [Web search](https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/WebSearchProvider.ahk): `Src/Providers/WebSearchProvider.ahk`
- [Clipboard history](https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/ClipboardProvider.ahk): `Src/Providers/ClipboardProvider.ahk`
- [System commands](https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/SystemProvider.ahk): `Src/Providers/SystemProvider.ahk`
- [Commands and snippets](https://github.com/zhugecaomao/altrun/tree/main/Src/Providers): `Src/Providers`
- [Terminal commands](https://github.com/zhugecaomao/altrun/blob/main/Src/Providers/TerminalProvider.ahk): `Src/Providers/TerminalProvider.ahk`

### Settings and usage

- [Usage learning](https://github.com/zhugecaomao/altrun/blob/main/Src/Core/Usage.ahk): `Src/Core/Usage.ahk`
- [App settings](https://github.com/zhugecaomao/altrun/blob/main/Src/Core/AppSettings.ahk): `Src/Core/AppSettings.ahk`
- [Theme definitions](https://github.com/zhugecaomao/altrun/tree/main/Resources/Themes): `Resources/Themes`

### Extensions

- [Selection actions](https://github.com/zhugecaomao/altrun/blob/main/Src/Extensions/SelectionActions.ahk): `Src/Extensions/SelectionActions.ahk`
- [Snippet expansion](https://github.com/zhugecaomao/altrun/blob/main/Src/Extensions/SnippetExpander.ahk): `Src/Extensions/SnippetExpander.ahk`
- [Dialog navigation](https://github.com/zhugecaomao/altrun/tree/main/Src/Extensions): `Src/Extensions`
- [PT toolbox](https://github.com/zhugecaomao/altrun/blob/main/Src/Extensions/PTToolsWindow.ahk): `Src/Extensions/PTToolsWindow.ahk`
- [Auto date](https://github.com/zhugecaomao/altrun/blob/main/Src/Extensions/AutoDate.ahk): `Src/Extensions/AutoDate.ahk`
- [Update checker](https://github.com/zhugecaomao/altrun/blob/main/Src/Extensions/UpdateChecker.ahk): `Src/Extensions/UpdateChecker.ahk`

### Other components

- **User**
- **Everything search**
- **GitHub releases**

## Connections

- User → Startup entry: launches
- Startup entry → App lifecycle: starts
- User → Search window: enters query
- Search window → Query model: parses input
- Search window → Provider registry: requests results
- Provider registry → Application search: dispatches search
- Provider registry → File search: dispatches search
- Provider registry → Calculator: dispatches search
- Provider registry → Web search: dispatches search
- Provider registry → Clipboard history: dispatches search
- Provider registry → System commands: dispatches search
- Provider registry → Commands and snippets: dispatches search
- Provider registry → Terminal commands: dispatches search
- File search → Local file index: queries index
- File search → Everything search: queries when available
- Provider registry → Fuzzy matching: ranks matches
- Provider registry → Result model: returns results
- Search window → Result model: displays results
- Search window → Action catalog: requests actions
- Search window → Usage learning: records selection
- App lifecycle → App settings: loads settings
- Preferences UI → App settings: edits settings
- Themes → Theme definitions: loads themes
- Search window → Selection actions: invokes selection tools
- Commands and snippets → Snippet expansion: supports expansion
- App lifecycle → Dialog navigation: enables extensions
- App lifecycle → PT toolbox: enables toolbox
- App lifecycle → Auto date: enables extension
- App lifecycle → Update checker: checks updates
- Update checker → GitHub releases: checks releases
