# edmocosta/tuistash architecture

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

- Interactive diagram: https://gitdiagram.com/edmocosta/tuistash
- Repository: https://github.com/edmocosta/tuistash

## Overview

Tuistash is a Rust CLI and terminal interface for monitoring Logstash. The principal workflow is to configure a Logstash connection or diagnostic-path source, fetch monitoring data, maintain view-specific state, and render node, pipeline-flow, and thread information in the TUI; a separate `get node` command supports JSON or raw output. The graph preserves these documented capabilities and major TUI domains. Some subsystem wiring is not shown in the excerpts, so uncertain connections are omitted.

Main entry points: [`src/cli/api/mod.rs`](https://github.com/edmocosta/tuistash/blob/main/src/cli/api/mod.rs) (HTTP API client), [`src/cli/commands/tui/shared_state.rs`](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/shared_state.rs) (Shared TUI state), [`src/cli/commands/tui/ui.rs`](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/ui.rs) (TUI rendering), [`src/cli/main.rs`](https://github.com/edmocosta/tuistash/blob/main/src/cli/main.rs) (Application entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and commands"]
  node_entrypoint["Application entry<br/>[main.rs]"]
  node_cli["CLI options<br/>[cli.rs]"]
  node_config["Runtime config<br/>[config.rs]"]
  node_commands["Command dispatch<br/>[mod.rs]"]
  node_getnode["Get node command<br/>[command.rs]"]
  node_nodeoutput["Node output<br/>[output.rs]"]
  node_formatter["Output formatting<br/>[formatter.rs]"]
end

subgraph group_access["Logstash data access"]
  node_api["HTTP API client<br/>[mod.rs]"]
  node_logstash(("Logstash monitoring API"))
  node_nodeapi["Node API data<br/>[node_api.rs]"]
  node_stats["Node and pipeline stats<br/>[stats.rs]"]
  node_hotthreads["Hot threads data<br/>[hot_threads.rs]"]
  node_tls["TLS verification<br/>[tls.rs]"]
end

subgraph group_tui["TUI data and state"]
  node_fetcher["TUI data fetcher<br/>[data_fetcher.rs]"]
  node_app["TUI application<br/>[app.rs]"]
  node_sharedstate["Shared TUI state<br/>[shared_state.rs]"]
  node_decorator["Data decoration<br/>[data_decorator.rs]"]
  node_nodestate["Node view state<br/>[state.rs]"]
  node_flowstate["Pipeline flow state<br/>[state.rs]"]
  node_pipelinestate["Pipeline state<br/>[state.rs]"]
  node_threadstate["Thread view state<br/>[state.rs]"]
end

subgraph group_views["TUI views"]
  node_tuiui["TUI rendering<br/>[ui.rs]"]
  node_nodeui["Node charts<br/>[ui.rs]"]
  node_flowui["Flow tables<br/>[ui.rs]"]
  node_pipelineui["Pipeline view<br/>[ui.rs]"]
  node_threadui["Thread view<br/>[ui.rs]"]
end

node_user(("CLI user"))

node_user -->|"invokes"| node_entrypoint
node_entrypoint -->|"parses options"| node_cli
node_entrypoint -->|"creates client"| node_api
node_entrypoint -->|"builds config"| node_config
node_entrypoint -->|"dispatches command"| node_commands
node_cli -->|"sets connection options"| node_api
node_api -->|"sends requests"| node_logstash
node_api -->|"configures verification"| node_tls
node_commands -->|"dispatches get"| node_getnode
node_getnode -.->|"formats result"| node_nodeoutput
node_nodeoutput -.->|"formats values"| node_formatter
node_api -->|"exposes module"| node_nodeapi
node_api -->|"exposes module"| node_stats
node_api -->|"exposes module"| node_hotthreads
node_app -.->|"fetches data"| node_fetcher
node_fetcher -.->|"requests monitoring data"| node_api
node_fetcher -.->|"updates shared data"| node_sharedstate
node_sharedstate -.->|"provides view data"| node_decorator
node_sharedstate -.->|"updates state"| node_nodestate
node_sharedstate -->|"updates state"| node_flowstate
node_sharedstate -->|"updates state"| node_threadstate
node_sharedstate -.->|"updates state"| node_pipelinestate
node_tuiui -.->|"renders application"| node_app
node_tuiui -.->|"renders node view"| node_nodeui
node_tuiui -.->|"renders flow view"| node_flowui
node_tuiui -.->|"renders pipelines"| node_pipelineui
node_tuiui -.->|"renders threads"| node_threadui
node_nodeui -->|"reads chart data"| node_nodestate
node_flowui -->|"reads flow tables"| node_flowstate
node_threadui -->|"reads thread data"| node_threadstate

click node_entrypoint "https://github.com/edmocosta/tuistash/blob/main/src/cli/main.rs"
click node_cli "https://github.com/edmocosta/tuistash/blob/main/src/cli/cli.rs"
click node_config "https://github.com/edmocosta/tuistash/blob/main/src/cli/config.rs"
click node_commands "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/mod.rs"
click node_getnode "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/node/command.rs"
click node_nodeoutput "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/node/output.rs"
click node_formatter "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/formatter.rs"
click node_api "https://github.com/edmocosta/tuistash/blob/main/src/cli/api/mod.rs"
click node_nodeapi "https://github.com/edmocosta/tuistash/blob/main/src/cli/api/node_api.rs"
click node_stats "https://github.com/edmocosta/tuistash/blob/main/src/cli/api/stats.rs"
click node_hotthreads "https://github.com/edmocosta/tuistash/blob/main/src/cli/api/hot_threads.rs"
click node_tls "https://github.com/edmocosta/tuistash/blob/main/src/cli/api/tls.rs"
click node_fetcher "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/data_fetcher.rs"
click node_app "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/app.rs"
click node_sharedstate "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/shared_state.rs"
click node_decorator "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/data_decorator.rs"
click node_nodestate "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/node/state.rs"
click node_flowstate "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/flows/state.rs"
click node_pipelinestate "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/pipelines/state.rs"
click node_threadstate "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/threads/state.rs"
click node_tuiui "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/ui.rs"
click node_nodeui "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/node/ui.rs"
click node_flowui "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/flows/ui.rs"
click node_pipelineui "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/pipelines/ui.rs"
click node_threadui "https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/threads/ui.rs"

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_entrypoint,node_cli,node_config,node_commands,node_getnode,node_nodeoutput,node_formatter,node_user toneBlue
class node_api,node_logstash,node_nodeapi,node_stats,node_hotthreads,node_tls toneAmber
class node_fetcher,node_app,node_sharedstate,node_decorator,node_nodestate,node_flowstate,node_pipelinestate,node_threadstate toneMint
class node_tuiui,node_nodeui,node_flowui,node_pipelineui,node_threadui toneRose
```

## Components

### CLI and commands

- [Application entry](https://github.com/edmocosta/tuistash/blob/main/src/cli/main.rs): `src/cli/main.rs`
- [CLI options](https://github.com/edmocosta/tuistash/blob/main/src/cli/cli.rs): `src/cli/cli.rs`
- [Runtime config](https://github.com/edmocosta/tuistash/blob/main/src/cli/config.rs): `src/cli/config.rs`
- [Command dispatch](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/mod.rs): `src/cli/commands/mod.rs`
- [Get node command](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/node/command.rs): `src/cli/commands/node/command.rs`
- [Node output](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/node/output.rs): `src/cli/commands/node/output.rs`
- [Output formatting](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/formatter.rs): `src/cli/commands/formatter.rs`

### Logstash data access

- [HTTP API client](https://github.com/edmocosta/tuistash/blob/main/src/cli/api/mod.rs): `src/cli/api/mod.rs`
- **Logstash monitoring API**
- [Node API data](https://github.com/edmocosta/tuistash/blob/main/src/cli/api/node_api.rs): `src/cli/api/node_api.rs`
- [Node and pipeline stats](https://github.com/edmocosta/tuistash/blob/main/src/cli/api/stats.rs): `src/cli/api/stats.rs`
- [Hot threads data](https://github.com/edmocosta/tuistash/blob/main/src/cli/api/hot_threads.rs): `src/cli/api/hot_threads.rs`
- [TLS verification](https://github.com/edmocosta/tuistash/blob/main/src/cli/api/tls.rs): `src/cli/api/tls.rs`

### TUI data and state

- [TUI data fetcher](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/data_fetcher.rs): `src/cli/commands/tui/data_fetcher.rs`
- [TUI application](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/app.rs): `src/cli/commands/tui/app.rs`
- [Shared TUI state](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/shared_state.rs): `src/cli/commands/tui/shared_state.rs`
- [Data decoration](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/data_decorator.rs): `src/cli/commands/tui/data_decorator.rs`
- [Node view state](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/node/state.rs): `src/cli/commands/tui/node/state.rs`
- [Pipeline flow state](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/flows/state.rs): `src/cli/commands/tui/flows/state.rs`
- [Pipeline state](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/pipelines/state.rs): `src/cli/commands/tui/pipelines/state.rs`
- [Thread view state](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/threads/state.rs): `src/cli/commands/tui/threads/state.rs`

### TUI views

- [TUI rendering](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/ui.rs): `src/cli/commands/tui/ui.rs`
- [Node charts](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/node/ui.rs): `src/cli/commands/tui/node/ui.rs`
- [Flow tables](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/flows/ui.rs): `src/cli/commands/tui/flows/ui.rs`
- [Pipeline view](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/pipelines/ui.rs): `src/cli/commands/tui/pipelines/ui.rs`
- [Thread view](https://github.com/edmocosta/tuistash/blob/main/src/cli/commands/tui/threads/ui.rs): `src/cli/commands/tui/threads/ui.rs`

### Other components

- **CLI user**

## Connections

- CLI user → Application entry: invokes (evidence: `README.md`)
- Application entry → CLI options: parses options (evidence: `src/cli/main.rs`)
- Application entry → HTTP API client: creates client (evidence: `src/cli/main.rs`)
- Application entry → Runtime config: builds config (evidence: `src/cli/main.rs`)
- Application entry → Command dispatch: dispatches command (evidence: `src/cli/main.rs`)
- CLI options → HTTP API client: sets connection options (evidence: `src/cli/main.rs`)
- HTTP API client → Logstash monitoring API: sends requests (evidence: `README.md`)
- HTTP API client → TLS verification: configures verification (evidence: `src/cli/api/mod.rs`)
- Command dispatch → Get node command: dispatches get (evidence: `src/cli/commands/mod.rs`)
- Get node command → Node output: formats result
- Node output → Output formatting: formats values
- HTTP API client → Node API data: exposes module (evidence: `src/cli/api/mod.rs`)
- HTTP API client → Node and pipeline stats: exposes module (evidence: `src/cli/api/mod.rs`)
- HTTP API client → Hot threads data: exposes module (evidence: `src/cli/api/mod.rs`)
- TUI application → TUI data fetcher: fetches data
- TUI data fetcher → HTTP API client: requests monitoring data
- TUI data fetcher → Shared TUI state: updates shared data
- Shared TUI state → Data decoration: provides view data
- Shared TUI state → Node view state: updates state
- Shared TUI state → Pipeline flow state: updates state (evidence: `src/cli/commands/tui/flows/state.rs`)
- Shared TUI state → Thread view state: updates state (evidence: `src/cli/commands/tui/threads/state.rs`)
- Shared TUI state → Pipeline state: updates state
- TUI rendering → TUI application: renders application
- TUI rendering → Node charts: renders node view
- TUI rendering → Flow tables: renders flow view
- TUI rendering → Pipeline view: renders pipelines
- TUI rendering → Thread view: renders threads
- Node charts → Node view state: reads chart data (evidence: `src/cli/commands/tui/node/ui.rs`)
- Flow tables → Pipeline flow state: reads flow tables (evidence: `src/cli/commands/tui/flows/ui.rs`)
- Thread view → Thread view state: reads thread data (evidence: `src/cli/commands/tui/threads/ui.rs`)
