KurutoDenzeru/envexa

GitHub: KurutoDenzeru/envexa

一款极速的 Rust TUI 和 CLI 工具,用于并行监控本地开发者工具链健康状态,跟踪过期包并审计安全风险。

Stars: 3 | Forks: 0

Envexa Logo

🚧 Envexa

极速的 Rust TUI 和 CLI,用于监控本地开发者工具的健康状态

Envexa TUI Screenshot

极速的 Rust TUI 和可脚本化的 CLI,用于监控本地开发者工具的健康状态。跨 14+ 个工具链即时跟踪过期包并审计安全风险。 ## 📚 目录 - [🚀 快速开始](#-quick-start) - [✨ 功能](#-features) - [🏗️ 架构](#-architecture) - [🧑‍💻 开发](#-development) - [🤝 贡献](#-contributing) - [⚖️ 许可证](#-license) ## 🚀 快速开始 ### 安装 ``` # 一键安装 curl -fsSL https://raw.githubusercontent.com/KurutoDenzeru/envexa/main/scripts/install.sh | bash # 或从 source 构建 git clone https://github.com/KurutoDenzeru/envexa.git && cd envexa && cargo install --path . ``` ### 用法 ``` envexa # Launch the interactive TUI dashboard envexa scan # Generate a comprehensive markdown report envexa update # Update to the latest release ``` ## ✨ 功能 - **并发引擎**:并行扫描 14+ 个工具链(Homebrew、npm、Cargo、Docker 等)。 - **交互式 TUI**:具有自定义饼图、健康仪表盘和快捷键盘导航功能。 - **项目工具扇区**:深入分析本地 lockfile、依赖偏移和安全审计。 - **CLI 报告**:即时生成可用于生产环境的 Markdown 报告,适用于 CI/CD 或 PR。 - **智能缓存**:利用本地 JSON 状态(`~/.envexa/cache.json`)实现零摩擦启动。 ## 🧑‍💻 开发 ``` cargo run # Launch interactive TUI in terminal cargo run -- scan # Run CLI report mode cargo watch -x run # Live reloading for TUI ``` 在提交更改之前,请确保你运行了: ``` cargo clippy -- -D warnings && cargo fmt --check ``` ## 🏗️ 架构 ``` envexa/ ├── Cargo.toml ├── src/ │ ├── main.rs # Application entrypoint (TUI or CLI router) │ ├── cli.rs # CLI command parser and runner │ ├── config.rs # Persistent configurations and cached state │ ├── scanner/ │ │ └── mod.rs # Formatting utilities and diagnostic extraction │ ├── tui/ │ │ ├── app.rs # App state management, keyboard events, and scheduler │ │ ├── mod.rs │ │ └── ui.rs # Ratatui rendering pipeline and interface structures │ └── toolchains/ │ ├── mod.rs # ScanResult schema, protocols, and multi-thread runners │ ├── brew.rs │ ├── npm.rs / pnpm.rs / yarn.rs / bun.rs / deno.rs │ ├── pip.rs / gem.rs / cargo.rs / docker.rs │ └── project.rs / security.rs / audit.rs / ci.rs ├── scripts/ │ ├── install.sh │ └── build-and-upload.sh └── .github/ └── workflows/ ``` 各个扫描器模块保持高度隔离。每个扫描器实现一个 `pub async fn scan() -> ScanResult` 函数,并行执行,并优雅地处理缺失的 CLI 工具以防止崩溃。 ### 系统概述 ``` graph TB subgraph "Envexa Architecture" Main[main.rs
Application Entry] subgraph "Core Modules" CLI[cli.rs
CLI Parser] Config[config.rs
Configuration] Scanner[scanner/mod.rs
Formatting & Extraction] end subgraph "TUI Layer" App[app.rs
State & Events] UI[ui.rs
Ratatui Rendering] end subgraph "Toolchain Scanners" direction LR Brew[brew.rs] NPM[npm.rs] Pnpm[pnpm.rs] Yarn[yarn.rs] Bun[bun.rs] Deno[deno.rs] Pip[pip.rs] Gem[gem.rs] Cargo[cargo.rs] Docker[docker.rs] Project[project.rs] Security[security.rs] Audit[audit.rs] CI[ci.rs] end end Main --> CLI Main --> App CLI --> Scanner App --> UI App --> Scanner Scanner --> Brew Scanner --> NPM Scanner --> Pnpm Scanner --> Yarn Scanner --> Bun Scanner --> Deno Scanner --> Pip Scanner --> Gem Scanner --> Cargo Scanner --> Docker Scanner --> Project Scanner --> Security Scanner --> Audit Scanner --> CI style Main fill:#e1f5fe style CLI fill:#f3e5f5 style Config fill:#f3e5f5 style Scanner fill:#fff3e0 style App fill:#e8f5e9 style UI fill:#e8f5e9 style Brew fill:#fce4ec style NPM fill:#fce4ec style Pnpm fill:#fce4ec style Yarn fill:#fce4ec style Bun fill:#fce4ec style Deno fill:#fce4ec style Pip fill:#fce4ec style Gem fill:#fce4ec style Cargo fill:#fce4ec style Docker fill:#fce4ec style Project fill:#e0f2f1 style Security fill:#e0f2f1 style Audit fill:#e0f2f1 style CI fill:#e0f2f1 ``` ``` graph LR subgraph "Scan Pipeline" Input[User Trigger] --> Parallel[Parallel Scanner Engine
tokio::join!] Parallel --> Results[ScanResult Aggregation] Results --> Cache[Cache Layer
~/.envexa/cache.json] Cache --> Output{Output Mode} Output -->|TUI| Dashboard[Interactive Dashboard
ratatui] Output -->|CLI| Report[Markdown Report] end subgraph "Data Flow" Results --> Outdated[Outdated Packages] Results --> Security[Security Advisories] Results --> Audit[Audit Findings] end style Input fill:#e1f5fe style Parallel fill:#fff3e0 style Results fill:#e8f5e9 style Cache fill:#f3e5f5 style Dashboard fill:#e0f2f1 style Report fill:#e0f2f1 style Outdated fill:#fce4ec style Security fill:#fce4ec style Audit fill:#fce4ec ``` ## ⚖️ 许可证 本项目在 MIT 许可证下发布,让你能够在极少的限制下自由使用、修改和分发代码。 有关完整的法律文本,请参见 [MIT](LICENSE) 文件。
标签:LNA, 可视化界面, 通知系统, 防御加固