# yonko-sid/assistant-in-c- architecture

> Architecture diagram of the GitHub repository yonko-sid/assistant-in-c-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yonko-sid/assistant-in-c-
- Repository: https://github.com/yonko-sid/assistant-in-c-

## Overview

#### Purpose and Entry Points
Jarvis is a native C, command-line desktop assistant for Windows/Linux-style environments. It accepts interactive text commands and routes them to system, web, developer-automation, and AI/NLP capabilities. The executable entry point and primary command loop are in `jarvis.c`; build entry points are `compile_jarvis.sh` and `compile_jarvis.bat`.

#### Core Command Shell
`jarvis.c` owns terminal presentation, user input, command parsing/dispatch, help output, logging, and the baseline assistant features (system control, files, time, math, search, weather, and entertainment). It is the boundary between untrusted CLI input and downstream operations, including potentially destructive OS commands.

Paths: `jarvis.c`, `jarvis.conf`

#### Automation Subsystem
Developer-oriented commands are separated into an automation module: Git workflows, project creation/execution, HTTP requests, process/port management, log viewing, snippets, and code-quality actions. `jarvis.c` delegates these recognized commands through the module interface, keeping the main command shell as the orchestration layer.

Paths: `automation.c`, `automation.h`, `jarvis.c`

#### AI/NLP Subsystem
AI-facing commands are isolated behind the NLP interface: voice mode, local AI chat, RAG queries, language detection, and intent management. The design intends local/offline model-backed behavior through Vosk and llama.cpp-compatible assets, while intent parsing allows natural-language aliases to map back into command execution.

Paths: `ai_nlp.c`, `ai_nlp.h`, `jarvis.c`

#### Primary Control and Data Flow
1. The process starts and initializes the interactive CLI in `jarvis.c`.
2. User text is read, normalized/parsed, logged, and matched to built-in, automation, or AI/NLP command families.
3. Built-in commands execute local logic or invoke platform commands; automation and NLP commands cross module APIs via `automation.h` and `ai_nlp.h`.
4. Results/errors return to the CLI for formatted terminal output.
5. Runtime activity is persisted to the log, and optional user customization is represented by the configuration file.

Paths: `jarvis.c`, `automation.h`, `ai_nlp.h`

#### Runtime, Platform, and External Boundaries
The project compiles as C11 with GCC and standard C libraries. It targets Windows and Linux/Mac command environments, relying on platform utilities/system calls for application launch, power/session actions, filesystem/process operations, Git, and developer tools. Internet-facing operations open browser searches or request remote data (such as weather/HTTP endpoints). AI assets are expected outside the tracked source tree under model/document directories at runtime.

Paths: `compile_jarvis.sh`, `compile_jarvis.bat`, `jarvis.conf`

#### Extension Model
New top-level capabilities generally require dispatch changes in `jarvis.c`; developer actions belong in `automation.c` with declarations in `automation.h`; conversational or model-oriented behavior belongs in `ai_nlp.c` with declarations in `ai_nlp.h`. This three-part split is the repository’s principal architectural boundary.

Paths: `jarvis.c`, `automation.c`, `ai_nlp.c`

Main entry points: [`jarvis.c`](https://github.com/yonko-sid/assistant-in-c-/blob/main/jarvis.c) (Jarvis CLI and dispatcher), [`automation.c`](https://github.com/yonko-sid/assistant-in-c-/blob/main/automation.c) (Developer automation), [`ai_nlp.c`](https://github.com/yonko-sid/assistant-in-c-/blob/main/ai_nlp.c) (AI/NLP services), [`automation.h`](https://github.com/yonko-sid/assistant-in-c-/blob/main/automation.h) (Automation API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Build"]
  node_build_sh["Unix build script<br/>build entry<br/>[compile_jarvis.sh]"]
  node_build_bat["Windows build script<br/>build entry<br/>[compile_jarvis.bat]"]
end

subgraph group_core["Command Shell"]
  node_cli["Jarvis CLI and dispatcher<br/>C executable<br/>[jarvis.c]"]
  node_config["User configuration<br/>config file<br/>[jarvis.conf]"]
end

subgraph group_modules["Capability Modules"]
  node_automation_api["Automation API<br/>C header<br/>[automation.h]"]
  node_automation["Developer automation<br/>C module<br/>[automation.c]"]
  node_nlp_api["AI/NLP API<br/>C header<br/>[ai_nlp.h]"]
  node_nlp["AI/NLP services<br/>C module<br/>[ai_nlp.c]"]
end

subgraph group_runtime["Runtime Boundaries"]
  node_user(("Interactive user<br/>CLI input"))
  node_platform{{"OS and developer tools<br/>platform boundary"}}
  node_internet{{"Web and remote data<br/>external service"}}
  node_ai_assets[("Local AI assets<br/>runtime assets")]
  node_activity_log["Runtime log<br/>runtime data"]
end

node_build_sh -->|"builds"| node_cli
node_build_bat -->|"builds"| node_cli
node_user -->|"commands"| node_cli
node_config -.->|"customizes"| node_cli
node_cli -->|"records activity"| node_activity_log
node_cli -->|"built-ins and OS actions"| node_platform
node_cli -->|"searches and remote data"| node_internet
node_cli -->|"delegates automation"| node_automation_api
node_automation_api -->|"declares"| node_automation
node_automation -->|"runs tools and manages processes"| node_platform
node_automation -->|"HTTP requests"| node_internet
node_cli -->|"delegates AI commands"| node_nlp_api
node_nlp_api -->|"declares"| node_nlp
node_nlp -->|"loads models and documents"| node_ai_assets
node_automation -.->|"results and errors"| node_cli
node_nlp -.->|"results and intents"| node_cli
node_cli -->|"formatted output"| node_user

click node_build_sh "https://github.com/yonko-sid/assistant-in-c-/blob/main/compile_jarvis.sh"
click node_build_bat "https://github.com/yonko-sid/assistant-in-c-/blob/main/compile_jarvis.bat"
click node_cli "https://github.com/yonko-sid/assistant-in-c-/blob/main/jarvis.c"
click node_config "https://github.com/yonko-sid/assistant-in-c-/blob/main/jarvis.conf"
click node_automation_api "https://github.com/yonko-sid/assistant-in-c-/blob/main/automation.h"
click node_automation "https://github.com/yonko-sid/assistant-in-c-/blob/main/automation.c"
click node_nlp_api "https://github.com/yonko-sid/assistant-in-c-/blob/main/ai_nlp.h"
click node_nlp "https://github.com/yonko-sid/assistant-in-c-/blob/main/ai_nlp.c"

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_build_sh,node_build_bat toneBlue
class node_cli,node_config toneAmber
class node_automation_api,node_automation,node_nlp_api,node_nlp toneMint
class node_user,node_platform,node_internet,node_ai_assets,node_activity_log toneRose
```

## Components

### Build

- [Unix build script](https://github.com/yonko-sid/assistant-in-c-/blob/main/compile_jarvis.sh): build entry · Compiles the C11 executable with GCC. · `compile_jarvis.sh`
- [Windows build script](https://github.com/yonko-sid/assistant-in-c-/blob/main/compile_jarvis.bat): build entry · Compiles the C11 executable with GCC. · `compile_jarvis.bat`

### Command Shell

- [Jarvis CLI and dispatcher](https://github.com/yonko-sid/assistant-in-c-/blob/main/jarvis.c): C executable · Owns the interactive loop, parsing, logging, built-ins, and terminal output. · `jarvis.c`
- [User configuration](https://github.com/yonko-sid/assistant-in-c-/blob/main/jarvis.conf): config file · Optional user customization. · `jarvis.conf`

### Capability Modules

- [Automation API](https://github.com/yonko-sid/assistant-in-c-/blob/main/automation.h): C header · Module interface used by the command shell. · `automation.h`
- [Developer automation](https://github.com/yonko-sid/assistant-in-c-/blob/main/automation.c): C module · Git, projects, HTTP, process, logs, snippets, and quality actions. · `automation.c`
- [AI/NLP API](https://github.com/yonko-sid/assistant-in-c-/blob/main/ai_nlp.h): C header · Module interface used by the command shell. · `ai_nlp.h`
- [AI/NLP services](https://github.com/yonko-sid/assistant-in-c-/blob/main/ai_nlp.c): C module · Voice, chat, RAG, language detection, and intent management. · `ai_nlp.c`

### Runtime Boundaries

- **Interactive user**: CLI input
- **OS and developer tools**: platform boundary · System commands, filesystem, processes, Git, and developer utilities.
- **Web and remote data**: external service · Browser searches, weather, and HTTP endpoints.
- **Local AI assets**: runtime assets · External Vosk, llama.cpp-compatible models, and document directories.
- **Runtime log**: runtime data · Persists command activity.

## Connections

- Unix build script → Jarvis CLI and dispatcher: builds
- Windows build script → Jarvis CLI and dispatcher: builds
- Interactive user → Jarvis CLI and dispatcher: commands
- User configuration → Jarvis CLI and dispatcher: customizes
- Jarvis CLI and dispatcher → Runtime log: records activity
- Jarvis CLI and dispatcher → OS and developer tools: built-ins and OS actions
- Jarvis CLI and dispatcher → Web and remote data: searches and remote data
- Jarvis CLI and dispatcher → Automation API: delegates automation
- Automation API → Developer automation: declares
- Developer automation → OS and developer tools: runs tools and manages processes
- Developer automation → Web and remote data: HTTP requests
- Jarvis CLI and dispatcher → AI/NLP API: delegates AI commands
- AI/NLP API → AI/NLP services: declares
- AI/NLP services → Local AI assets: loads models and documents
- Developer automation → Jarvis CLI and dispatcher: results and errors
- AI/NLP services → Jarvis CLI and dispatcher: results and intents
- Jarvis CLI and dispatcher → Interactive user: formatted output
