# firetruck666/envproxy architecture

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

- Interactive diagram: https://gitdiagram.com/firetruck666/envproxy
- Repository: https://github.com/firetruck666/envproxy

## Overview

EnvProxy is a cross-platform terminal proxy monitor: users install it once, then it detects whether a local proxy is genuinely usable and keeps command-line proxy environment variables aligned with that state. The README documents lifecycle controls, status and updates, relocation recovery, and logging. The tree identifies the platform scripts, but no source excerpts were supplied, so the diagram follows documented behavior and avoids inferring finer internal call structure.

Main entry points: [`win/envproxy.ps1`](https://github.com/firetruck666/envproxy/blob/main/win/envproxy.ps1) (Monitor and probe), [`mac`](https://github.com/firetruck666/envproxy/tree/main/mac) (Monitor and probe), [`win/1-安装.cmd`](https://github.com/firetruck666/envproxy/blob/main/win/1-%E5%AE%89%E8%A3%85.cmd) (Install / repair), [`win/2-停止监控.cmd`](https://github.com/firetruck666/envproxy/blob/main/win/2-%E5%81%9C%E6%AD%A2%E7%9B%91%E6%8E%A7.cmd) (Stop monitor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User controls"]
  node_win_install["Install / repair<br/>[1-安装.cmd]"]
  node_win_stop["Stop monitor<br/>[2-停止监控.cmd]"]
  node_win_restore["Uninstall<br/>[3-一键恢复.cmd]"]
  node_win_status["View status<br/>[4-查看状态.cmd]"]
  node_win_update["Check updates<br/>[5-检查更新.cmd]"]
  node_mac_install["Install / repair<br/>[install.sh]"]
  node_mac_stop["Stop monitor<br/>[stop.sh]"]
  node_mac_restore["Uninstall<br/>[uninstall.sh]"]
  node_mac_status["View status<br/>[status.sh]"]
  node_mac_update["Check updates<br/>[update.sh]"]
end

subgraph group_lifecycle["Installation lifecycle"]
  node_win_lifecycle["Startup and cleanup"]
  node_mac_lifecycle["Startup and cleanup"]
  node_win_locator["Relocation locator"]
  node_mac_locator["Relocation locator<br/>[locator.sh]"]
end

subgraph group_monitor["Proxy monitoring"]
  node_win_monitor["Monitor and probe<br/>[envproxy.ps1]"]
  node_mac_monitor["Monitor and probe"]
end

subgraph group_support["Status and updates"]
  node_win_logs["Monitor logs"]
  node_mac_logs["Monitor logs"]
end

node_win_user(("Windows user"))
node_mac_user(("macOS user"))
node_proxy_apps(("Local proxy software"))
node_proxy_env[("Process environment")]
node_github(("GitHub releases"))

node_win_user -->|"runs"| node_win_install
node_win_user -->|"runs"| node_win_stop
node_win_user -->|"runs"| node_win_restore
node_win_user -->|"runs"| node_win_status
node_win_user -->|"runs"| node_win_update
node_mac_user -->|"runs"| node_mac_install
node_mac_user -->|"runs"| node_mac_stop
node_mac_user -->|"runs"| node_mac_restore
node_mac_user -->|"runs"| node_mac_status
node_mac_user -->|"runs"| node_mac_update
node_win_install -->|"installs and starts"| node_win_lifecycle
node_win_install -->|"starts monitor"| node_win_monitor
node_win_stop -->|"stops monitor"| node_win_lifecycle
node_win_stop -->|"requests stop"| node_win_monitor
node_win_restore -->|"removes startup"| node_win_lifecycle
node_win_restore -->|"stops monitor"| node_win_monitor
node_mac_install -->|"installs and starts"| node_mac_lifecycle
node_mac_install -->|"starts monitor"| node_mac_monitor
node_mac_stop -->|"stops monitor"| node_mac_lifecycle
node_mac_stop -->|"requests stop"| node_mac_monitor
node_mac_restore -->|"removes startup"| node_mac_lifecycle
node_mac_restore -->|"stops monitor"| node_mac_monitor
node_win_monitor -->|"probes proxy"| node_proxy_apps
node_win_monitor -->|"updates variables"| node_proxy_env
node_mac_monitor -->|"probes proxy"| node_proxy_apps
node_mac_monitor -->|"updates variables"| node_proxy_env
node_win_monitor -->|"records changes"| node_win_logs
node_mac_monitor -->|"records changes"| node_mac_logs
node_win_monitor -->|"checks location"| node_win_locator
node_mac_monitor -->|"checks location"| node_mac_locator
node_win_status -->|"reports state"| node_win_monitor
node_win_status -->|"shows recent logs"| node_win_logs
node_mac_status -->|"reports state"| node_mac_monitor
node_mac_status -->|"shows recent logs"| node_mac_logs
node_win_update -->|"checks releases"| node_github
node_mac_update -->|"checks releases"| node_github

click node_win_install "https://github.com/firetruck666/envproxy/blob/main/win/1-%E5%AE%89%E8%A3%85.cmd"
click node_win_stop "https://github.com/firetruck666/envproxy/blob/main/win/2-%E5%81%9C%E6%AD%A2%E7%9B%91%E6%8E%A7.cmd"
click node_win_restore "https://github.com/firetruck666/envproxy/blob/main/win/3-%E4%B8%80%E9%94%AE%E6%81%A2%E5%A4%8D.cmd"
click node_win_status "https://github.com/firetruck666/envproxy/blob/main/win/4-%E6%9F%A5%E7%9C%8B%E7%8A%B6%E6%80%81.cmd"
click node_win_update "https://github.com/firetruck666/envproxy/blob/main/win/5-%E6%A3%80%E6%9F%A5%E6%9B%B4%E6%96%B0.cmd"
click node_mac_install "https://github.com/firetruck666/envproxy/blob/main/mac/install.sh"
click node_mac_stop "https://github.com/firetruck666/envproxy/blob/main/mac/stop.sh"
click node_mac_restore "https://github.com/firetruck666/envproxy/blob/main/mac/uninstall.sh"
click node_mac_status "https://github.com/firetruck666/envproxy/blob/main/mac/status.sh"
click node_mac_update "https://github.com/firetruck666/envproxy/blob/main/mac/update.sh"
click node_win_lifecycle "https://github.com/firetruck666/envproxy/tree/main/win"
click node_mac_lifecycle "https://github.com/firetruck666/envproxy/tree/main/mac"
click node_win_monitor "https://github.com/firetruck666/envproxy/blob/main/win/envproxy.ps1"
click node_mac_monitor "https://github.com/firetruck666/envproxy/tree/main/mac"
click node_win_locator "https://github.com/firetruck666/envproxy/tree/main/win"
click node_mac_locator "https://github.com/firetruck666/envproxy/blob/main/mac/locator.sh"
click node_win_logs "https://github.com/firetruck666/envproxy/tree/main/win"
click node_mac_logs "https://github.com/firetruck666/envproxy/tree/main/mac"

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_win_install,node_win_stop,node_win_restore,node_win_status,node_win_update,node_mac_install,node_mac_stop,node_mac_restore,node_mac_status,node_mac_update,node_win_user,node_mac_user toneBlue
class node_win_lifecycle,node_mac_lifecycle,node_win_locator,node_mac_locator,node_proxy_env toneAmber
class node_win_monitor,node_mac_monitor toneMint
class node_win_logs,node_mac_logs toneRose
class node_proxy_apps,node_github toneIndigo
```

## Components

### User controls

- [Install / repair](https://github.com/firetruck666/envproxy/blob/main/win/1-%E5%AE%89%E8%A3%85.cmd): `win/1-安装.cmd`
- [Stop monitor](https://github.com/firetruck666/envproxy/blob/main/win/2-%E5%81%9C%E6%AD%A2%E7%9B%91%E6%8E%A7.cmd): `win/2-停止监控.cmd`
- [Uninstall](https://github.com/firetruck666/envproxy/blob/main/win/3-%E4%B8%80%E9%94%AE%E6%81%A2%E5%A4%8D.cmd): `win/3-一键恢复.cmd`
- [View status](https://github.com/firetruck666/envproxy/blob/main/win/4-%E6%9F%A5%E7%9C%8B%E7%8A%B6%E6%80%81.cmd): `win/4-查看状态.cmd`
- [Check updates](https://github.com/firetruck666/envproxy/blob/main/win/5-%E6%A3%80%E6%9F%A5%E6%9B%B4%E6%96%B0.cmd): `win/5-检查更新.cmd`
- [Install / repair](https://github.com/firetruck666/envproxy/blob/main/mac/install.sh): `mac/install.sh`
- [Stop monitor](https://github.com/firetruck666/envproxy/blob/main/mac/stop.sh): `mac/stop.sh`
- [Uninstall](https://github.com/firetruck666/envproxy/blob/main/mac/uninstall.sh): `mac/uninstall.sh`
- [View status](https://github.com/firetruck666/envproxy/blob/main/mac/status.sh): `mac/status.sh`
- [Check updates](https://github.com/firetruck666/envproxy/blob/main/mac/update.sh): `mac/update.sh`

### Installation lifecycle

- [Startup and cleanup](https://github.com/firetruck666/envproxy/tree/main/win): `win`
- [Startup and cleanup](https://github.com/firetruck666/envproxy/tree/main/mac): `mac`
- [Relocation locator](https://github.com/firetruck666/envproxy/tree/main/win): `win`
- [Relocation locator](https://github.com/firetruck666/envproxy/blob/main/mac/locator.sh): `mac/locator.sh`

### Proxy monitoring

- [Monitor and probe](https://github.com/firetruck666/envproxy/blob/main/win/envproxy.ps1): `win/envproxy.ps1`
- [Monitor and probe](https://github.com/firetruck666/envproxy/tree/main/mac): `mac`

### Status and updates

- [Monitor logs](https://github.com/firetruck666/envproxy/tree/main/win): `win`
- [Monitor logs](https://github.com/firetruck666/envproxy/tree/main/mac): `mac`

### Other components

- **Windows user**
- **macOS user**
- **Local proxy software**
- **Process environment**
- **GitHub releases**

## Connections

- Windows user → Install / repair: runs
- Windows user → Stop monitor: runs
- Windows user → Uninstall: runs
- Windows user → View status: runs
- Windows user → Check updates: runs
- macOS user → Install / repair: runs
- macOS user → Stop monitor: runs
- macOS user → Uninstall: runs
- macOS user → View status: runs
- macOS user → Check updates: runs
- Install / repair → Startup and cleanup: installs and starts
- Install / repair → Monitor and probe: starts monitor
- Stop monitor → Startup and cleanup: stops monitor
- Stop monitor → Monitor and probe: requests stop
- Uninstall → Startup and cleanup: removes startup
- Uninstall → Monitor and probe: stops monitor
- Install / repair → Startup and cleanup: installs and starts
- Install / repair → Monitor and probe: starts monitor
- Stop monitor → Startup and cleanup: stops monitor
- Stop monitor → Monitor and probe: requests stop
- Uninstall → Startup and cleanup: removes startup
- Uninstall → Monitor and probe: stops monitor
- Monitor and probe → Local proxy software: probes proxy
- Monitor and probe → Process environment: updates variables
- Monitor and probe → Local proxy software: probes proxy
- Monitor and probe → Process environment: updates variables
- Monitor and probe → Monitor logs: records changes
- Monitor and probe → Monitor logs: records changes
- Monitor and probe → Relocation locator: checks location
- Monitor and probe → Relocation locator: checks location
- View status → Monitor and probe: reports state
- View status → Monitor logs: shows recent logs
- View status → Monitor and probe: reports state
- View status → Monitor logs: shows recent logs
- Check updates → GitHub releases: checks releases
- Check updates → GitHub releases: checks releases
