# makew0rld/gemget architecture

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

- Interactive diagram: https://gitdiagram.com/makew0rld/gemget
- Repository: https://github.com/makew0rld/gemget

## Overview

gemget is a command-line Gemini downloader. Users provide URLs as arguments or through an input file; the command normalizes and scans them, fetches each URL, handles Gemini response statuses and redirects, then streams successful content to stdout or a file. Download limits, client certificates, proxies, progress output, and logging are supporting capabilities. The source excerpts show the main orchestration and download path; optional integrations are included only where documented or configured, and no unsampled implementation details are assumed.

Main entry points: [`network.go`](https://github.com/makew0rld/gemget/blob/master/network.go) (Fetch and status handling), [`gemget.go`](https://github.com/makew0rld/gemget/blob/master/gemget.go) (Command orchestration), [`scanner/scanner.go`](https://github.com/makew0rld/gemget/blob/master/scanner/scanner.go) (URL scanner), [`logging.go`](https://github.com/makew0rld/gemget/blob/master/logging.go) (Status and errors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["URL input"]
  node_url_scanner["URL scanner<br/>[scanner.go]"]
  node_input_file["URL input file"]
end

subgraph group_transfer["Gemini transfer"]
  node_command["Command orchestration<br/>[gemget.go]"]
  node_fetch["Fetch and status handling<br/>[network.go]"]
  node_gemini_servers{{"Gemini servers"}}
end

subgraph group_output["Download output"]
  node_download_writer["Download writer<br/>[network.go]"]
  node_local_files[("Local files")]
  node_stdout["Standard output"]
end

subgraph group_support["Configuration and feedback"]
  node_client_config["Client configuration<br/>[gemget.go]"]
  node_socks_proxy{{"SOCKS5 proxy"}}
  node_logging["Status and errors<br/>[logging.go]"]
  node_progress["Progress display<br/>[network.go]"]
end

node_user(("CLI user"))

node_user -->|"provides options"| node_command
node_command -->|"scans URLs"| node_url_scanner
node_input_file -->|"supplies lines"| node_url_scanner
node_url_scanner -->|"yields URLs"| node_fetch
node_command -->|"invokes fetch"| node_fetch
node_command -->|"configures client"| node_client_config
node_fetch -->|"requests content"| node_gemini_servers
node_fetch -->|"saves successful body"| node_download_writer
node_download_writer -->|"writes file"| node_local_files
node_fetch -->|"streams body"| node_stdout
node_client_config -.->|"configures optional proxy"| node_socks_proxy
node_command -->|"reports status"| node_logging
node_fetch -->|"reports outcomes"| node_logging
node_download_writer -->|"updates progress"| node_progress

click node_command "https://github.com/makew0rld/gemget/blob/master/gemget.go"
click node_url_scanner "https://github.com/makew0rld/gemget/blob/master/scanner/scanner.go"
click node_fetch "https://github.com/makew0rld/gemget/blob/master/network.go"
click node_download_writer "https://github.com/makew0rld/gemget/blob/master/network.go"
click node_client_config "https://github.com/makew0rld/gemget/blob/master/gemget.go"
click node_logging "https://github.com/makew0rld/gemget/blob/master/logging.go"
click node_progress "https://github.com/makew0rld/gemget/blob/master/network.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_url_scanner,node_input_file,node_user toneBlue
class node_command,node_fetch,node_gemini_servers toneAmber
class node_download_writer,node_local_files,node_stdout toneMint
class node_client_config,node_socks_proxy,node_logging,node_progress toneRose
```

## Components

### URL input

- [URL scanner](https://github.com/makew0rld/gemget/blob/master/scanner/scanner.go): `scanner/scanner.go`
- **URL input file**

### Gemini transfer

- [Command orchestration](https://github.com/makew0rld/gemget/blob/master/gemget.go): `gemget.go`
- [Fetch and status handling](https://github.com/makew0rld/gemget/blob/master/network.go): `network.go`
- **Gemini servers**

### Download output

- [Download writer](https://github.com/makew0rld/gemget/blob/master/network.go): `network.go`
- **Local files**
- **Standard output**

### Configuration and feedback

- [Client configuration](https://github.com/makew0rld/gemget/blob/master/gemget.go): `gemget.go`
- **SOCKS5 proxy**
- [Status and errors](https://github.com/makew0rld/gemget/blob/master/logging.go): `logging.go`
- [Progress display](https://github.com/makew0rld/gemget/blob/master/network.go): `network.go`

### Other components

- **CLI user**

## Connections

- CLI user → Command orchestration: provides options (evidence: `gemget.go`)
- Command orchestration → URL scanner: scans URLs (evidence: `gemget.go`)
- URL input file → URL scanner: supplies lines
- URL scanner → Fetch and status handling: yields URLs
- Command orchestration → Fetch and status handling: invokes fetch (evidence: `gemget.go`)
- Command orchestration → Client configuration: configures client (evidence: `gemget.go`)
- Fetch and status handling → Gemini servers: requests content (evidence: `network.go`)
- Fetch and status handling → Download writer: saves successful body (evidence: `network.go`)
- Download writer → Local files: writes file (evidence: `network.go`)
- Fetch and status handling → Standard output: streams body (evidence: `network.go`)
- Client configuration → SOCKS5 proxy: configures optional proxy (evidence: `gemget.go`)
- Command orchestration → Status and errors: reports status (evidence: `gemget.go`)
- Fetch and status handling → Status and errors: reports outcomes (evidence: `network.go`)
- Download writer → Progress display: updates progress (evidence: `network.go`)
