#pokemon #terminal #cli #colorscripts

bin+lib pokeget

Display pokemon sprites in your terminal

14 stable releases

1.6.4 Sep 27, 2024
1.6.3 Sep 13, 2024
1.4.2 Jan 14, 2024
1.4.0 Oct 2, 2023
1.2.4 Aug 20, 2023

#713 in Command line utilities

Download history 19/week @ 2024-08-20 9/week @ 2024-08-27 10/week @ 2024-09-03 519/week @ 2024-09-10 99/week @ 2024-09-17 260/week @ 2024-09-24 123/week @ 2024-10-01 74/week @ 2024-10-08 47/week @ 2024-10-15 57/week @ 2024-10-22 29/week @ 2024-10-29 52/week @ 2024-11-05 26/week @ 2024-11-12 36/week @ 2024-11-19 16/week @ 2024-11-26 59/week @ 2024-12-03

140 downloads per month

MIT license

6.5MB
1K SLoC

Python 665 SLoC // 0.2% comments Rust 239 SLoC // 0.0% comments Shell 162 SLoC // 0.0% comments JavaScript 7 SLoC // 0.4% comments

pokeget-rs

A better rust version of pokeget.

Usage

pokeget <pokemon>

For more info, run pokeget --help.

.bashrc

If you're using pokeget on shell startup, such as in .bashrc, then instead of running pokeget <pokemon>, you can write the output to a file by doing: pokeget <pokemon> > file.txt and then have something like cat file.txt in your bashrc.

This makes your shell initialization practically instant, but obviously won't work with random pokemon. pokeget is already fairly fast, so using it on shell initialization is also not a very large bottleneck.

Examples

Using multiple pokemon

pokeget bulbasaur pikachu random

Using pokedex ID's

pokeget 1 2 3

Using alternative forms

pokeget raichu sandslash meowth --alolan

Installation

The recommended installation method is to use cargo:

cargo install pokeget

and making sure $HOME/.cargo/bin is added to $PATH.

AUR

If you're on Arch, you can also use the AUR:

yay -S pokeget

Git

You can also clone the repository and compile manually by doing:

git clone --recurse-submodules https://github.com/talwat/pokeget-rs.git
cd pokeget-rs
cargo build --release
mv target/release/pokeget ~/.local/bin

and making sure $HOME/.local/bin is added to $PATH.

Adding a directory to $PATH

Bash & Zsh

Append this to your .bashrc or .zshrc:

export PATH="<path>:$PATH"

Fish

Run this in your CLI:

fish_add_path <path>

Updating

Just rerun cargo install pokeget or git pull on the repository and then recompile.

Why?

Because the first pokeget was slow, bloated, and super complicated, so I decided to make a better version in rust.

Now, instead of precomputing all the sprites and uploading them to a repo, pokeget will be able to compute them on-demand which makes everything much more flexible. Rust enables that computation to be done much more quickly than something like python.

It will also draw the sprites 2x smaller by using half squares.

What about other projects?

pokeget-rs has an edge over projects like the old pokeget, pokeshell, etc... since it's in rust.

It also is significantly (5.5x) faster than krabby which is another very similar project.

For more info, go to OTHER_PROJECTS.md.

What about big sprites?

Gone. Reduced to atoms.

In all seriousness, I've just decided to not deal with them since it's significantly extra work that I don't want to deal with. They were rarely used, and looked ugly in small terminal windows, so there was little use in keeping them.

Credits

This time, the sprites are from pokesprite and pokeget uses them with a git submodule.

Sprites are embedded into the binary, so pokeget won't download them. This is a good compromise, since while the binary may be large, pokeget can execute almost instantly and while offline.

License

pokeget uses the MIT license, so feel free to fork it and customize it as you please. If you're unsure about any of the internal workings of pokeget, open an issue, and I'll answer whatever question you might have.

Dependencies

~9–16MB
~166K SLoC