Skip to content
rubiinPublic

About

command-line tool that lets you display Pokémon sprites in color directly in your terminal.

Topics

Resources

Code of conduct

Contributing

Stars

36 stars

Watchers

2 watching

Forks

Repository files navigation

pokego

CI Go Reference Release License: GPL-3.0

A fast, Go rewrite of phoney badger's pokemon-colorscripts that prints Pokémon sprites in color directly in your terminal.

pokego logo

Table of contents

Features

  • Pokémon from generations 1–8 (905 total), including shiny, mega, Gigantamax, and regional variants
  • Print random Pokémon, optionally filtered by generation or range
  • Random Pokémon have a 1/128 chance of being shiny, just like in the games
  • Print a specific Pokémon by name, with an optional alternate form

Installation

go install github.com/rubin/pokego@latest

Arch Linux

Install the stable package from the AUR:

yay -S pokego-bin

Or build manually from the AUR by downloading the PKGBUILD, then running:

makepkg -si

If you want to track the latest main branch, there is also the development package pokego-git.

NixOS / Nix

Pokego is available in nixpkgs.

System-wide, add it to environment.systemPackages:

environment.systemPackages = with pkgs; [
  pokego
];

Or per-user with home-manager, add it to home.packages:

home.packages = with pkgs; [
  pokego
];

Other platforms

Prebuilt binaries for Linux, macOS, and Windows are available on the releases page.

Download the archive for your platform, extract it, and move the executable to a directory on your PATH:

mv pokego ~/.local/bin

From source

Clone the repository and build with just:

git clone https://github.com/rubiin/pokego.git
cd pokego
just build

Or without just:

go build -trimpath -buildvcs=false -ldflags "-s -w" -o pokego .

Then move the executable to a directory on your PATH.

Note: The binary is ~26 MB because every sprite is embedded in it — no external assets are needed at runtime.

Linting

This project uses golangci-lint for static analysis.

# Run linters
just lint

# Run linters with auto-fix
just lint-fix

Usage

Run pokego --help to see all options.

display Pokémon sprites in color directly in your terminal

Usage:
  pokego [flags]
  pokego [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command

Flags:
  -f, --form string     Show alternate form of a Pokémon
  -h, --help            help for pokego
  -l, --list            List all Pokémon
  -n, --name string     Select Pokémon by name
      --no-title        Do not display Pokémon name
  -r, --random string   Show random Pokémon, optionally by generation or range
  -s, --shiny           Show shiny version
  -v, --version         Show CLI version

Use "pokego [command] --help" for more information about a command.

--list prints the base name of every Pokémon; alternate forms are not listed. Use forms with --name, e.g. pokego --name charizard --form mega-y. Valid generations for --random are 1 through 8; ranges (1-3) and comma-separated lists (1,3,6) are both supported.

Examples

Print a specific Pokémon:

pokego --name charizard

Print a shiny Pokémon:

pokego --name spheal --shiny

Print an alternate form of a Pokémon:

pokego --name blastoise --form mega

Hide the title:

pokego --name mudkip --no-title

Print a random Pokémon from generations 1-3:

pokego --random 1-3

Print a random Pokémon from generations 1, 3, and 6:

pokego --random 1,3,6

Shell completions

Tab completion for commands and flags is built in via the completion command.

Bash

source <(pokego completion bash)

To load it in every shell, add that line to ~/.bashrc, or install the script:

pokego completion bash > ~/.local/share/bash-completion/completions/pokego

Zsh

source <(pokego completion zsh)
# or install:
pokego completion zsh > "${fpath[1]}/_pokego"

Fish

pokego completion fish | source
# or install:
pokego completion fish > ~/.config/fish/completions/pokego.fish

PowerShell

pokego completion powershell | Out-String | Invoke-Expression

Shell integration

Add a Pokémon to your terminal greeting by appending one of these to your .zshrc or .bashrc:

# Random Pokémon on every new shell
pokego --random 1-8 --no-title

For fish, add it to your fish_greeting function:

function fish_greeting
    pokego --random 1-8 --no-title
end

Note: Your terminal must support Unicode and ANSI colors (virtually all modern terminals do).

Comparison

Start time is the mean of 5 consecutive runs using the time coreutil on an Acer Aspire 5, measured on 2024-10-06.

Tool Start time (s) Size (MB) Language
Pokego 0.005 27 Go
Pokeget 0.006 5 Rust
Krabby 0.016 23 Rust
Pokemonscripts 0.060 43 Python

The ~27 MB Pokego binary is dominated by the embedded sprite assets (the raw corpus is ~29 MB); go build -trimpath -buildvcs=false -ldflags "-s -w" trims it to ~26 MB.

Credits

Pokego's Pokémon sprites were sourced from PokéSprite and transformed into Unicode format using Phoney Badger's pokemon-generator-scripts.

Similar projects

License

GPL-3.0

Made with ❤️ for opensource.

About

command-line tool that lets you display Pokémon sprites in color directly in your terminal.

Topics

Resources

Code of conduct

Contributing

Stars

36 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages