# asciimoo/wuzz architecture

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

- Interactive diagram: https://gitdiagram.com/asciimoo/wuzz
- Repository: https://github.com/asciimoo/wuzz

## Overview

Wuzz is an interactive terminal HTTP inspector: users edit or load cURL-like request details, submit them, inspect formatted responses, and save requests or responses. `wuzz.go` is the central application and request orchestrator; configuration, command dispatch, status display, and content-specific formatting are distinct supporting layers. The excerpts establish HTTP dispatch and formatter selection behavior; broader UI wiring and some persistence details are supported only by the README, so those links cite it.

Main entry points: [`wuzz.go`](https://github.com/asciimoo/wuzz/blob/master/wuzz.go) (Wuzz application), [`formatter/formatter.go`](https://github.com/asciimoo/wuzz/blob/master/formatter/formatter.go) (Format selection), [`commands.go`](https://github.com/asciimoo/wuzz/blob/master/commands.go) (Key commands), [`config/config.go`](https://github.com/asciimoo/wuzz/blob/master/config/config.go) (Settings and bindings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interaction["Terminal interaction"]
  node_app["Wuzz application<br/>[wuzz.go]"]
  node_commands["Key commands<br/>[commands.go]"]
  node_keymap["Key mapping<br/>[keys.go]"]
end

subgraph group_requests["Request and response"]
  node_request_fields["Request editor<br/>[wuzz.go]"]
  node_request_headers["Header suggestions<br/>[request-headers.go]"]
  node_request_send["Request dispatch<br/>[wuzz.go]"]
  node_response["Response capture<br/>[wuzz.go]"]
  node_history["Request history<br/>[wuzz.go]"]
end

subgraph group_presentation["Response presentation"]
  node_format_select["Format selection<br/>[formatter.go]"]
  node_text_format["Text formatting<br/>[text.go]"]
  node_html_format["HTML formatting<br/>[html.go]"]
  node_json_format["JSON formatting<br/>[json.go]"]
  node_binary_format["Binary formatting<br/>[binary.go]"]
end

subgraph group_settings["Configuration and state"]
  node_config["Settings and bindings<br/>[config.go]"]
  node_status["Status display<br/>[status-line.go]"]
end

node_user(("CLI user"))
node_http_service["HTTP endpoint"]
node_local_files["Request/response files"]

node_user -->|"operates"| node_app
node_app -->|"dispatches commands"| node_commands
node_app -->|"maps keys"| node_keymap
node_user -->|"edits request"| node_request_fields
node_request_fields -.->|"uses suggestions"| node_request_headers
node_app -->|"submits request"| node_request_send
node_request_send -->|"sends HTTP request"| node_http_service
node_request_send -->|"receives response"| node_response
node_app -.->|"tracks requests"| node_history
node_response -.->|"selects formatter"| node_format_select
node_format_select -->|"chooses by type"| node_text_format
node_format_select -->|"chooses by type"| node_html_format
node_format_select -->|"chooses by type"| node_json_format
node_format_select -->|"chooses by type"| node_binary_format
node_app -->|"uses settings"| node_config
node_format_select -->|"checks settings"| node_config
node_app -->|"refreshes status"| node_status
node_commands -->|"saves or loads"| node_local_files

click node_app "https://github.com/asciimoo/wuzz/blob/master/wuzz.go"
click node_commands "https://github.com/asciimoo/wuzz/blob/master/commands.go"
click node_keymap "https://github.com/asciimoo/wuzz/blob/master/keys.go"
click node_request_fields "https://github.com/asciimoo/wuzz/blob/master/wuzz.go"
click node_request_headers "https://github.com/asciimoo/wuzz/blob/master/request-headers.go"
click node_request_send "https://github.com/asciimoo/wuzz/blob/master/wuzz.go"
click node_response "https://github.com/asciimoo/wuzz/blob/master/wuzz.go"
click node_history "https://github.com/asciimoo/wuzz/blob/master/wuzz.go"
click node_format_select "https://github.com/asciimoo/wuzz/blob/master/formatter/formatter.go"
click node_text_format "https://github.com/asciimoo/wuzz/blob/master/formatter/text.go"
click node_html_format "https://github.com/asciimoo/wuzz/blob/master/formatter/html.go"
click node_json_format "https://github.com/asciimoo/wuzz/blob/master/formatter/json.go"
click node_binary_format "https://github.com/asciimoo/wuzz/blob/master/formatter/binary.go"
click node_config "https://github.com/asciimoo/wuzz/blob/master/config/config.go"
click node_status "https://github.com/asciimoo/wuzz/blob/master/status-line.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_app,node_commands,node_keymap,node_user toneBlue
class node_request_fields,node_request_headers,node_request_send,node_response,node_history toneAmber
class node_format_select,node_text_format,node_html_format,node_json_format,node_binary_format,node_local_files toneMint
class node_config,node_status toneRose
class node_http_service toneIndigo
```

## Components

### Terminal interaction

- [Wuzz application](https://github.com/asciimoo/wuzz/blob/master/wuzz.go): `wuzz.go`
- [Key commands](https://github.com/asciimoo/wuzz/blob/master/commands.go): `commands.go`
- [Key mapping](https://github.com/asciimoo/wuzz/blob/master/keys.go): `keys.go`

### Request and response

- [Request editor](https://github.com/asciimoo/wuzz/blob/master/wuzz.go): `wuzz.go`
- [Header suggestions](https://github.com/asciimoo/wuzz/blob/master/request-headers.go): `request-headers.go`
- [Request dispatch](https://github.com/asciimoo/wuzz/blob/master/wuzz.go): `wuzz.go`
- [Response capture](https://github.com/asciimoo/wuzz/blob/master/wuzz.go): `wuzz.go`
- [Request history](https://github.com/asciimoo/wuzz/blob/master/wuzz.go): `wuzz.go`

### Response presentation

- [Format selection](https://github.com/asciimoo/wuzz/blob/master/formatter/formatter.go): `formatter/formatter.go`
- [Text formatting](https://github.com/asciimoo/wuzz/blob/master/formatter/text.go): `formatter/text.go`
- [HTML formatting](https://github.com/asciimoo/wuzz/blob/master/formatter/html.go): `formatter/html.go`
- [JSON formatting](https://github.com/asciimoo/wuzz/blob/master/formatter/json.go): `formatter/json.go`
- [Binary formatting](https://github.com/asciimoo/wuzz/blob/master/formatter/binary.go): `formatter/binary.go`

### Configuration and state

- [Settings and bindings](https://github.com/asciimoo/wuzz/blob/master/config/config.go): `config/config.go`
- [Status display](https://github.com/asciimoo/wuzz/blob/master/status-line.go): `status-line.go`

### Other components

- **CLI user**
- **HTTP endpoint**
- **Request/response files**

## Connections

- CLI user → Wuzz application: operates (evidence: `README.md`)
- Wuzz application → Key commands: dispatches commands (evidence: `commands.go`)
- Wuzz application → Key mapping: maps keys (evidence: `keys.go`)
- CLI user → Request editor: edits request (evidence: `README.md`)
- Request editor → Header suggestions: uses suggestions
- Wuzz application → Request dispatch: submits request (evidence: `README.md`)
- Request dispatch → HTTP endpoint: sends HTTP request (evidence: `wuzz.go`)
- Request dispatch → Response capture: receives response (evidence: `wuzz.go`)
- Wuzz application → Request history: tracks requests (evidence: `wuzz.go`)
- Response capture → Format selection: selects formatter
- Format selection → Text formatting: chooses by type (evidence: `formatter/formatter.go`)
- Format selection → HTML formatting: chooses by type (evidence: `formatter/formatter.go`)
- Format selection → JSON formatting: chooses by type (evidence: `formatter/formatter.go`)
- Format selection → Binary formatting: chooses by type (evidence: `formatter/formatter.go`)
- Wuzz application → Settings and bindings: uses settings (evidence: `wuzz.go`)
- Format selection → Settings and bindings: checks settings (evidence: `formatter/formatter.go`)
- Wuzz application → Status display: refreshes status (evidence: `wuzz.go`)
- Key commands → Request/response files: saves or loads (evidence: `commands.go`)
