# telichkin/hurry architecture

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

- Interactive diagram: https://gitdiagram.com/telichkin/hurry
- Repository: https://github.com/telichkin/hurry

## Overview

##### Project Type Analysis
This is a command-line utility tool written in Python that serves as a command shortcut manager/executor. The architecture should focus on the command processing pipeline and configuration management.

##### Main Components

A. Core Components:
- Command Parser
- Template Engine
- Command Executor
- Configuration Manager

B. External Interfaces:
- File System Interface (for hurry.json)
- Shell Interface (for command execution)

**[User Input] → [Command Parser] → [Template Engine] → [Command Executor] → [Shell Output]**
- ↑                    ↑

- [Configuration Manager] ← [hurry.json]

##### Component Details

A. Command Parser:
- Input validation
- Command matching
- Argument extraction
- Template pattern recognition

B. Template Engine:
- Template variable extraction (<template> syntax)
- Variable replacement
- Quote handling logic

C. Configuration Manager:
- JSON file reading
- Command mapping storage
- Shortcut resolution

D. Command Executor:
- Shell command preparation
- Recursive hurry command handling
- Command execution pipeline

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Legend
        L1[Core Components]:::core
        L2[(Storage)]:::storage
        L3[/Interface/]:::interface
        L4[External System]:::external
        style Legend fill:#f5f5f5,stroke:#333
    end

    %% Input/Output Interfaces
    UI[/User Input/]:::interface
    SO[/Shell Output/]:::interface

    %% Core Components
    CP[Command Parser]:::core
    TE[Template Engine]:::core
    CE[Command Executor]:::core
    CM[Configuration Manager]:::core

    %% Storage
    CF[(hurry.json)]:::storage

    %% External Systems
    FS[File System]:::external
    SI[Shell Interface]:::external

    %% Connections
    UI --> CP
    CP --> TE
    TE --> CE
    CE --> SO
    CE --> SI
    
    CM --> CP
    CM --> TE
    CF --> CM
    FS --> CF

    %% Click Events
    click CP "https://github.com/telichkin/hurry/blob/master/hurry.py"
    click TE "https://github.com/telichkin/hurry/blob/master/hurry.py"
    click CE "https://github.com/telichkin/hurry/blob/master/hurry.py"
    click CM "https://github.com/telichkin/hurry/blob/master/hurry.json"
    click SI "https://github.com/telichkin/hurry/tree/master/bin/hurry"

    %% Styles
    classDef core fill:#dae8fc,stroke:#6c8ebf
    classDef storage fill:#fff2cc,stroke:#d6b656
    classDef interface fill:#d5e8d4,stroke:#82b366
    classDef external fill:#f8cecc,stroke:#b85450

    %% Notes
    subgraph Notes
        N1[Supports recursive command execution]
        N2[Template variable handling with <template> syntax]
        N3[Multi-word argument quote handling]
        N4[Python 3.4+ compatible]
        style Notes fill:#f5f5f5,stroke:#333
    end
```
