# eugenioenko/ttt architecture

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

- Interactive diagram: https://gitdiagram.com/eugenioenko/ttt
- Repository: https://github.com/eugenioenko/ttt

## Overview

TTT is a terminal IDE. Users launch the CLI with files or workspace folders; the app creates the interactive editor session, where users edit code, navigate/search workspace files, and manage Git changes. The editor also offers LSP language features, terminal panes, and plugins. Core editing uses buffers, undo, and syntax highlighting, while UI widgets and terminal rendering present the interface. The README documents major capabilities not fully shown in sampled source; links to those subsystems are omitted where their runtime wiring could not be verified.

Main entry points: [`internal/app/app.go`](https://github.com/eugenioenko/ttt/blob/main/internal/app/app.go) (Application), [`internal/ui/editor_widget.go`](https://github.com/eugenioenko/ttt/blob/main/internal/ui/editor_widget.go) (Editor widget), [`cmd/ttt/main.go`](https://github.com/eugenioenko/ttt/blob/main/cmd/ttt/main.go) (CLI entry), [`internal/lsp/manager.go`](https://github.com/eugenioenko/ttt/blob/main/internal/lsp/manager.go) (Language services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and orchestration"]
  node_cli["CLI entry<br/>[main.go]"]
  node_app["Application<br/>[app.go]"]
  node_config["Settings<br/>[settings.go]"]
end

subgraph group_editing["Editing and language"]
  node_buffer["Text buffer<br/>[buffer.go]"]
  node_undo["Undo stack<br/>[undo.go]"]
  node_editor["Editor widget<br/>[editor_widget.go]"]
  node_highlight["Syntax highlighting<br/>[highlighter.go]"]
  node_lsp["Language services<br/>[manager.go]"]
end

subgraph group_workspace["Workspace and Git"]
  node_search["Workspace search<br/>[search_widget.go]"]
  node_explorer["File explorer<br/>[explorer.go]"]
  node_workspace_state["Workspace roots<br/>[workspace.go]"]
  node_git["Git operations<br/>[git.go]"]
  node_repo_state["Repository state"]
  node_changes["Changes panel<br/>[changes_panel.go]"]
end

subgraph group_interface["Terminal interface"]
  node_ui["UI widgets<br/>[root.go]"]
  node_terminal["Terminal screen<br/>[tcell_screen.go]"]
  node_renderer["Screen renderer<br/>[renderer.go]"]
end

subgraph group_extensions["Extensions"]
  node_plugin_manager["Plugin manager<br/>[manager.go]"]
  node_plugin_api["Plugin API<br/>[api.go]"]
end

node_user(("Editor user"))
node_rg["ripgrep"]
node_git_service["Git executable"]
node_lsp_server["LSP servers"]

node_user -->|"launches"| node_cli
node_cli -->|"creates session"| node_app
node_cli -->|"loads settings"| node_config
node_app -->|"uses widgets"| node_ui
node_app -->|"uses screen"| node_terminal
node_app -->|"uses renderer"| node_renderer
node_app -->|"uses manager"| node_lsp
node_app -->|"uses manager"| node_plugin_manager
node_app -->|"uses workspace"| node_workspace_state
node_user -->|"edits code"| node_editor
node_editor -.->|"edits text"| node_buffer
node_editor -.->|"supports undo"| node_undo
node_editor -.->|"highlights code"| node_highlight
node_editor -.->|"requests language features"| node_lsp
node_lsp -->|"starts server"| node_lsp_server
node_user -->|"searches workspace"| node_search
node_search -->|"runs searches"| node_rg
node_user -->|"navigates files"| node_explorer
node_user -->|"reviews changes"| node_changes
node_repo_state -->|"reads repository state"| node_git
node_git -.->|"runs Git"| node_git_service
node_user -->|"uses extensions"| node_plugin_manager
node_plugin_manager -.->|"exposes API"| node_plugin_api
node_ui -.->|"draws interface"| node_renderer
node_renderer -->|"updates screen"| node_terminal

click node_cli "https://github.com/eugenioenko/ttt/blob/main/cmd/ttt/main.go"
click node_app "https://github.com/eugenioenko/ttt/blob/main/internal/app/app.go"
click node_config "https://github.com/eugenioenko/ttt/blob/main/internal/config/settings.go"
click node_buffer "https://github.com/eugenioenko/ttt/blob/main/internal/core/buffer/buffer.go"
click node_undo "https://github.com/eugenioenko/ttt/blob/main/internal/core/undo/undo.go"
click node_editor "https://github.com/eugenioenko/ttt/blob/main/internal/ui/editor_widget.go"
click node_highlight "https://github.com/eugenioenko/ttt/blob/main/internal/highlight/highlighter.go"
click node_lsp "https://github.com/eugenioenko/ttt/blob/main/internal/lsp/manager.go"
click node_search "https://github.com/eugenioenko/ttt/blob/main/internal/ui/search_widget.go"
click node_explorer "https://github.com/eugenioenko/ttt/blob/main/internal/app/explorer.go"
click node_workspace_state "https://github.com/eugenioenko/ttt/blob/main/internal/workspace/workspace.go"
click node_git "https://github.com/eugenioenko/ttt/blob/main/internal/git/git.go"
click node_repo_state "https://github.com/eugenioenko/ttt/blob/main/internal/app/repository_state.go"
click node_changes "https://github.com/eugenioenko/ttt/blob/main/internal/app/changes_panel.go"
click node_ui "https://github.com/eugenioenko/ttt/blob/main/internal/ui/root.go"
click node_terminal "https://github.com/eugenioenko/ttt/blob/main/internal/term/tcell_screen.go"
click node_renderer "https://github.com/eugenioenko/ttt/blob/main/internal/render/renderer.go"
click node_plugin_manager "https://github.com/eugenioenko/ttt/blob/main/internal/plugin/manager.go"
click node_plugin_api "https://github.com/eugenioenko/ttt/blob/main/internal/plugin/api.go"

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_app,node_config,node_user toneBlue
class node_buffer,node_undo,node_editor,node_highlight,node_lsp toneAmber
class node_search,node_explorer,node_workspace_state,node_git,node_repo_state,node_changes,node_lsp_server toneMint
class node_ui,node_terminal,node_renderer toneRose
class node_plugin_manager,node_plugin_api,node_rg,node_git_service toneIndigo
```

## Components

### Entry and orchestration

- [CLI entry](https://github.com/eugenioenko/ttt/blob/main/cmd/ttt/main.go): `cmd/ttt/main.go`
- [Application](https://github.com/eugenioenko/ttt/blob/main/internal/app/app.go): `internal/app/app.go`
- [Settings](https://github.com/eugenioenko/ttt/blob/main/internal/config/settings.go): `internal/config/settings.go`

### Editing and language

- [Text buffer](https://github.com/eugenioenko/ttt/blob/main/internal/core/buffer/buffer.go): `internal/core/buffer/buffer.go`
- [Undo stack](https://github.com/eugenioenko/ttt/blob/main/internal/core/undo/undo.go): `internal/core/undo/undo.go`
- [Editor widget](https://github.com/eugenioenko/ttt/blob/main/internal/ui/editor_widget.go): `internal/ui/editor_widget.go`
- [Syntax highlighting](https://github.com/eugenioenko/ttt/blob/main/internal/highlight/highlighter.go): `internal/highlight/highlighter.go`
- [Language services](https://github.com/eugenioenko/ttt/blob/main/internal/lsp/manager.go): `internal/lsp/manager.go`

### Workspace and Git

- [Workspace search](https://github.com/eugenioenko/ttt/blob/main/internal/ui/search_widget.go): `internal/ui/search_widget.go`
- [File explorer](https://github.com/eugenioenko/ttt/blob/main/internal/app/explorer.go): `internal/app/explorer.go`
- [Workspace roots](https://github.com/eugenioenko/ttt/blob/main/internal/workspace/workspace.go): `internal/workspace/workspace.go`
- [Git operations](https://github.com/eugenioenko/ttt/blob/main/internal/git/git.go): `internal/git/git.go`
- [Repository state](https://github.com/eugenioenko/ttt/blob/main/internal/app/repository_state.go): `internal/app/repository_state.go`
- [Changes panel](https://github.com/eugenioenko/ttt/blob/main/internal/app/changes_panel.go): `internal/app/changes_panel.go`

### Terminal interface

- [UI widgets](https://github.com/eugenioenko/ttt/blob/main/internal/ui/root.go): `internal/ui/root.go`
- [Terminal screen](https://github.com/eugenioenko/ttt/blob/main/internal/term/tcell_screen.go): `internal/term/tcell_screen.go`
- [Screen renderer](https://github.com/eugenioenko/ttt/blob/main/internal/render/renderer.go): `internal/render/renderer.go`

### Extensions

- [Plugin manager](https://github.com/eugenioenko/ttt/blob/main/internal/plugin/manager.go): `internal/plugin/manager.go`
- [Plugin API](https://github.com/eugenioenko/ttt/blob/main/internal/plugin/api.go): `internal/plugin/api.go`

### Other components

- **Editor user**
- **ripgrep**
- **Git executable**
- **LSP servers**

## Connections

- Editor user → CLI entry: launches (evidence: `README.md`)
- CLI entry → Application: creates session (evidence: `cmd/ttt/main.go`)
- CLI entry → Settings: loads settings (evidence: `cmd/ttt/main.go`)
- Application → UI widgets: uses widgets (evidence: `internal/app/app.go`)
- Application → Terminal screen: uses screen (evidence: `internal/app/app.go`)
- Application → Screen renderer: uses renderer (evidence: `internal/app/app.go`)
- Application → Language services: uses manager (evidence: `internal/app/app.go`)
- Application → Plugin manager: uses manager (evidence: `internal/app/app.go`)
- Application → Workspace roots: uses workspace (evidence: `internal/app/app.go`)
- Editor user → Editor widget: edits code (evidence: `README.md`)
- Editor widget → Text buffer: edits text
- Editor widget → Undo stack: supports undo
- Editor widget → Syntax highlighting: highlights code
- Editor widget → Language services: requests language features
- Language services → LSP servers: starts server (evidence: `internal/lsp/manager.go`)
- Editor user → Workspace search: searches workspace (evidence: `README.md`)
- Workspace search → ripgrep: runs searches (evidence: `internal/ui/search_widget.go`)
- Editor user → File explorer: navigates files (evidence: `README.md`)
- Editor user → Changes panel: reviews changes (evidence: `README.md`)
- Repository state → Git operations: reads repository state (evidence: `internal/app/repository_state.go`)
- Git operations → Git executable: runs Git
- Editor user → Plugin manager: uses extensions (evidence: `README.md`)
- Plugin manager → Plugin API: exposes API
- UI widgets → Screen renderer: draws interface
- Screen renderer → Terminal screen: updates screen (evidence: `internal/render/renderer.go`)
