# lechakrawarthy/vazr architecture

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

- Interactive diagram: https://gitdiagram.com/lechakrawarthy/vazr
- Repository: https://github.com/lechakrawarthy/vazr

## Overview

vazr is a cross-platform CLI for finding and safely cleaning disk bloat. The main workflow is: parse CLI options and configuration, scan files into cleanup categories, review and select actions in the TUI (or export results), then execute deletions or moves and record operations. Profiles provide reusable scan settings; update notices are an optional side path. The graph follows the documented capabilities and sampled call sites; unsampled internals are represented only where the README and tree support them.

Main entry points: [`src/index.js`](https://github.com/lechakrawarthy/vazr/blob/main/src/index.js) (Cleanup orchestrator), [`bin/vazr.js`](https://github.com/lechakrawarthy/vazr/blob/main/bin/vazr.js) (Command entry), [`src/scanner.js`](https://github.com/lechakrawarthy/vazr/blob/main/src/scanner.js) (Category scanning), [`src/tui/review.js`](https://github.com/lechakrawarthy/vazr/blob/main/src/tui/review.js) (Interactive review)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI &amp; Configuration"]
  node_cli["Command entry<br/>[vazr.js]"]
  node_config["Config loading<br/>[config.js]"]
  node_validators["Option validation<br/>[validators.js]"]
end

subgraph group_scan["Discovery &amp; Review"]
  node_runtime["Cleanup orchestrator<br/>[index.js]"]
  node_scanner["Category scanning<br/>[scanner.js]"]
  node_platform["Platform paths<br/>[platform.js]"]
  node_review["Interactive review<br/>[review.js]"]
  node_screen["Terminal screens<br/>[screen.js]"]
  node_input["Keyboard input<br/>[input.js]"]
end

subgraph group_actions["Cleanup &amp; Reporting"]
  node_executor["File operations<br/>[executor.js]"]
  node_logger["Audit logging<br/>[logger.js]"]
  node_logfile[("Audit log")]
  node_exporter["Result export<br/>[exporter.js]"]
  node_update["Update check<br/>[update-check.js]"]
end

subgraph group_profiles["Profiles"]
  node_profile_cli["Profile commands<br/>[vazr.js]"]
  node_profile_logic["Profile handling<br/>[profiles.js]"]
  node_profile_store[("Profile files")]
end

node_user(("CLI user"))
node_filesystem[("Local filesystem")]
node_trash["OS Trash"]
node_npm["npm registry"]

node_user -->|"runs commands"| node_cli
node_cli -->|"loads settings"| node_config
node_cli -->|"validates options"| node_validators
node_cli -->|"manages profiles"| node_profile_logic
node_profile_cli -->|"runs commands"| node_profile_logic
node_profile_logic -->|"reads/writes"| node_profile_store
node_cli -->|"starts cleanup"| node_runtime
node_runtime -->|"scans categories"| node_scanner
node_scanner -->|"gets scan roots"| node_platform
node_scanner -->|"reads paths"| node_filesystem
node_runtime -->|"requests review"| node_review
node_runtime -->|"renders progress"| node_screen
node_review -->|"renders review"| node_screen
node_review -->|"reads keys"| node_input
node_runtime -->|"executes selections"| node_executor
node_executor -->|"moves/deletes"| node_filesystem
node_executor -.->|"trashes items"| node_trash
node_runtime -->|"records operations"| node_logger
node_logger -->|"writes entries"| node_logfile
node_runtime -->|"exports results"| node_exporter
node_runtime -.->|"checks version"| node_update
node_update -.->|"queries registry"| node_npm

click node_cli "https://github.com/lechakrawarthy/vazr/blob/main/bin/vazr.js"
click node_config "https://github.com/lechakrawarthy/vazr/blob/main/src/config.js"
click node_validators "https://github.com/lechakrawarthy/vazr/blob/main/src/validators.js"
click node_profile_cli "https://github.com/lechakrawarthy/vazr/blob/main/bin/vazr.js"
click node_profile_logic "https://github.com/lechakrawarthy/vazr/blob/main/src/profiles.js"
click node_runtime "https://github.com/lechakrawarthy/vazr/blob/main/src/index.js"
click node_scanner "https://github.com/lechakrawarthy/vazr/blob/main/src/scanner.js"
click node_platform "https://github.com/lechakrawarthy/vazr/blob/main/src/platform.js"
click node_review "https://github.com/lechakrawarthy/vazr/blob/main/src/tui/review.js"
click node_screen "https://github.com/lechakrawarthy/vazr/blob/main/src/tui/screen.js"
click node_input "https://github.com/lechakrawarthy/vazr/blob/main/src/tui/input.js"
click node_executor "https://github.com/lechakrawarthy/vazr/blob/main/src/executor.js"
click node_logger "https://github.com/lechakrawarthy/vazr/blob/main/src/logger.js"
click node_exporter "https://github.com/lechakrawarthy/vazr/blob/main/src/exporter.js"
click node_update "https://github.com/lechakrawarthy/vazr/blob/main/src/update-check.js"

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_config,node_validators,node_user toneBlue
class node_runtime,node_scanner,node_platform,node_review,node_screen,node_input,node_filesystem toneAmber
class node_executor,node_logger,node_logfile,node_exporter,node_update toneMint
class node_profile_cli,node_profile_logic,node_profile_store toneRose
class node_trash,node_npm toneIndigo
```

## Components

### CLI & Configuration

- [Command entry](https://github.com/lechakrawarthy/vazr/blob/main/bin/vazr.js): `bin/vazr.js`
- [Config loading](https://github.com/lechakrawarthy/vazr/blob/main/src/config.js): `src/config.js`
- [Option validation](https://github.com/lechakrawarthy/vazr/blob/main/src/validators.js): `src/validators.js`

### Discovery & Review

- [Cleanup orchestrator](https://github.com/lechakrawarthy/vazr/blob/main/src/index.js): `src/index.js`
- [Category scanning](https://github.com/lechakrawarthy/vazr/blob/main/src/scanner.js): `src/scanner.js`
- [Platform paths](https://github.com/lechakrawarthy/vazr/blob/main/src/platform.js): `src/platform.js`
- [Interactive review](https://github.com/lechakrawarthy/vazr/blob/main/src/tui/review.js): `src/tui/review.js`
- [Terminal screens](https://github.com/lechakrawarthy/vazr/blob/main/src/tui/screen.js): `src/tui/screen.js`
- [Keyboard input](https://github.com/lechakrawarthy/vazr/blob/main/src/tui/input.js): `src/tui/input.js`

### Cleanup & Reporting

- [File operations](https://github.com/lechakrawarthy/vazr/blob/main/src/executor.js): `src/executor.js`
- [Audit logging](https://github.com/lechakrawarthy/vazr/blob/main/src/logger.js): `src/logger.js`
- **Audit log**
- [Result export](https://github.com/lechakrawarthy/vazr/blob/main/src/exporter.js): `src/exporter.js`
- [Update check](https://github.com/lechakrawarthy/vazr/blob/main/src/update-check.js): `src/update-check.js`

### Profiles

- [Profile commands](https://github.com/lechakrawarthy/vazr/blob/main/bin/vazr.js): `bin/vazr.js`
- [Profile handling](https://github.com/lechakrawarthy/vazr/blob/main/src/profiles.js): `src/profiles.js`
- **Profile files**

### Other components

- **CLI user**
- **Local filesystem**
- **OS Trash**
- **npm registry**

## Connections

- CLI user → Command entry: runs commands
- Command entry → Config loading: loads settings
- Command entry → Option validation: validates options
- Command entry → Profile handling: manages profiles
- Profile commands → Profile handling: runs commands
- Profile handling → Profile files: reads/writes
- Command entry → Cleanup orchestrator: starts cleanup
- Cleanup orchestrator → Category scanning: scans categories
- Category scanning → Platform paths: gets scan roots
- Category scanning → Local filesystem: reads paths
- Cleanup orchestrator → Interactive review: requests review
- Cleanup orchestrator → Terminal screens: renders progress
- Interactive review → Terminal screens: renders review
- Interactive review → Keyboard input: reads keys
- Cleanup orchestrator → File operations: executes selections
- File operations → Local filesystem: moves/deletes
- File operations → OS Trash: trashes items
- Cleanup orchestrator → Audit logging: records operations
- Audit logging → Audit log: writes entries
- Cleanup orchestrator → Result export: exports results
- Cleanup orchestrator → Update check: checks version
- Update check → npm registry: queries registry
