# cmccomb/yo architecture

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

- Interactive diagram: https://gitdiagram.com/cmccomb/yo
- Repository: https://github.com/cmccomb/yo

## Overview

##### Main Components

a. Core Application Layer:
- Command Line Interface (Entry Point)
- Session Management
- Input Processing
- Response Generation

b. External Services Layer:
- LLM Service Integration
- Web Search Integration
- File Processing System

c. Utility Layer:
- Logging System
- Settings Management
- Token Management
- Status Checking

##### Component Relationships

- User input → Command Line Interface → Input Validation → Content Processing
- Content Processing → External Services (LLM/Web Search) → Response Generation → User Output
- Cross-cutting concerns like logging and settings affecting all components

##### Specific Implementation Details

**┌─────────────────────────────────────────────────────────────┐**
- Command Line Interface                    │
- (src/main.zsh)                         │
- ┬─────────────────────┬──────────────────┘

**┌───────────────────▼─────┐    ┌─────────▼────────┐**
- Input Processing     │    │ Session Management│
- Input Validation    │    │     (LLM)         │
- Content Processing  │    └──────────┬────────┘
- ┬────────┘               │

**┌───────────────▼────────────────────────▼───────────┐**
- External Services                     │
- ┌─────────────┐  ┌──────────┐  ┌──────────────┐  │
- LLM Service │  │   Web    │  │    File      │  │
- Integration │  │  Search  │  │  Processing  │  │
- ┘  └──────────┘  └──────────────┘  │
- ┬───────────────────────┘

**┌──────────────────────────▼───────────────────────┐**
- Utility Services                     │
- ┌─────────┐  ┌──────────┐  ┌────────────────┐  │
- Logging │  │ Settings │  │ Token Manager  │  │
- ┘  └──────────┘  └────────────────┘  │
- ┘

##### Additional Notes

Annotations for:
- Installation workflow (scripts/install)
- Testing infrastructure (tests directory)
- GitHub Actions integration (.github/workflows)
- Configuration management (settings.zsh)

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph CLI["Command Line Interface"]
        Main["Main Entry Point"]:::core
        Help["Help System"]:::core
        Status["Status Checking"]:::core
    end
    
    subgraph Processing["Processing Layer"]
        Input["Input Processing"]:::core
        Session["Session Management"]:::core
        Response["Response Generation"]:::core
    end
    
    subgraph External["External Services"]
        LLM["LLM Service"]:::external
        WebSearch["Web Search"]:::external
        FileProc["File Processing"]:::external
    end
    
    subgraph Utils["Utility Services"]
        Logger["Logging System"]:::utility
        Settings["Settings Management"]:::utility
        TokenMgr["Token Management"]:::utility
        ModelConfig["Model Configuration"]:::utility
    end
    
    subgraph Infrastructure["Infrastructure"]
        Install["Installation System"]:::infra
        Testing["Testing Infrastructure"]:::infra
        CICD["CI/CD Pipeline"]:::infra
    end
    
    Main --> Input
    Main --> Help
    Main --> Status
    Input --> Session
    Session --> LLM
    Session --> Response
    Response --> WebSearch
    Response --> FileProc
    
    Utils --> CLI
    Utils --> Processing
    Utils --> External
    
    Infrastructure --> Utils
    
    classDef core fill:#2374ab
    classDef external fill:#47a025
    classDef utility fill:#ffb627
    classDef infra fill:#808080
    
    click Main "https://github.com/cmccomb/yo/blob/main/src/main.zsh"
    click Help "https://github.com/cmccomb/yo/blob/main/src/help_and_version.zsh"
    click Status "https://github.com/cmccomb/yo/blob/main/src/status_checks.zsh"
    click Session "https://github.com/cmccomb/yo/blob/main/src/llm_session_management.zsh"
    click Response "https://github.com/cmccomb/yo/blob/main/src/prompt_generators.zsh"
    click WebSearch "https://github.com/cmccomb/yo/blob/main/src/web_search.zsh"
    click Logger "https://github.com/cmccomb/yo/blob/main/src/logging.zsh"
    click Settings "https://github.com/cmccomb/yo/blob/main/src/settings.zsh"
    click TokenMgr "https://github.com/cmccomb/yo/blob/main/src/tokens.zsh"
    click ModelConfig "https://github.com/cmccomb/yo/blob/main/src/set_model_names.zsh"
    click Install "https://github.com/cmccomb/yo/tree/main/scripts/install"
    click Testing "https://github.com/cmccomb/yo/tree/main/tests"
    click CICD "https://github.com/cmccomb/yo/tree/main/.github/workflows"
```
