# blazeboyz0/7th-cmd architecture

> Architecture diagram of the GitHub repository blazeboyz0/7th-cmd, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/blazeboyz0/7th-cmd
- Repository: https://github.com/blazeboyz0/7th-cmd

## Overview

7th cmd is a local-first natural-language command and computer-automation system. A user enters a command in the CLI; the application routes it through intent interpretation, target resolution, reasoning and planning, authorization, execution on the Linux platform, verification, and response generation. The repository also includes knowledge/context support, information processing, capability management, recovery, and task-state handling. The principal flow is documented in the README; sampled source confirms CLI wiring, grammar processing, planning, and execution dispatch. Other subsystem links are documented at a high level, not verified from their implementation.

Main entry points: [`src/orchestrator/command_subsystem.cpp`](https://github.com/blazeboyz0/7th-cmd/blob/main/src/orchestrator/command_subsystem.cpp) (Command subsystem), [`src/main.cpp`](https://github.com/blazeboyz0/7th-cmd/blob/main/src/main.cpp) (Application entry), [`src/orchestrator/orchestrator.cpp`](https://github.com/blazeboyz0/7th-cmd/blob/main/src/orchestrator/orchestrator.cpp) (Orchestrator), [`src/cli/input_handler.cpp`](https://github.com/blazeboyz0/7th-cmd/blob/main/src/cli/input_handler.cpp) (CLI input)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI and application"]
  node_app["Application entry<br/>[main.cpp]"]
  node_input["CLI input<br/>[input_handler.cpp]"]
end

subgraph group_understanding["Understanding and planning"]
  node_grammar["Intent grammar<br/>[grammar_engine.cpp]"]
  node_entity["Target resolution"]
  node_reasoning["Reasoning engine"]
  node_planning["Plan creation"]
end

subgraph group_coordination["Workflow coordination"]
  node_orchestrator["Orchestrator<br/>[orchestrator.cpp]"]
  node_command["Command subsystem"]
  node_taskstate["Task state"]
end

subgraph group_safety["Safety and knowledge"]
  node_knowledge["Knowledge and context"]
  node_capabilities["Capabilities"]
  node_permissions["Authorization"]
end

subgraph group_operations["Operations and results"]
  node_information["Information operations"]
  node_execution["Execution engine"]
  node_linux["Linux platform<br/>[linux_platform.cpp]"]
  node_verification["Outcome verification"]
  node_response["Response generation"]
end

node_user(("User"))

node_user -->|"enters command"| node_input
node_input -->|"provides input"| node_app
node_app -->|"submits request"| node_orchestrator
node_orchestrator -->|"routes command"| node_command
node_command -->|"interprets intent"| node_grammar
node_grammar -->|"resolves target"| node_entity
node_command -->|"evaluates request"| node_reasoning
node_command -->|"creates plan"| node_planning
node_orchestrator -.->|"tracks task"| node_taskstate
node_command -.->|"uses context"| node_knowledge
node_command -->|"checks capability"| node_capabilities
node_command -->|"checks authorization"| node_permissions
node_command -->|"requests execution"| node_execution
node_execution -->|"dispatches operation"| node_linux
node_command -.->|"requests data operation"| node_information
node_command -->|"verifies outcome"| node_verification
node_app -->|"generates response"| node_response

click node_app "https://github.com/blazeboyz0/7th-cmd/blob/main/src/main.cpp"
click node_input "https://github.com/blazeboyz0/7th-cmd/blob/main/src/cli/input_handler.cpp"
click node_grammar "https://github.com/blazeboyz0/7th-cmd/blob/main/src/engines/grammar/grammar_engine.cpp"
click node_entity "https://github.com/blazeboyz0/7th-cmd/tree/main/src/systems/entity_resolution"
click node_reasoning "https://github.com/blazeboyz0/7th-cmd/blob/main/src/engines/reasoning/reasoning_engine.cpp"
click node_planning "https://github.com/blazeboyz0/7th-cmd/blob/main/src/engines/planning/planning_engine.cpp"
click node_orchestrator "https://github.com/blazeboyz0/7th-cmd/blob/main/src/orchestrator/orchestrator.cpp"
click node_command "https://github.com/blazeboyz0/7th-cmd/blob/main/src/orchestrator/command_subsystem.cpp"
click node_taskstate "https://github.com/blazeboyz0/7th-cmd/blob/main/src/orchestrator/task_state_manager.cpp"
click node_knowledge "https://github.com/blazeboyz0/7th-cmd/tree/main/src/systems/knowledge"
click node_capabilities "https://github.com/blazeboyz0/7th-cmd/tree/main/src/systems/capabilities"
click node_permissions "https://github.com/blazeboyz0/7th-cmd/blob/main/src/systems/permissions/authorization_handler.cpp"
click node_information "https://github.com/blazeboyz0/7th-cmd/blob/main/src/systems/information/operation_engine.cpp"
click node_execution "https://github.com/blazeboyz0/7th-cmd/blob/main/src/engines/execution/execution_engine.cpp"
click node_linux "https://github.com/blazeboyz0/7th-cmd/blob/main/src/platform/linux/linux_platform.cpp"
click node_verification "https://github.com/blazeboyz0/7th-cmd/tree/main/src/systems/verification"
click node_response "https://github.com/blazeboyz0/7th-cmd/blob/main/src/systems/response/response_generator.cpp"

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_app,node_input,node_user toneBlue
class node_grammar,node_entity,node_reasoning,node_planning toneAmber
class node_orchestrator,node_command,node_taskstate toneMint
class node_knowledge,node_capabilities,node_permissions toneRose
class node_information,node_execution,node_linux,node_verification,node_response toneIndigo
```

## Components

### CLI and application

- [Application entry](https://github.com/blazeboyz0/7th-cmd/blob/main/src/main.cpp): `src/main.cpp`
- [CLI input](https://github.com/blazeboyz0/7th-cmd/blob/main/src/cli/input_handler.cpp): `src/cli/input_handler.cpp`

### Understanding and planning

- [Intent grammar](https://github.com/blazeboyz0/7th-cmd/blob/main/src/engines/grammar/grammar_engine.cpp): `src/engines/grammar/grammar_engine.cpp`
- [Target resolution](https://github.com/blazeboyz0/7th-cmd/tree/main/src/systems/entity_resolution): `src/systems/entity_resolution`
- [Reasoning engine](https://github.com/blazeboyz0/7th-cmd/blob/main/src/engines/reasoning/reasoning_engine.cpp): `src/engines/reasoning/reasoning_engine.cpp`
- [Plan creation](https://github.com/blazeboyz0/7th-cmd/blob/main/src/engines/planning/planning_engine.cpp): `src/engines/planning/planning_engine.cpp`

### Workflow coordination

- [Orchestrator](https://github.com/blazeboyz0/7th-cmd/blob/main/src/orchestrator/orchestrator.cpp): `src/orchestrator/orchestrator.cpp`
- [Command subsystem](https://github.com/blazeboyz0/7th-cmd/blob/main/src/orchestrator/command_subsystem.cpp): `src/orchestrator/command_subsystem.cpp`
- [Task state](https://github.com/blazeboyz0/7th-cmd/blob/main/src/orchestrator/task_state_manager.cpp): `src/orchestrator/task_state_manager.cpp`

### Safety and knowledge

- [Knowledge and context](https://github.com/blazeboyz0/7th-cmd/tree/main/src/systems/knowledge): `src/systems/knowledge`
- [Capabilities](https://github.com/blazeboyz0/7th-cmd/tree/main/src/systems/capabilities): `src/systems/capabilities`
- [Authorization](https://github.com/blazeboyz0/7th-cmd/blob/main/src/systems/permissions/authorization_handler.cpp): `src/systems/permissions/authorization_handler.cpp`

### Operations and results

- [Information operations](https://github.com/blazeboyz0/7th-cmd/blob/main/src/systems/information/operation_engine.cpp): `src/systems/information/operation_engine.cpp`
- [Execution engine](https://github.com/blazeboyz0/7th-cmd/blob/main/src/engines/execution/execution_engine.cpp): `src/engines/execution/execution_engine.cpp`
- [Linux platform](https://github.com/blazeboyz0/7th-cmd/blob/main/src/platform/linux/linux_platform.cpp): `src/platform/linux/linux_platform.cpp`
- [Outcome verification](https://github.com/blazeboyz0/7th-cmd/tree/main/src/systems/verification): `src/systems/verification`
- [Response generation](https://github.com/blazeboyz0/7th-cmd/blob/main/src/systems/response/response_generator.cpp): `src/systems/response/response_generator.cpp`

### Other components

- **User**

## Connections

- User → CLI input: enters command (evidence: `README.md`)
- CLI input → Application entry: provides input (evidence: `src/main.cpp`)
- Application entry → Orchestrator: submits request (evidence: `src/main.cpp`)
- Orchestrator → Command subsystem: routes command (evidence: `README.md`)
- Command subsystem → Intent grammar: interprets intent (evidence: `README.md`)
- Intent grammar → Target resolution: resolves target (evidence: `README.md`)
- Command subsystem → Reasoning engine: evaluates request (evidence: `README.md`)
- Command subsystem → Plan creation: creates plan (evidence: `README.md`)
- Orchestrator → Task state: tracks task
- Command subsystem → Knowledge and context: uses context
- Command subsystem → Capabilities: checks capability (evidence: `README.md`)
- Command subsystem → Authorization: checks authorization (evidence: `README.md`)
- Command subsystem → Execution engine: requests execution (evidence: `README.md`)
- Execution engine → Linux platform: dispatches operation (evidence: `README.md`)
- Command subsystem → Information operations: requests data operation
- Command subsystem → Outcome verification: verifies outcome (evidence: `README.md`)
- Application entry → Response generation: generates response (evidence: `src/main.cpp`)
