# krish2312005/agent-termo architecture

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

- Interactive diagram: https://gitdiagram.com/krish2312005/agent-termo
- Repository: https://github.com/krish2312005/agent-termo

## Overview

Agent-Termo is a terminal-based AI coding agent. A user starts a project session, describes work in the terminal, and the main runtime coordinates model responses, tool execution, approval or diff review, and displayed results. Its documented capabilities also include specialist-agent delegation, custom agents and slash commands, model selection, and project memory and task continuity. The excerpts show several core calls and module references; some feature links rely on README descriptions, so unsampled implementation details are not inferred.

Main entry points: [`src/main.ts`](https://github.com/krish2312005/agent-termo/blob/master/src/main.ts) (Agent runtime), [`src/ui/index.ts`](https://github.com/krish2312005/agent-termo/blob/master/src/ui/index.ts) (Terminal interface), [`src/tools/index.ts`](https://github.com/krish2312005/agent-termo/blob/master/src/tools/index.ts) (Tool executor), [`src/llm/client.ts`](https://github.com/krish2312005/agent-termo/blob/master/src/llm/client.ts) (NIM client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_session["Session and interface"]
  node_cli["CLI entry<br/>[cli.ts]"]
  node_runtime["Agent runtime<br/>[main.ts]"]
  node_terminal["Terminal interface<br/>[index.ts]"]
  node_screen["Screen and input<br/>[screen.ts]"]
end

subgraph group_model["Model integration"]
  node_llm["NIM client<br/>[client.ts]"]
  node_models["Model catalog<br/>[models.ts]"]
end

subgraph group_workspace["Workspace operations"]
  node_tools["Tool executor<br/>[index.ts]"]
  node_diff["Diff generation<br/>[index.ts]"]
  node_shell["Shell and Git<br/>[shell.ts]"]
end

subgraph group_agents["Agents and continuity"]
  node_agentfiles["Custom agents<br/>[index.ts]"]
  node_agentruntime["Agent discovery<br/>[agent-folder.ts]"]
  node_delegation["Delegation registry<br/>[subagents.ts]"]
  node_subview["Subagent monitor<br/>[subagent-view.ts]"]
  node_memory[("Project memory<br/>[index.ts]")]
end

subgraph group_policy["Review and settings"]
  node_permissions["Permission policy<br/>[permissions.ts]"]
  node_config[("Configuration<br/>[config.ts]")]
end

node_user(("Project user"))
node_nim{{"NVIDIA NIM"}}
node_project[("Project workspace")]

node_user -->|"starts session"| node_cli
node_cli -->|"launches"| node_runtime
node_runtime -->|"drives interface"| node_terminal
node_terminal -->|"uses layout"| node_screen
node_runtime -->|"requests responses"| node_llm
node_llm -->|"merges model list"| node_models
node_llm -->|"calls API"| node_nim
node_runtime -->|"dispatches tools"| node_tools
node_tools -->|"reads and modifies"| node_project
node_tools -->|"proposes changes"| node_diff
node_tools -.->|"runs commands"| node_shell
node_runtime -->|"checks approvals"| node_permissions
node_runtime -->|"loads agents"| node_agentruntime
node_agentruntime -->|"loads definitions"| node_agentfiles
node_runtime -->|"tracks delegated runs"| node_delegation
node_terminal -->|"lists activity"| node_delegation
node_screen -->|"renders monitor"| node_subview
node_runtime -.->|"maintains continuity"| node_memory
node_terminal -->|"displays memory"| node_memory
node_runtime -->|"reads settings"| node_config

click node_cli "https://github.com/krish2312005/agent-termo/blob/master/src/cli.ts"
click node_runtime "https://github.com/krish2312005/agent-termo/blob/master/src/main.ts"
click node_terminal "https://github.com/krish2312005/agent-termo/blob/master/src/ui/index.ts"
click node_screen "https://github.com/krish2312005/agent-termo/blob/master/src/ui/screen.ts"
click node_llm "https://github.com/krish2312005/agent-termo/blob/master/src/llm/client.ts"
click node_models "https://github.com/krish2312005/agent-termo/blob/master/src/llm/models.ts"
click node_tools "https://github.com/krish2312005/agent-termo/blob/master/src/tools/index.ts"
click node_diff "https://github.com/krish2312005/agent-termo/blob/master/src/diff/index.ts"
click node_shell "https://github.com/krish2312005/agent-termo/blob/master/src/utils/shell.ts"
click node_agentfiles "https://github.com/krish2312005/agent-termo/blob/master/src/agents/index.ts"
click node_agentruntime "https://github.com/krish2312005/agent-termo/blob/master/src/runtime/agent-folder.ts"
click node_delegation "https://github.com/krish2312005/agent-termo/blob/master/src/runtime/subagents.ts"
click node_subview "https://github.com/krish2312005/agent-termo/blob/master/src/ui/subagent-view.ts"
click node_memory "https://github.com/krish2312005/agent-termo/blob/master/src/memory/index.ts"
click node_permissions "https://github.com/krish2312005/agent-termo/blob/master/src/runtime/permissions.ts"
click node_config "https://github.com/krish2312005/agent-termo/blob/master/src/utils/config.ts"

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_cli,node_runtime,node_terminal,node_screen,node_user toneBlue
class node_llm,node_models,node_project toneAmber
class node_tools,node_diff,node_shell toneMint
class node_agentfiles,node_agentruntime,node_delegation,node_subview,node_memory toneRose
class node_permissions,node_config,node_nim toneIndigo
```

## Components

### Session and interface

- [CLI entry](https://github.com/krish2312005/agent-termo/blob/master/src/cli.ts): `src/cli.ts`
- [Agent runtime](https://github.com/krish2312005/agent-termo/blob/master/src/main.ts): `src/main.ts`
- [Terminal interface](https://github.com/krish2312005/agent-termo/blob/master/src/ui/index.ts): `src/ui/index.ts`
- [Screen and input](https://github.com/krish2312005/agent-termo/blob/master/src/ui/screen.ts): `src/ui/screen.ts`

### Model integration

- [NIM client](https://github.com/krish2312005/agent-termo/blob/master/src/llm/client.ts): `src/llm/client.ts`
- [Model catalog](https://github.com/krish2312005/agent-termo/blob/master/src/llm/models.ts): `src/llm/models.ts`

### Workspace operations

- [Tool executor](https://github.com/krish2312005/agent-termo/blob/master/src/tools/index.ts): `src/tools/index.ts`
- [Diff generation](https://github.com/krish2312005/agent-termo/blob/master/src/diff/index.ts): `src/diff/index.ts`
- [Shell and Git](https://github.com/krish2312005/agent-termo/blob/master/src/utils/shell.ts): `src/utils/shell.ts`

### Agents and continuity

- [Custom agents](https://github.com/krish2312005/agent-termo/blob/master/src/agents/index.ts): `src/agents/index.ts`
- [Agent discovery](https://github.com/krish2312005/agent-termo/blob/master/src/runtime/agent-folder.ts): `src/runtime/agent-folder.ts`
- [Delegation registry](https://github.com/krish2312005/agent-termo/blob/master/src/runtime/subagents.ts): `src/runtime/subagents.ts`
- [Subagent monitor](https://github.com/krish2312005/agent-termo/blob/master/src/ui/subagent-view.ts): `src/ui/subagent-view.ts`
- [Project memory](https://github.com/krish2312005/agent-termo/blob/master/src/memory/index.ts): `src/memory/index.ts`

### Review and settings

- [Permission policy](https://github.com/krish2312005/agent-termo/blob/master/src/runtime/permissions.ts): `src/runtime/permissions.ts`
- [Configuration](https://github.com/krish2312005/agent-termo/blob/master/src/utils/config.ts): `src/utils/config.ts`

### Other components

- **Project user**
- **NVIDIA NIM**
- **Project workspace**

## Connections

- Project user → CLI entry: starts session (evidence: `README.md`)
- CLI entry → Agent runtime: launches (evidence: `src/cli.ts`)
- Agent runtime → Terminal interface: drives interface (evidence: `src/main.ts`)
- Terminal interface → Screen and input: uses layout (evidence: `src/ui/index.ts`)
- Agent runtime → NIM client: requests responses (evidence: `src/main.ts`)
- NIM client → Model catalog: merges model list (evidence: `src/llm/client.ts`)
- NIM client → NVIDIA NIM: calls API (evidence: `README.md`)
- Agent runtime → Tool executor: dispatches tools (evidence: `src/main.ts`)
- Tool executor → Project workspace: reads and modifies (evidence: `src/tools/index.ts`)
- Tool executor → Diff generation: proposes changes (evidence: `src/tools/index.ts`)
- Tool executor → Shell and Git: runs commands (evidence: `src/tools/index.ts`)
- Agent runtime → Permission policy: checks approvals (evidence: `src/main.ts`)
- Agent runtime → Agent discovery: loads agents (evidence: `src/main.ts`)
- Agent discovery → Custom agents: loads definitions (evidence: `src/runtime/agent-folder.ts`)
- Agent runtime → Delegation registry: tracks delegated runs (evidence: `src/main.ts`)
- Terminal interface → Delegation registry: lists activity (evidence: `src/ui/index.ts`)
- Screen and input → Subagent monitor: renders monitor (evidence: `src/ui/screen.ts`)
- Agent runtime → Project memory: maintains continuity (evidence: `src/main.ts`)
- Terminal interface → Project memory: displays memory (evidence: `src/ui/index.ts`)
- Agent runtime → Configuration: reads settings (evidence: `src/main.ts`)
