# mvanhorn/cli-printing-press architecture

> Architecture diagram of the GitHub repository mvanhorn/cli-printing-press, 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/mvanhorn/cli-printing-press
- Repository: https://github.com/mvanhorn/cli-printing-press

## Overview

CLI Printing Press is a generator that turns an API name or website into a Go CLI, MCP server, and agent skill. The principal workflow starts in the generator CLI, discovers and researches an API, builds a spec from documented or sniffed interfaces, generates artifacts, then verifies, scores, and ships them. Separate discovery branches cover community CLIs/MCP servers, browser traffic, and device APIs. The README documents broader capabilities than the sampled source excerpts; the graph preserves those branches without assuming their internal call wiring.

Main entry points: [`internal/pipeline/pipeline.go`](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/pipeline/pipeline.go) (Run pipeline), [`internal/pipeline/discover.go`](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/pipeline/discover.go) (Spec discovery), [`internal/pipeline/research.go`](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/pipeline/research.go) (API research), [`internal/cli/root.go`](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/cli/root.go) (Generator CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Generation workflow"]
  node_generator_cli["Generator CLI<br/>[root.go]"]
  node_pipeline["Run pipeline<br/>[pipeline.go]"]
  node_research["API research<br/>[research.go]"]
end

subgraph group_discovery["API discovery"]
  node_spec_discovery["Spec discovery<br/>[discover.go]"]
  node_openapi["OpenAPI parsing<br/>[parser.go]"]
  node_graphql["GraphQL parsing<br/>[parser.go]"]
  node_browser_sniff["Browser sniffing<br/>[analysis.go]"]
  node_crowd_sniff["Community sniffing<br/>[aggregate.go]"]
  node_device_sniff["Device sniffing<br/>[analyze.go]"]
end

subgraph group_generation["Artifact generation"]
  node_generator["Go CLI and MCP generation<br/>[generator.go]"]
  node_polish["LLM polish<br/>[polish.go]"]
  node_generated_artifacts["CLI, MCP, skill"]
end

subgraph group_quality["Verification and release"]
  node_verification["Verification<br/>[verify.go]"]
  node_scorecard["Quality score<br/>[scorecard.go]"]
  node_shipcheck["Ship checks<br/>[shipcheck.go]"]
  node_published_cli["Published CLI"]
end

node_user(("Agent or user"))
node_api_sources["API docs and specs"]
node_community_sources["Community CLIs and MCP"]
node_browser_traffic["Website traffic"]
node_device_api["Device API"]

node_user -->|"requests generation"| node_generator_cli
node_generator_cli -->|"starts run"| node_pipeline
node_pipeline -->|"discovers spec"| node_spec_discovery
node_pipeline -->|"runs research"| node_research
node_spec_discovery -->|"reads docs or spec"| node_api_sources
node_spec_discovery -->|"parses OpenAPI"| node_openapi
node_spec_discovery -->|"parses GraphQL"| node_graphql
node_research -->|"studies tools"| node_community_sources
node_research -->|"aggregates signals"| node_crowd_sniff
node_browser_sniff -->|"analyzes traffic"| node_browser_traffic
node_device_sniff -->|"probes interface"| node_device_api
node_pipeline -->|"sniffs websites"| node_browser_sniff
node_pipeline -->|"sniffs devices"| node_device_sniff
node_pipeline -->|"generates artifacts"| node_generator
node_generator -->|"writes CLI and MCP"| node_generated_artifacts
node_pipeline -.->|"polishes output"| node_polish
node_pipeline -->|"verifies output"| node_verification
node_pipeline -->|"scores output"| node_scorecard
node_pipeline -->|"checks release"| node_shipcheck
node_pipeline -->|"publishes CLI"| node_published_cli

click node_generator_cli "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/cli/root.go"
click node_pipeline "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/pipeline/pipeline.go"
click node_research "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/pipeline/research.go"
click node_spec_discovery "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/pipeline/discover.go"
click node_openapi "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/openapi/parser.go"
click node_graphql "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/graphql/parser.go"
click node_browser_sniff "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/browsersniff/analysis.go"
click node_crowd_sniff "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/crowdsniff/aggregate.go"
click node_device_sniff "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/devicesniff/ble/analyze.go"
click node_generator "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/generator/generator.go"
click node_polish "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/llmpolish/polish.go"
click node_verification "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/pipeline/verify.go"
click node_scorecard "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/pipeline/scorecard.go"
click node_shipcheck "https://github.com/mvanhorn/cli-printing-press/blob/main/internal/cli/shipcheck.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_generator_cli,node_pipeline,node_research,node_user toneBlue
class node_spec_discovery,node_openapi,node_graphql,node_browser_sniff,node_crowd_sniff,node_device_sniff toneAmber
class node_generator,node_polish,node_generated_artifacts,node_api_sources,node_device_api toneMint
class node_verification,node_scorecard,node_shipcheck,node_published_cli toneRose
class node_community_sources,node_browser_traffic toneIndigo
```

## Components

### Generation workflow

- [Generator CLI](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/cli/root.go): `internal/cli/root.go`
- [Run pipeline](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/pipeline/pipeline.go): `internal/pipeline/pipeline.go`
- [API research](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/pipeline/research.go): `internal/pipeline/research.go`

### API discovery

- [Spec discovery](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/pipeline/discover.go): `internal/pipeline/discover.go`
- [OpenAPI parsing](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/openapi/parser.go): `internal/openapi/parser.go`
- [GraphQL parsing](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/graphql/parser.go): `internal/graphql/parser.go`
- [Browser sniffing](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/browsersniff/analysis.go): `internal/browsersniff/analysis.go`
- [Community sniffing](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/crowdsniff/aggregate.go): `internal/crowdsniff/aggregate.go`
- [Device sniffing](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/devicesniff/ble/analyze.go): `internal/devicesniff/ble/analyze.go`

### Artifact generation

- [Go CLI and MCP generation](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/generator/generator.go): `internal/generator/generator.go`
- [LLM polish](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/llmpolish/polish.go): `internal/llmpolish/polish.go`
- **CLI, MCP, skill**

### Verification and release

- [Verification](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/pipeline/verify.go): `internal/pipeline/verify.go`
- [Quality score](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/pipeline/scorecard.go): `internal/pipeline/scorecard.go`
- [Ship checks](https://github.com/mvanhorn/cli-printing-press/blob/main/internal/cli/shipcheck.go): `internal/cli/shipcheck.go`
- **Published CLI**

### Other components

- **Agent or user**
- **API docs and specs**
- **Community CLIs and MCP**
- **Website traffic**
- **Device API**

## Connections

- Agent or user → Generator CLI: requests generation
- Generator CLI → Run pipeline: starts run
- Run pipeline → Spec discovery: discovers spec
- Run pipeline → API research: runs research
- Spec discovery → API docs and specs: reads docs or spec
- Spec discovery → OpenAPI parsing: parses OpenAPI
- Spec discovery → GraphQL parsing: parses GraphQL
- API research → Community CLIs and MCP: studies tools
- API research → Community sniffing: aggregates signals
- Browser sniffing → Website traffic: analyzes traffic
- Device sniffing → Device API: probes interface
- Run pipeline → Browser sniffing: sniffs websites
- Run pipeline → Device sniffing: sniffs devices
- Run pipeline → Go CLI and MCP generation: generates artifacts
- Go CLI and MCP generation → CLI, MCP, skill: writes CLI and MCP
- Run pipeline → LLM polish: polishes output
- Run pipeline → Verification: verifies output
- Run pipeline → Quality score: scores output
- Run pipeline → Ship checks: checks release
- Run pipeline → Published CLI: publishes CLI
