# hectorg2211/jarvis architecture

> Architecture diagram of the GitHub repository hectorg2211/jarvis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hectorg2211/jarvis
- Repository: https://github.com/hectorg2211/jarvis

## Overview

This is a single-script desktop automation tool: a double clap triggers a welcome routine that can open Spotify, Chrome pages and Cursor, and optionally speak a welcome line through ElevenLabs. The README documents the overall workflow; the excerpt also shows microphone selection, ElevenLabs configuration and caching, and Chrome/Cursor helpers. Because the main routine’s action-dispatch code is omitted, links from the clap trigger to individual actions rely on the README rather than inspected call sites.

Main entry points: [`jarvis.py`](https://github.com/hectorg2211/jarvis/blob/main/jarvis.py) (Double-clap flow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Audio input"]
  node_listener["Clap listener<br/>[jarvis.py]"]
  node_trigger["Double-clap flow<br/>[jarvis.py]"]
end

subgraph group_actions["Desktop actions"]
  node_spotify["Spotify launch<br/>[jarvis.py]"]
  node_chrome["Chrome windows<br/>[jarvis.py]"]
  node_cursor["Cursor launch<br/>[jarvis.py]"]
end

subgraph group_speech["Welcome speech"]
  node_welcome["Welcome speech<br/>[jarvis.py]"]
  node_cache[("WAV cache<br/>[jarvis.py]")]
end

node_user(("User"))
node_mic["Microphone"]
node_websites["Web destinations"]
node_elevenlabs["ElevenLabs TTS"]

node_user -->|"claps into"| node_mic
node_mic -->|"audio input"| node_listener
node_listener -->|"detects double clap"| node_trigger
node_trigger -->|"opens"| node_spotify
node_trigger -->|"opens"| node_chrome
node_chrome -->|"opens pages"| node_websites
node_trigger -->|"launches"| node_cursor
node_trigger -->|"starts welcome"| node_welcome
node_welcome -->|"requests speech"| node_elevenlabs
node_welcome -->|"reads or writes"| node_cache

click node_listener "https://github.com/hectorg2211/jarvis/blob/main/jarvis.py"
click node_trigger "https://github.com/hectorg2211/jarvis/blob/main/jarvis.py"
click node_spotify "https://github.com/hectorg2211/jarvis/blob/main/jarvis.py"
click node_chrome "https://github.com/hectorg2211/jarvis/blob/main/jarvis.py"
click node_cursor "https://github.com/hectorg2211/jarvis/blob/main/jarvis.py"
click node_welcome "https://github.com/hectorg2211/jarvis/blob/main/jarvis.py"
click node_cache "https://github.com/hectorg2211/jarvis/blob/main/jarvis.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_listener,node_trigger,node_user toneBlue
class node_spotify,node_chrome,node_cursor toneAmber
class node_welcome,node_cache toneMint
class node_mic,node_websites,node_elevenlabs toneIndigo
```

## Components

### Audio input

- [Clap listener](https://github.com/hectorg2211/jarvis/blob/main/jarvis.py): `jarvis.py`
- [Double-clap flow](https://github.com/hectorg2211/jarvis/blob/main/jarvis.py): `jarvis.py`

### Desktop actions

- [Spotify launch](https://github.com/hectorg2211/jarvis/blob/main/jarvis.py): `jarvis.py`
- [Chrome windows](https://github.com/hectorg2211/jarvis/blob/main/jarvis.py): `jarvis.py`
- [Cursor launch](https://github.com/hectorg2211/jarvis/blob/main/jarvis.py): `jarvis.py`

### Welcome speech

- [Welcome speech](https://github.com/hectorg2211/jarvis/blob/main/jarvis.py): `jarvis.py`
- [WAV cache](https://github.com/hectorg2211/jarvis/blob/main/jarvis.py): `jarvis.py`

### Other components

- **User**
- **Microphone**
- **Web destinations**
- **ElevenLabs TTS**

## Connections

- User → Microphone: claps into (evidence: `README.md`)
- Microphone → Clap listener: audio input (evidence: `README.md`)
- Clap listener → Double-clap flow: detects double clap (evidence: `README.md`)
- Double-clap flow → Spotify launch: opens (evidence: `README.md`)
- Double-clap flow → Chrome windows: opens (evidence: `README.md`)
- Chrome windows → Web destinations: opens pages (evidence: `README.md`)
- Double-clap flow → Cursor launch: launches (evidence: `README.md`)
- Double-clap flow → Welcome speech: starts welcome (evidence: `README.md`)
- Welcome speech → ElevenLabs TTS: requests speech (evidence: `jarvis.py`)
- Welcome speech → WAV cache: reads or writes (evidence: `jarvis.py`)
