Decryptu/zigdex
A fast, lightweight Pokemon sprite viewer for your terminal written in Zig.
| 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 zigdex
Note: 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 build
This will:
assets/ directory at compile timezig-out/bin/zigdex# 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-name
Add 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 -'
Note: fastfetch is a fast system information tool similar to neofetch.
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
generate_sprites.zig tool runs during buildembedded_sprites.zig with all Pokemon datastd.Random.DefaultPrng with nanosecond seedSupports multiple lookup methods:
pikachu, PIKACHU)charizard-mega-x)25, 150)GeneralPurposeAllocator for safetydefer patterns for cleanup| 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 |
assets/ directoryFor the best experience, we recommend using:
Both terminals provide excellent ANSI color support and render Pokemon sprites beautifully.
MIT