# halilkirazkaya/arsenal-ng architecture

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

- Interactive diagram: https://gitdiagram.com/halilkirazkaya/arsenal-ng
- Repository: https://github.com/halilkirazkaya/arsenal-ng

## Overview

arsenal-ng is a terminal pentest command launcher: a user searches its embedded command catalog, selects an entry, supplies template arguments (optionally prefilled from global variables), then receives the completed command in the terminal input buffer for review and execution. The map includes search, argument handling, variable persistence, and the documented tools/help views. Some UI wiring is inferred only where README capabilities and sampled files support it; unsampled view/update implementations are represented by their exact enclosing directory.

Main entry points: [`internal/ui`](https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/ui) (Input and view updates), [`cmd/arsenal-ng/main.go`](https://github.com/halilkirazkaya/arsenal-ng/blob/main/cmd/arsenal-ng/main.go) (CLI entry), [`internal/ui/view_search.go`](https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/ui/view_search.go) (Search and hints view), [`internal/state/variables.go`](https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/state/variables.go) (Global variable store)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Launch and output"]
  node_main["CLI entry<br/>[main.go]"]
  node_terminal["Terminal buffer<br/>[terminal.go]"]
end

subgraph group_catalog["Command catalog"]
  node_cheat_files["Embedded YAML commands"]
  node_loader["Catalog loader<br/>[loader.go]"]
  node_search["Command search<br/>[search.go]"]
  node_models["Cheat and argument models"]
end

subgraph group_interface["Interactive interface"]
  node_app_model["TUI application model<br/>[app_model.go]"]
  node_ui_updates["Input and view updates"]
  node_search_view["Search and hints view<br/>[view_search.go]"]
  node_argument_views["Argument and result views"]
  node_tools_help_views["Tools and help views"]
  node_highlighting["Syntax and fuzzy highlighting"]
end

subgraph group_state["Variables and config"]
  node_variables["Global variable store<br/>[variables.go]"]
  node_variable_file[("Persisted variables<br/>[path.go]")]
  node_config["Runtime configuration"]
end

node_user(("Operator"))

node_user -->|"launches"| node_main
node_main -->|"loads catalog"| node_loader
node_loader -->|"reads embedded YAML"| node_cheat_files
node_loader -->|"builds cheat records"| node_models
node_main -->|"creates TUI"| node_app_model
node_app_model -->|"handles events"| node_ui_updates
node_ui_updates -->|"filters commands"| node_search
node_ui_updates -->|"parses arguments"| node_models
node_ui_updates -->|"reads and updates"| node_variables
node_ui_updates -->|"renders search"| node_search_view
node_ui_updates -->|"renders argument flow"| node_argument_views
node_ui_updates -->|"switches views"| node_tools_help_views
node_search_view -->|"highlights matches"| node_highlighting
node_search_view -->|"displays cheat data"| node_models
node_main -->|"gets log path"| node_config
node_variables -->|"gets storage path"| node_config
node_variables -->|"loads and saves JSON"| node_variable_file
node_app_model -->|"initializes store"| node_variables
node_main -->|"injects final command"| node_terminal
node_user -->|"searches and selects"| node_search_view
node_terminal -->|"prefills for review"| node_user

click node_main "https://github.com/halilkirazkaya/arsenal-ng/blob/main/cmd/arsenal-ng/main.go"
click node_terminal "https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/output/terminal.go"
click node_cheat_files "https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/loader/cheat-files"
click node_loader "https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/loader/loader.go"
click node_search "https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/loader/search.go"
click node_models "https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/model"
click node_app_model "https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/ui/app_model.go"
click node_ui_updates "https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/ui"
click node_search_view "https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/ui/view_search.go"
click node_argument_views "https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/ui"
click node_tools_help_views "https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/ui"
click node_highlighting "https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/ui"
click node_variables "https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/state/variables.go"
click node_variable_file "https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/config/path.go"
click node_config "https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/config"

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_main,node_terminal toneBlue
class node_cheat_files,node_loader,node_search,node_models toneAmber
class node_app_model,node_ui_updates,node_search_view,node_argument_views,node_tools_help_views,node_highlighting toneMint
class node_variables,node_variable_file,node_config toneRose
class node_user toneIndigo
```

## Components

### Launch and output

- [CLI entry](https://github.com/halilkirazkaya/arsenal-ng/blob/main/cmd/arsenal-ng/main.go): `cmd/arsenal-ng/main.go`
- [Terminal buffer](https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/output/terminal.go): `internal/output/terminal.go`

### Command catalog

- [Embedded YAML commands](https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/loader/cheat-files): `internal/loader/cheat-files`
- [Catalog loader](https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/loader/loader.go): `internal/loader/loader.go`
- [Command search](https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/loader/search.go): `internal/loader/search.go`
- [Cheat and argument models](https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/model): `internal/model`

### Interactive interface

- [TUI application model](https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/ui/app_model.go): `internal/ui/app_model.go`
- [Input and view updates](https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/ui): `internal/ui`
- [Search and hints view](https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/ui/view_search.go): `internal/ui/view_search.go`
- [Argument and result views](https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/ui): `internal/ui`
- [Tools and help views](https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/ui): `internal/ui`
- [Syntax and fuzzy highlighting](https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/ui): `internal/ui`

### Variables and config

- [Global variable store](https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/state/variables.go): `internal/state/variables.go`
- [Persisted variables](https://github.com/halilkirazkaya/arsenal-ng/blob/main/internal/config/path.go): `internal/config/path.go`
- [Runtime configuration](https://github.com/halilkirazkaya/arsenal-ng/tree/main/internal/config): `internal/config`

### Other components

- **Operator**

## Connections

- Operator → CLI entry: launches
- CLI entry → Catalog loader: loads catalog
- Catalog loader → Embedded YAML commands: reads embedded YAML
- Catalog loader → Cheat and argument models: builds cheat records
- CLI entry → TUI application model: creates TUI
- TUI application model → Input and view updates: handles events
- Input and view updates → Command search: filters commands
- Input and view updates → Cheat and argument models: parses arguments
- Input and view updates → Global variable store: reads and updates
- Input and view updates → Search and hints view: renders search
- Input and view updates → Argument and result views: renders argument flow
- Input and view updates → Tools and help views: switches views
- Search and hints view → Syntax and fuzzy highlighting: highlights matches
- Search and hints view → Cheat and argument models: displays cheat data
- CLI entry → Runtime configuration: gets log path
- Global variable store → Runtime configuration: gets storage path
- Global variable store → Persisted variables: loads and saves JSON
- TUI application model → Global variable store: initializes store
- CLI entry → Terminal buffer: injects final command
- Operator → Search and hints view: searches and selects
- Terminal buffer → Operator: prefills for review
