- 🎲 Random Pokemon with 1/128 shiny chance
- ✨ Shiny variant support
- 🚀 Sprites embedded in binary (works offline)
- 📦 Single self-contained executable
- ⚡ Optimized for shell startup scripts
| Command | Mean [µs] | Min [µs] | Max [µs] | Relative |
|---|---|---|---|---|
zigdex random |
630.4 ± 130.2 | 407.6 | 1993.0 | 1.00 |
pokeget random |
1203.0 ± 387.7 | 889.1 | 10657.3 | 1.91 ± 0.73 |
krabby random |
3632.3 ± 284.5 | 3182.5 | 5362.4 | 5.76 ± 1.27 |
zigdex ▓░░░░░░░░░ 0.63ms ← 5.8x faster than krabby
pokeget ▓▓░░░░░░░░ 1.20ms
krabby ▓▓▓▓▓▓▓▓░░ 3.63ms
Benchmarked with hyperfine --warmup 3
brew tap Decryptu/tap
brew install zigdexNote: While zigdex is being reviewed for inclusion in Homebrew core, you can install it from my personal tap.
Download the appropriate binary for your architecture from the releases page and add it to your PATH.
zig buildThis will:
- Generate embedded sprites from your
assets/directory at compile time - Create a single executable at
zig-out/bin/zigdex - Embed all 1010+ Pokemon sprites directly into the binary
# Random Pokemon (1/128 chance for shiny)
zigdex random
zigdex --random
# Specific Pokemon by name
zigdex pikachu
zigdex bulbasaur charmander squirtle
# By Pokedex number
zigdex 25
zigdex 1 4 7
# Force shiny variant
zigdex pikachu --shiny
zigdex random --shiny
# Hide Pokemon name
zigdex pikachu --hide-name
zigdex random --hide-nameAdd to your .zshrc or .bashrc:
# Show random Pokemon on terminal start
zigdex --random --hide-name
# Or with fastfetch
alias fastfetch='zigdex --random --hide-name | command fastfetch --logo-type file-raw --logo -'zigdex/
├── src/
│ ├── main.zig # Entry point and CLI
│ ├── args.zig # Argument parser
│ └── sprites.zig # Pokemon lookup and display
├── tools/
│ └── generate_sprites.zig # Build-time sprite embedder
├── assets/
│ ├── pokemon.json
│ └── colorscripts/
│ ├── regular/ # Normal sprites
│ └── shiny/ # Shiny variants
└── build.zig
- Sprites are converted to byte arrays at compile time
- The
generate_sprites.zigtool runs during build - Creates
embedded_sprites.zigwith all Pokemon data - No runtime filesystem dependencies
- Binary size: ~50-100MB (fully self-contained)
- Uses
std.Random.DefaultPrngwith nanosecond seed - 1/128 chance for shiny (mimicking main series games)
- O(1) lookup by index
- Zero filesystem I/O at runtime
Supports multiple lookup methods:
- Case-insensitive name matching (
pikachu,PIKACHU) - Slug matching (
charizard-mega-x) - Pokedex number (
25,150)
- Uses
GeneralPurposeAllocatorfor safety - Proper
deferpatterns for cleanup - No memory leaks in debug builds
- Efficient argument parsing
| Option | Short | Description |
|---|---|---|
--random |
-r |
Display random Pokemon (1/128 shiny) |
--shiny |
-s |
Force shiny variant |
--hide-name |
Don't print Pokemon name | |
--help |
-h |
Show help message |
- Zig 0.15.2 or later
- Terminal with ANSI color support
- Pokemon sprite assets in
assets/directory
MIT

