# talwat/pokeget-rs architecture

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

- Interactive diagram: https://gitdiagram.com/talwat/pokeget-rs
- Repository: https://github.com/talwat/pokeget-rs

## Overview

pokeget-rs is a terminal Pokémon sprite renderer. Its workflow parses CLI selections and display options, resolves names or IDs (including random and region choices), loads and formats embedded sprites, combines multiple images, then renders them to terminal output. The README also documents alternate forms, shiny and female variants, and offline embedded assets. Source excerpts establish the main calls; data files are included directly, but the sprite submodule contents were not sampled.

Main entry points: [`src/main.rs`](https://github.com/talwat/pokeget-rs/blob/main/src/main.rs) (Command entry), [`src/pokemon.rs`](https://github.com/talwat/pokeget-rs/blob/main/src/pokemon.rs) (Selection and Pokémon), [`src/lib.rs`](https://github.com/talwat/pokeget-rs/blob/main/src/lib.rs) (Embedded sprites), [`src/list.rs`](https://github.com/talwat/pokeget-rs/blob/main/src/list.rs) (Name and dex list)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input and selection"]
  node_entry["Command entry<br/>[main.rs]"]
  node_arguments["CLI arguments<br/>[cli.rs]"]
  node_dex[("Name and dex list<br/>[list.rs]")]
  node_pokemon["Selection and Pokémon<br/>[pokemon.rs]"]
end

subgraph group_assets["Sprite assets"]
  node_embedded[("Embedded sprites<br/>[lib.rs]")]
  node_sprite_files[("Sprite image files")]
end

subgraph group_render["Image rendering"]
  node_combine["Sprite combining<br/>[sprites.rs]"]
end

node_user(("CLI user"))
node_terminal(("Terminal output"))

node_user -->|"invokes"| node_entry
node_entry -->|"loads list"| node_dex
node_entry -->|"parses arguments"| node_arguments
node_entry -->|"creates Pokémon"| node_pokemon
node_pokemon -->|"resolves selection"| node_dex
node_pokemon -->|"loads sprite"| node_embedded
node_embedded -->|"embeds assets"| node_sprite_files
node_entry -->|"combines sprites"| node_combine
node_entry -->|"prints rendered output"| node_terminal

click node_entry "https://github.com/talwat/pokeget-rs/blob/main/src/main.rs"
click node_arguments "https://github.com/talwat/pokeget-rs/blob/main/src/cli.rs"
click node_dex "https://github.com/talwat/pokeget-rs/blob/main/src/list.rs"
click node_pokemon "https://github.com/talwat/pokeget-rs/blob/main/src/pokemon.rs"
click node_embedded "https://github.com/talwat/pokeget-rs/blob/main/src/lib.rs"
click node_sprite_files "https://github.com/talwat/pokeget-rs/tree/main/data/pokesprite"
click node_combine "https://github.com/talwat/pokeget-rs/blob/main/src/sprites.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_entry,node_arguments,node_dex,node_pokemon,node_user toneBlue
class node_embedded,node_sprite_files toneAmber
class node_combine toneMint
class node_terminal toneIndigo
```

## Components

### Input and selection

- [Command entry](https://github.com/talwat/pokeget-rs/blob/main/src/main.rs): `src/main.rs`
- [CLI arguments](https://github.com/talwat/pokeget-rs/blob/main/src/cli.rs): `src/cli.rs`
- [Name and dex list](https://github.com/talwat/pokeget-rs/blob/main/src/list.rs): `src/list.rs`
- [Selection and Pokémon](https://github.com/talwat/pokeget-rs/blob/main/src/pokemon.rs): `src/pokemon.rs`

### Sprite assets

- [Embedded sprites](https://github.com/talwat/pokeget-rs/blob/main/src/lib.rs): `src/lib.rs`
- [Sprite image files](https://github.com/talwat/pokeget-rs/tree/main/data/pokesprite): `data/pokesprite`

### Image rendering

- [Sprite combining](https://github.com/talwat/pokeget-rs/blob/main/src/sprites.rs): `src/sprites.rs`

### Other components

- **CLI user**
- **Terminal output**

## Connections

- CLI user → Command entry: invokes (evidence: `README.md`)
- Command entry → Name and dex list: loads list (evidence: `src/main.rs`)
- Command entry → CLI arguments: parses arguments (evidence: `src/main.rs`)
- Command entry → Selection and Pokémon: creates Pokémon (evidence: `src/main.rs`)
- Selection and Pokémon → Name and dex list: resolves selection (evidence: `src/pokemon.rs`)
- Selection and Pokémon → Embedded sprites: loads sprite (evidence: `src/pokemon.rs`)
- Embedded sprites → Sprite image files: embeds assets (evidence: `README.md`)
- Command entry → Sprite combining: combines sprites (evidence: `src/main.rs`)
- Command entry → Terminal output: prints rendered output (evidence: `src/main.rs`)
