PokeStats

April 15, 2026 · View on GitHub

PokeStats

Pokemon stats fetch for the terminal.

demo

FeaturesInstallUsageTermuxHow it worksLicense


Features

  • Random or by namepokestats for a random Pokemon, pokestats pikachu for a specific one
  • Color-coded stat bars — each stat gets its own color (red HP, orange ATK, blue SpAtk, etc.)
  • Pokemon type badges — shows type(s) on a dedicated line with colored icon badges (e.g. [✿ Grass] [☠ Poison])
  • Pokedex ID — zero-padded ID next to the name (#025, #006)
  • Unicode icons — works without Nerd Fonts or special icon packs
  • Variant fallback — if urshifu-single-strike has no sprite, falls back to urshifu
  • Graceful retries — random mode retries up to 5 times if a sprite is unavailable
  • Color auto-detection — disables colors when piped or the terminal doesn't support them
  • Termux / mobile layout — auto-detects Termux and switches to a stacked, compact layout
  • Side-by-side centering — sprite and info panel are vertically centered on desktop

Installation

Quick install

git clone https://github.com/mdatz/pokestats.git
cd pokestats
./install.sh

The installer detects your package manager, checks for missing dependencies, and installs everything to ~/.local/bin/pokestats. Pass --yes to skip confirmation prompts.

Dependencies

DependencyWhyInstall
bash 4.0+Shell (arrays, arithmetic, etc.)Pre-installed on most systems
curlHTTP requests to PokeAPIsudo apt install curl / brew install curl
jqJSON parsingsudo apt install jq / brew install jq
perlStripping ANSI escape codesUsually pre-installed; pkg install perl on Termux
pokegetRenders Pokemon spritesSee below

pokeget is the only one you're likely to need to install manually:

Installing pokeget

pokeget renders the colored Pokemon sprites in your terminal. It's a Rust binary — fastest install is via cargo:

cargo install pokeget

No Rust? Download a pre-built binary from github.com/riffl/pokeget/releases and put it somewhere in your $PATH.

Manual install

If you'd rather skip the installer:

cp script.sh ~/.local/bin/pokestats
chmod +x ~/.local/bin/pokestats

Make sure ~/.local/bin is in your $PATH:

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Usage

pokestats                  # random Pokemon (Gen 1-8)
pokestats pikachu          # by name
pokestats 25               # by Pokedex ID
pokestats --termux         # force stacked mobile layout
pokestats --color-test     # preview stat bar colors
pokestats --version        # print version
pokestats --help           # show usage

Examples

# Morning routine: who's your random Pokemon today?
pokestats

# Look up your favorite
pokestats gengar

# By Pokedex number
pokestats 150

# Pipe-friendly (no colors, no ANSI)
pokestats snorlax | cat

# Preview stat bar colors
pokestats --color-test

Termux

Pokestats automatically detects Termux and switches to a stacked layout optimized for narrow screens:

The sprite is centered on screen, stats are displayed in a compact 2-column grid, and bars are shortened to fit mobile viewports. Detection is automatic via $PREFIX or $TERMUX_VERSION — or force it on desktop with --termux.

Install on Termux

pkg install curl jq perl rust
cargo install pokeget
git clone https://github.com/mdatz/pokestats.git
cd pokestats
./install.sh

How it works

  1. Picks a random Gen 1-8 Pokemon (ID 1-905) or resolves your input
  2. Fetches data from PokeAPI — stats, abilities, types, ID
  3. Renders the sprite via pokeget with ANSI colors
  4. Displays sprite + info panel side-by-side (desktop) or stacked (Termux)

Fallback chain

If a Pokemon has a variant name like urshifu-single-strike and pokeget doesn't have that specific sprite, pokestats tries the base form (urshifu) automatically. In random mode, if both the exact and base names fail, it picks a new random Pokemon and retries (up to 5 times).

Gen limitations

Random Pokemon are limited to IDs 1-905 (Gen 1-8) because pokeget doesn't have Gen 9 sprites yet. You can still look up Gen 9 Pokemon by name — PokeAPI will return their data, but the sprite will fall back or fail gracefully.

Customization

Edit the config block at the top of script.sh:

VariableDefaultWhat it does
SPRITE_WIDTH38Horizontal space reserved for the sprite column
PADDING_H1Extra vertical nudge for centering
PADDING_W0Extra horizontal padding
BAR_WIDTH12Stat bar length in characters
MAX_RETRIES5Max random retries before giving up

License

MIT — see LICENSE.