Skip to content

digitalghost-dev/poke-cli

Repository files navigation

pokemon-logo

Pokémon CLI

version-label docker-image-size ci-status-badge
tests-label go-version codecov

Overview

poke-cli is a hybrid of a classic CLI and a modern TUI tool for viewing data about Pokémon! This is my first Go project. View the documentation!

The architecture behind how the tool works is straight forward:

  1. Each command indicates which API endpoint to use.
  2. Flags provide more information and can be stacked together or used individually.
  3. Each command has a -h | --help flag that is built-in with Golang's flag package.

View future plans in the Roadmap section.


Demo

demo


Installation

Binary

  1. Head to the releases page of the project.
  2. Choose a version to download. The latest is best.
  3. Choose an operating system and click on the matching zipped folder to start the download.
  4. Extract the folder. The tool is ready to use.
  5. Either change directories into the extracted folder or move the binary to a chosen directory.
  6. Run the tool!

Important

For macOS, you may have to allow the executable to run as it is not signed. Head to System Settings > Privacy & Security > scroll down and allow executable to run.

View Image of Settings

settings

Example usage

# Windows
.\poke-cli.exe pokemon charizard --types --abilities
 
# Unix
.\poke-cli ability airlock --pokemon

Docker Image

  1. Install Docker Desktop.
  2. Once installed, use the command below to pull the image and run the container!
    • --rm: Automatically remove the container when it exits.
      • Optional.
    • -i: Interactive mode, keeps STDIN open for input.
      • Necessary.
    • -t: Allocates a terminal (TTY) for a terminal-like session.
      • Necessary.
  3. Choose how to interact with the container:
    • Run a single command and exit:
    docker run --rm -it digitalghostdev/poke-cli:v1.4.0 <command> [subcommand] flag]
    • Enter the container and use its shell:
    docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.4.0 -c "cd /app && exec sh"
    # placed into the /app directory, run the program with './poke-cli'
    # example: ./poke-cli ability swift-swim

Homebrew

  1. Install the Cask:
    brew install --cask digitalghost-dev/tap/poke-cli
  2. Verify install!
    poke-cli -v

Source

  1. Run the following command:
    go install github.com/digitalghost-dev/poke-cli@latest
  2. The tool is ready to use!

Usage

By running poke-cli [-h | --help], it'll display information on how to use the tool.

╭──────────────────────────────────────────────────────────╮
│Welcome! This tool displays data related to Pokémon!      │
│                                                          │
│ USAGE:                                                   │
│    poke-cli [flag]                                       │
│    poke-cli <command> [flag]                             │
│    poke-cli <command> <subcommand> [flag]                │
│                                                          │
│ FLAGS:                                                   │
│    -h, --help      Shows the help menu                   │
│    -l, --latest    Prints the latest version available   │
│    -v, --version   Prints the current version            │
│                                                          │
│ COMMANDS:                                                │
│    ability         Get details about an ability          │
│    item            Get details about an item             │
│    move            Get details about a move              │
│    natures         Get details about all natures         │
│    pokemon         Get details about a Pokémon           │
│    search          Search for a resource                 │
│    types           Get details about a typing            │
│                                                          │
│ hint: when calling a resource with a space, use a hyphen │
│ example: poke-cli ability strong-jaw                     │
│ example: poke-cli pokemon flutter-mane                   │
│                                                          │
│ ↓ ctrl/cmd + click for docs/guides                       │
│ docs.poke-cli.com                                        │
╰──────────────────────────────────────────────────────────╯

Roadmap

Below is a list of the planned/completed commands and flags:

  • ability: get data about an ability.
    • -p | --pokemon: display Pokémon that learn this ability.
  • berry: get data about a berry.
  • item: get data about an item.
  • move: get data about a move.
    • -p | --pokemon: display Pokémon that learn this move.
  • natures: get data about natures.
  • pokemon: get data about a Pokémon.
    • -a | --abilities: display the Pokémon's abilities.
    • -i | --image: display a pixel image of the Pokémon.
    • -s | --stats: display the Pokémon's base stats.
    • -t | --types: display the Pokémon's typing.
    • -m | --moves: display learnable moves.
  • search: search for a resource
    • ability
    • berry
    • item
    • move
    • pokemon
  • speed: compare speed stats between two Pokémon.
  • types: get data about a specific typing.

Tested Terminals

OS Terminal Status Issues
macOS Ghostty None
macOS Alacritty None
macOS HyperJS None
macOS iTerm2 None
macOS macOS Terminal ⚠️ Images do not render properly
Windows Windows Terminal None
Ubuntu Standard Terminal None
Ubuntu Tabby None

About

A hybrid CLI/TUI tool written in Go for viewing Pokémon data from the terminal!

Topics

Resources

License

Stars

Watchers

Forks