How guinetik/amh2w works
Main Components
a. PowerShell Host (User)
b. AMH2W Module Loader (AMH2W.psm1)
c. Core Subsystem (core/*.ps1)
• Parser (core/namespace.ps1, core/command.ps1)
• Pipeline & Result Types (core/pipeline.ps1, core/result.ps1)
• Console & Logging (core/console.ps1, core/log.ps1)
• System Abstractions (core/system.ps1)
d. Command Namespace Directories
• all/ (base commands: math, time, weather)
• all/my/ (user‐focused: clock, uptime, shell, browser, files)
• all/my/homies/ (utilities: download, install, convert, crypto, hate)
• hate/ subnamespace (JSON, Windows management, zipping, path, ftp)
• crypto/, convert/, install/, luv/, etc.
e. External Dependencies
• Windows APIs (.NET assemblies, SecureString, CIM/WMI)
• Third‐party tools (ImageMagick, FFmpeg, BITS, 7-Zip/WinRAR)
f. Tests & Docs
• test/ (unit & regression tests)
• docs/ (architecture & usage docs)
Relationships & Data Flow
• User issues all my homies hate json tree <url> in a PowerShell console →
→ AMH2W.psm1 intercepts & bootstraps the command grammar →
→ Namespace Parser locates the .ps1 file under all/my/homies/hate/json/tree.ps1 →
→ Core Pipeline executes the function, passing input →
→ Function may call
– Core Result / Logging subsystems
– External APIs (Invoke‐WebRequest, .NET JSON parser)
→ Returns a Result object →
→ Console subsystem renders output or error.
Architectural Patterns & Principles
– Modular Directory‐based Namespace (each folder = namespace level)
– “Commands as Grammar” – path → function mapping
– Result‐based Error Handling (Ok/Err)
– Pipeline Composition (commands as pipeline stages)
– Minimal external dependencies, delegating heavy work to native tools
– Clear separation: Core runtime vs. user‐contributed commands
Technologies & Frameworks
– PowerShell scripting (.psm1, .ps1)
– .NET 4.x APIs (System.Drawing, System.Management, SecureString)
– External CLIs: ImageMagick, FFmpeg, BITS, 7-Zip/WinRAR
– JSON, HTTP client (Invoke‐WebRequest/BITS)
– Windows subsystem calls (WMI, CIM, PowerShell modules)