# majorwhiskey/pogo-pin architecture

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

- Interactive diagram: https://gitdiagram.com/majorwhiskey/pogo-pin
- Repository: https://github.com/majorwhiskey/pogo-pin

## Overview

pogo is an agent-oriented ESP32 hardware workbench: a CLI and MCP server expose terminating, structured operations over one shared core. The main workflow selects a board, performs flash/reset/serial capture or probe work, then returns JSON results and actionable status. Core stages include discovery and configuration, device operations, transport/probe protocol, and result formatting; hardware-test suites and remote MCP access are additional capabilities. Several core operation implementations are unsampled, so those subsystem links reflect the README’s explicit frontend-parity description rather than inspected call sites.

Main entry points: [`crates/pogo-core/src/ops`](https://github.com/majorwhiskey/pogo-pin/tree/main/crates/pogo-core/src/ops) (Core operations), [`crates/pogo-cli/src/main.rs`](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-cli/src/main.rs) (CLI dispatch), [`crates/pogo-mcp/src/lib.rs`](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-mcp/src/lib.rs) (MCP tools), [`crates/pogo-core/src/probe.rs`](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/probe.rs) (Probe protocol)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_cli["CLI dispatch<br/>[main.rs]"]
  node_cliargs["CLI arguments<br/>[args.rs]"]
  node_clioutput["Output formatting<br/>[output.rs]"]
  node_menu["Launcher menu<br/>[mod.rs]"]
  node_mcp["MCP tools<br/>[lib.rs]"]
  node_mcpconvert["MCP conversion<br/>[convert.rs]"]
  node_remote["HTTP MCP<br/>[http.rs]"]
end

subgraph group_orchestration["Core operations"]
  node_discovery["Device discovery<br/>[discovery.rs]"]
  node_operations["Core operations"]
  node_suite["Hardware test suites<br/>[suite.rs]"]
end

subgraph group_target["ESP target I/O"]
  node_flash["Flash and chip info<br/>[flash.rs]"]
  node_serial["Serial capture<br/>[session.rs]"]
  node_reset["Target reset<br/>[reset.rs]"]
end

subgraph group_probe["Probe capabilities"]
  node_probeops["Probe operations<br/>[probe.rs]"]
  node_probecore["Probe protocol<br/>[probe.rs]"]
  node_wirecodec["Wire codec<br/>[codec.rs]"]
end

subgraph group_foundation["Shared foundation"]
  node_config["Configuration<br/>[load.rs]"]
  node_transport["Byte transports<br/>[mod.rs]"]
  node_recording["Session recording<br/>[record.rs]"]
  node_envelope["Result envelope<br/>[envelope.rs]"]
  node_errors["Errors and hints<br/>[error.rs]"]
end

node_agent(("Agent or user"))

node_agent -->|"runs commands"| node_cli
node_agent -->|"invokes tools"| node_mcp
node_cli -->|"parses arguments"| node_cliargs
node_cli -.->|"dispatches operations"| node_operations
node_cli -->|"formats results"| node_clioutput
node_cli -->|"opens when requested"| node_menu
node_menu -->|"runs commands"| node_cli
node_mcp -->|"calls shared core"| node_operations
node_mcp -->|"converts results"| node_mcpconvert
node_mcp -->|"serves over HTTP"| node_remote
node_operations -.->|"selects devices"| node_discovery
node_operations -.->|"uses settings"| node_config
node_operations -->|"runs flashing"| node_flash
node_operations -->|"captures serial"| node_serial
node_operations -->|"resets target"| node_reset
node_operations -->|"runs suites"| node_suite
node_operations -->|"runs probe tasks"| node_probeops
node_probeops -->|"uses probe client"| node_probecore
node_probecore -->|"uses transport"| node_transport
node_transport -->|"wraps for recording"| node_recording
node_operations -.->|"returns structured data"| node_envelope
node_operations -.->|"reports failures"| node_errors
node_probecore -.->|"exchanges protocol frames"| node_wirecodec

click node_cli "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-cli/src/main.rs"
click node_cliargs "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-cli/src/cli/args.rs"
click node_clioutput "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-cli/src/output.rs"
click node_menu "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-cli/src/menu/mod.rs"
click node_mcp "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-mcp/src/lib.rs"
click node_mcpconvert "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-mcp/src/convert.rs"
click node_remote "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-mcp/src/http.rs"
click node_discovery "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/discovery.rs"
click node_config "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/config/load.rs"
click node_operations "https://github.com/majorwhiskey/pogo-pin/tree/main/crates/pogo-core/src/ops"
click node_flash "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/ops/flash.rs"
click node_serial "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/serial/session.rs"
click node_reset "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/ops/reset.rs"
click node_suite "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/ops/suite.rs"
click node_probeops "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/ops/probe.rs"
click node_probecore "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/probe.rs"
click node_wirecodec "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-protocol/src/codec.rs"
click node_transport "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/transport/mod.rs"
click node_recording "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/transport/record.rs"
click node_envelope "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/envelope.rs"
click node_errors "https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/error.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_cli,node_cliargs,node_clioutput,node_menu,node_mcp,node_mcpconvert,node_remote,node_agent toneBlue
class node_discovery,node_operations,node_suite toneAmber
class node_flash,node_serial,node_reset toneMint
class node_probeops,node_probecore,node_wirecodec toneRose
class node_config,node_transport,node_recording,node_envelope,node_errors toneIndigo
```

## Components

### User interfaces

- [CLI dispatch](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-cli/src/main.rs): `crates/pogo-cli/src/main.rs`
- [CLI arguments](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-cli/src/cli/args.rs): `crates/pogo-cli/src/cli/args.rs`
- [Output formatting](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-cli/src/output.rs): `crates/pogo-cli/src/output.rs`
- [Launcher menu](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-cli/src/menu/mod.rs): `crates/pogo-cli/src/menu/mod.rs`
- [MCP tools](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-mcp/src/lib.rs): `crates/pogo-mcp/src/lib.rs`
- [MCP conversion](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-mcp/src/convert.rs): `crates/pogo-mcp/src/convert.rs`
- [HTTP MCP](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-mcp/src/http.rs): `crates/pogo-mcp/src/http.rs`

### Core operations

- [Device discovery](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/discovery.rs): `crates/pogo-core/src/discovery.rs`
- [Core operations](https://github.com/majorwhiskey/pogo-pin/tree/main/crates/pogo-core/src/ops): `crates/pogo-core/src/ops`
- [Hardware test suites](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/ops/suite.rs): `crates/pogo-core/src/ops/suite.rs`

### ESP target I/O

- [Flash and chip info](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/ops/flash.rs): `crates/pogo-core/src/ops/flash.rs`
- [Serial capture](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/serial/session.rs): `crates/pogo-core/src/serial/session.rs`
- [Target reset](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/ops/reset.rs): `crates/pogo-core/src/ops/reset.rs`

### Probe capabilities

- [Probe operations](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/ops/probe.rs): `crates/pogo-core/src/ops/probe.rs`
- [Probe protocol](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/probe.rs): `crates/pogo-core/src/probe.rs`
- [Wire codec](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-protocol/src/codec.rs): `crates/pogo-protocol/src/codec.rs`

### Shared foundation

- [Configuration](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/config/load.rs): `crates/pogo-core/src/config/load.rs`
- [Byte transports](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/transport/mod.rs): `crates/pogo-core/src/transport/mod.rs`
- [Session recording](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/transport/record.rs): `crates/pogo-core/src/transport/record.rs`
- [Result envelope](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/envelope.rs): `crates/pogo-core/src/envelope.rs`
- [Errors and hints](https://github.com/majorwhiskey/pogo-pin/blob/main/crates/pogo-core/src/error.rs): `crates/pogo-core/src/error.rs`

### Other components

- **Agent or user**

## Connections

- Agent or user → CLI dispatch: runs commands
- Agent or user → MCP tools: invokes tools
- CLI dispatch → CLI arguments: parses arguments (evidence: `crates/pogo-cli/src/main.rs`)
- CLI dispatch → Core operations: dispatches operations
- CLI dispatch → Output formatting: formats results (evidence: `crates/pogo-cli/src/main.rs`)
- CLI dispatch → Launcher menu: opens when requested (evidence: `crates/pogo-cli/src/main.rs`)
- Launcher menu → CLI dispatch: runs commands (evidence: `crates/pogo-cli/src/menu/mod.rs`)
- MCP tools → Core operations: calls shared core (evidence: `crates/pogo-mcp/src/lib.rs`)
- MCP tools → MCP conversion: converts results (evidence: `crates/pogo-mcp/src/lib.rs`)
- MCP tools → HTTP MCP: serves over HTTP (evidence: `crates/pogo-mcp/src/lib.rs`)
- Core operations → Device discovery: selects devices
- Core operations → Configuration: uses settings
- Core operations → Flash and chip info: runs flashing (evidence: `crates/pogo-core/src/ops/mod.rs`)
- Core operations → Serial capture: captures serial
- Core operations → Target reset: resets target (evidence: `crates/pogo-core/src/ops/mod.rs`)
- Core operations → Hardware test suites: runs suites (evidence: `crates/pogo-core/src/ops/mod.rs`)
- Core operations → Probe operations: runs probe tasks (evidence: `crates/pogo-core/src/ops/mod.rs`)
- Probe operations → Probe protocol: uses probe client (evidence: `crates/pogo-core/src/ops/probe.rs`)
- Probe protocol → Byte transports: uses transport (evidence: `crates/pogo-core/src/probe.rs`)
- Byte transports → Session recording: wraps for recording (evidence: `crates/pogo-core/src/transport/mod.rs`)
- Core operations → Result envelope: returns structured data (evidence: `crates/pogo-core/src/ops/mod.rs`)
- Core operations → Errors and hints: reports failures (evidence: `crates/pogo-core/src/ops/mod.rs`)
- Probe protocol → Wire codec: exchanges protocol frames
