# lq920320/rs-alias-manager architecture

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

- Interactive diagram: https://gitdiagram.com/lq920320/rs-alias-manager
- Repository: https://github.com/lq920320/rs-alias-manager

## Overview

rs-alias-manager is a Tauri desktop GUI for managing Bash, Zsh, and Fish aliases. Users browse and search aliases, create or edit them, import/export JSON, and apply changes through the shell configuration backend; they can also import templates and configure application settings. The graph includes documented backup, update, and watcher capabilities, though some implementations were not sampled, so those relationships are omitted or marked unverified.

Main entry points: [`src/pages/alias_page.rs`](https://github.com/lq920320/rs-alias-manager/blob/main/src/pages/alias_page.rs) (Alias workspace), [`src-tauri/src/lib.rs`](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/lib.rs) (Tauri command registration), [`src-tauri/src/services/shell_config.rs`](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/shell_config.rs) (Shell config access), [`src/api/commands.rs`](https://github.com/lq920320/rs-alias-manager/blob/main/src/api/commands.rs) (Invoke wrappers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Desktop interface"]
  node_app["App router<br/>[app.rs]"]
  node_alias_page["Alias workspace<br/>[alias_page.rs]"]
  node_alias_widgets["Alias controls<br/>[alias_list.rs]"]
  node_config_view["Config viewer<br/>[config_viewer.rs]"]
  node_search["Alias search<br/>[search_bar.rs]"]
  node_template_page["Template library UI<br/>[template_page.rs]"]
  node_template_widgets["Template controls<br/>[template_list.rs]"]
  node_settings_page["Settings UI<br/>[settings_form.rs]"]
  node_app_state["Reactive state<br/>[app_state.rs]"]
  node_api["Invoke wrappers<br/>[commands.rs]"]
end

subgraph group_backend["Tauri command layer"]
  node_tauri["Tauri command registration<br/>[lib.rs]"]
  node_alias_commands["Alias commands<br/>[alias_cmds.rs]"]
  node_template_commands["Template commands<br/>[template_cmds.rs]"]
  node_settings_commands["Settings commands<br/>[settings_cmds.rs]"]
  node_backup_commands["Backup commands<br/>[backup_cmds.rs]"]
  node_update_commands["Update commands<br/>[update_cmds.rs]"]
end

subgraph group_shell["Shell configuration"]
  node_shell_config["Shell config access<br/>[shell_config.rs]"]
  node_parser["Alias parser<br/>[alias_parser.rs]"]
  node_safe_writer["Atomic writer<br/>[safe_writer.rs]"]
  node_shell_files[("Shell config files")]
  node_shell_type["Shell detection<br/>[shell_type.rs]"]
end

subgraph group_support["Settings and extensions"]
  node_settings[("Settings persistence<br/>[app_settings.rs]")]
  node_templates["Template catalog"]
  node_user_templates[("Custom template store")]
  node_backups["Config backup<br/>[config_backup.rs]"]
  node_watcher["Config watcher<br/>[config_watcher.rs]"]
  node_updates["Release update check<br/>[update_checker.rs]"]
end

node_user(("Desktop user"))
node_release_service["Release service"]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_alias_page
node_app -->|"routes to"| node_template_page
node_app -->|"routes to"| node_settings_page
node_alias_page -->|"renders"| node_alias_widgets
node_alias_page -->|"renders"| node_config_view
node_alias_page -->|"renders"| node_search
node_alias_page -->|"invokes"| node_api
node_alias_page -->|"updates"| node_app_state
node_search -->|"filters via"| node_app_state
node_template_page -->|"renders"| node_template_widgets
node_template_page -->|"invokes"| node_api
node_template_page -->|"updates"| node_app_state
node_settings_page -->|"invokes"| node_api
node_api -->|"invokes commands"| node_tauri
node_tauri -->|"registers"| node_alias_commands
node_tauri -->|"registers"| node_template_commands
node_tauri -->|"registers"| node_settings_commands
node_tauri -->|"registers"| node_backup_commands
node_tauri -->|"registers"| node_update_commands
node_alias_commands -->|"delegates"| node_shell_config
node_alias_commands -->|"backs up"| node_backups
node_shell_config -->|"parses with"| node_parser
node_shell_config -->|"writes via"| node_safe_writer
node_shell_config -->|"selects shell"| node_shell_type
node_shell_config -.->|"reads and writes"| node_shell_files
node_template_commands -->|"loads"| node_templates
node_template_commands -->|"manages"| node_user_templates
node_template_commands -->|"imports into"| node_shell_config
node_settings_commands -.->|"persists"| node_settings
node_backup_commands -.->|"delegates"| node_backups
node_backups -->|"writes via"| node_safe_writer
node_updates -->|"checks releases"| node_release_service
node_update_commands -.->|"checks"| node_updates
node_watcher -.->|"watches"| node_shell_files
node_watcher -.->|"signals changes"| node_api

click node_app "https://github.com/lq920320/rs-alias-manager/blob/main/src/app.rs"
click node_alias_page "https://github.com/lq920320/rs-alias-manager/blob/main/src/pages/alias_page.rs"
click node_alias_widgets "https://github.com/lq920320/rs-alias-manager/blob/main/src/components/alias_list.rs"
click node_config_view "https://github.com/lq920320/rs-alias-manager/blob/main/src/components/config_viewer.rs"
click node_search "https://github.com/lq920320/rs-alias-manager/blob/main/src/components/search_bar.rs"
click node_template_page "https://github.com/lq920320/rs-alias-manager/blob/main/src/pages/template_page.rs"
click node_template_widgets "https://github.com/lq920320/rs-alias-manager/blob/main/src/components/template_list.rs"
click node_settings_page "https://github.com/lq920320/rs-alias-manager/blob/main/src/components/settings_form.rs"
click node_app_state "https://github.com/lq920320/rs-alias-manager/blob/main/src/state/app_state.rs"
click node_api "https://github.com/lq920320/rs-alias-manager/blob/main/src/api/commands.rs"
click node_tauri "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/lib.rs"
click node_alias_commands "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/commands/alias_cmds.rs"
click node_template_commands "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/commands/template_cmds.rs"
click node_settings_commands "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/commands/settings_cmds.rs"
click node_backup_commands "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/commands/backup_cmds.rs"
click node_update_commands "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/commands/update_cmds.rs"
click node_shell_config "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/shell_config.rs"
click node_parser "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/alias_parser.rs"
click node_safe_writer "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/safe_writer.rs"
click node_shell_type "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/models/shell_type.rs"
click node_settings "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/app_settings.rs"
click node_templates "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/template_library.rs"
click node_user_templates "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/user_template_store.rs"
click node_backups "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/config_backup.rs"
click node_watcher "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/config_watcher.rs"
click node_updates "https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/update_checker.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_app,node_alias_page,node_alias_widgets,node_config_view,node_search,node_template_page,node_template_widgets,node_settings_page,node_app_state,node_api,node_user toneBlue
class node_tauri,node_alias_commands,node_template_commands,node_settings_commands,node_backup_commands,node_update_commands toneAmber
class node_shell_config,node_parser,node_safe_writer,node_shell_files,node_shell_type toneMint
class node_settings,node_templates,node_user_templates,node_backups,node_watcher,node_updates toneRose
class node_release_service toneIndigo
```

## Components

### Desktop interface

- [App router](https://github.com/lq920320/rs-alias-manager/blob/main/src/app.rs): `src/app.rs`
- [Alias workspace](https://github.com/lq920320/rs-alias-manager/blob/main/src/pages/alias_page.rs): `src/pages/alias_page.rs`
- [Alias controls](https://github.com/lq920320/rs-alias-manager/blob/main/src/components/alias_list.rs): `src/components/alias_list.rs`
- [Config viewer](https://github.com/lq920320/rs-alias-manager/blob/main/src/components/config_viewer.rs): `src/components/config_viewer.rs`
- [Alias search](https://github.com/lq920320/rs-alias-manager/blob/main/src/components/search_bar.rs): `src/components/search_bar.rs`
- [Template library UI](https://github.com/lq920320/rs-alias-manager/blob/main/src/pages/template_page.rs): `src/pages/template_page.rs`
- [Template controls](https://github.com/lq920320/rs-alias-manager/blob/main/src/components/template_list.rs): `src/components/template_list.rs`
- [Settings UI](https://github.com/lq920320/rs-alias-manager/blob/main/src/components/settings_form.rs): `src/components/settings_form.rs`
- [Reactive state](https://github.com/lq920320/rs-alias-manager/blob/main/src/state/app_state.rs): `src/state/app_state.rs`
- [Invoke wrappers](https://github.com/lq920320/rs-alias-manager/blob/main/src/api/commands.rs): `src/api/commands.rs`

### Tauri command layer

- [Tauri command registration](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/lib.rs): `src-tauri/src/lib.rs`
- [Alias commands](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/commands/alias_cmds.rs): `src-tauri/src/commands/alias_cmds.rs`
- [Template commands](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/commands/template_cmds.rs): `src-tauri/src/commands/template_cmds.rs`
- [Settings commands](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/commands/settings_cmds.rs): `src-tauri/src/commands/settings_cmds.rs`
- [Backup commands](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/commands/backup_cmds.rs): `src-tauri/src/commands/backup_cmds.rs`
- [Update commands](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/commands/update_cmds.rs): `src-tauri/src/commands/update_cmds.rs`

### Shell configuration

- [Shell config access](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/shell_config.rs): `src-tauri/src/services/shell_config.rs`
- [Alias parser](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/alias_parser.rs): `src-tauri/src/services/alias_parser.rs`
- [Atomic writer](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/safe_writer.rs): `src-tauri/src/services/safe_writer.rs`
- **Shell config files**
- [Shell detection](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/models/shell_type.rs): `src-tauri/src/models/shell_type.rs`

### Settings and extensions

- [Settings persistence](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/app_settings.rs): `src-tauri/src/services/app_settings.rs`
- [Template catalog](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/template_library.rs): `src-tauri/src/services/template_library.rs`
- [Custom template store](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/user_template_store.rs): `src-tauri/src/services/user_template_store.rs`
- [Config backup](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/config_backup.rs): `src-tauri/src/services/config_backup.rs`
- [Config watcher](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/config_watcher.rs): `src-tauri/src/services/config_watcher.rs`
- [Release update check](https://github.com/lq920320/rs-alias-manager/blob/main/src-tauri/src/services/update_checker.rs): `src-tauri/src/services/update_checker.rs`

### Other components

- **Desktop user**
- **Release service**

## Connections

- Desktop user → App router: uses
- App router → Alias workspace: routes to (evidence: `src/app.rs`)
- App router → Template library UI: routes to (evidence: `src/app.rs`)
- App router → Settings UI: routes to (evidence: `src/app.rs`)
- Alias workspace → Alias controls: renders (evidence: `src/pages/alias_page.rs`)
- Alias workspace → Config viewer: renders (evidence: `src/pages/alias_page.rs`)
- Alias workspace → Alias search: renders (evidence: `src/pages/alias_page.rs`)
- Alias workspace → Invoke wrappers: invokes (evidence: `src/pages/alias_page.rs`)
- Alias workspace → Reactive state: updates (evidence: `src/pages/alias_page.rs`)
- Alias search → Reactive state: filters via (evidence: `src/components/search_bar.rs`)
- Template library UI → Template controls: renders (evidence: `src/pages/template_page.rs`)
- Template library UI → Invoke wrappers: invokes (evidence: `src/pages/template_page.rs`)
- Template library UI → Reactive state: updates (evidence: `src/pages/template_page.rs`)
- Settings UI → Invoke wrappers: invokes (evidence: `src/components/settings_form.rs`)
- Invoke wrappers → Tauri command registration: invokes commands (evidence: `src/api/commands.rs`)
- Tauri command registration → Alias commands: registers (evidence: `src-tauri/src/lib.rs`)
- Tauri command registration → Template commands: registers (evidence: `src-tauri/src/lib.rs`)
- Tauri command registration → Settings commands: registers
- Tauri command registration → Backup commands: registers
- Tauri command registration → Update commands: registers
- Alias commands → Shell config access: delegates (evidence: `src-tauri/src/commands/alias_cmds.rs`)
- Alias commands → Config backup: backs up (evidence: `src-tauri/src/commands/alias_cmds.rs`)
- Shell config access → Alias parser: parses with (evidence: `src-tauri/src/services/shell_config.rs`)
- Shell config access → Atomic writer: writes via (evidence: `src-tauri/src/services/shell_config.rs`)
- Shell config access → Shell detection: selects shell (evidence: `src-tauri/src/services/shell_config.rs`)
- Shell config access → Shell config files: reads and writes
- Template commands → Template catalog: loads (evidence: `src-tauri/src/commands/template_cmds.rs`)
- Template commands → Custom template store: manages (evidence: `src-tauri/src/commands/template_cmds.rs`)
- Template commands → Shell config access: imports into (evidence: `src-tauri/src/commands/template_cmds.rs`)
- Settings commands → Settings persistence: persists
- Backup commands → Config backup: delegates
- Config backup → Atomic writer: writes via (evidence: `src-tauri/src/services/config_backup.rs`)
- Release update check → Release service: checks releases (evidence: `src-tauri/src/services/update_checker.rs`)
- Update commands → Release update check: checks
- Config watcher → Shell config files: watches
- Config watcher → Invoke wrappers: signals changes
