# pipelight/boulette architecture

> Architecture diagram of the GitHub repository pipelight/boulette, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pipelight/boulette
- Repository: https://github.com/pipelight/boulette

## Overview

##### Main Components Identification

The system consists of these primary components:
- CLI Interface
- Prompt Handler
- Challenge System
- Command Executor
- SSH Detection System
- Shell Integration System

##### Component Relationships

- User Input → CLI Interface
- CLI Interface → Prompt Handler
- Prompt Handler → Challenge System
- Challenge System → Command Executor
- SSH Detection → Prompt Handler

##### Technical Details

Annotations showing:
- Rust as the implementation language
- Challenge types (ask, hostname, numbers, characters)
- Supported shells (bash, zsh, fish)
- NixOS module support

##### Implementation Details

Notes about:
- Configuration options (from modules/options.nix)
- Shell integration methods
- SSH detection mechanism

**[User Input] → [CLI Interface (cli.rs)]**
- ↓
**[SSH Detection] → [Prompt Handler (prompt.rs)]**
- ↓
- [Challenge System]
- ↓
- [Command Executor]
- ↓
- [Original Command]

**[Shell Integration]**
- ↑
**[Bash/Zsh/Fish Aliases]**

Key Considerations:

## Diagram (Mermaid)

```mermaid
graph TB
    %% Nodes
    User(("User"))
    CLI["CLI Interface"]:::core
    Prompt["Prompt Handler"]:::core
    Challenge["Challenge System"]:::security
    Executor["Command Executor"]:::critical
    SSH["SSH Detection System"]:::security
    Shell["Shell Integration System"]:::integration
    Config["Configuration System"]:::config
    Original["Original Command"]:::command

    %% Subgraphs
    subgraph Integration
        Shell --> |"Bash/Zsh/Fish"| CLI
    end

    subgraph Security
        SSH --> Prompt
        Challenge --> |"Validation"| Executor
    end

    subgraph Core
        CLI --> Prompt
        Prompt --> |"Generate Challenge"| Challenge
        Executor --> Original
    end

    %% Relationships
    User --> CLI
    Config --> CLI
    Config --> Prompt
    Config --> Challenge

    %% Annotations
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef security fill:#f1c40f,stroke:#f39c12,color:black
    classDef critical fill:#e74c3c,stroke:#c0392b,color:white
    classDef integration fill:#2ecc71,stroke:#27ae60,color:white
    classDef config fill:#9b59b6,stroke:#8e44ad,color:white
    classDef command fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Click Events
    click CLI "https://github.com/pipelight/boulette/blob/main/src/cli.rs"
    click Prompt "https://github.com/pipelight/boulette/blob/main/src/prompt.rs"
    click Shell "https://github.com/pipelight/boulette/blob/main/modules/home.nix"
    click Config "https://github.com/pipelight/boulette/blob/main/modules/options.nix"

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Security Components"]:::security
        L3["Critical Components"]:::critical
        L4["Integration Components"]:::integration
        L5["Configuration"]:::config
    end
```
