Skip to content

Latest commit

 

History

28 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-pokedexcli

An interactive Pokedex CLI written in Go. It talks to the public PokeAPI to explore Pokemon location areas, catch Pokemon, and inspect the ones you've caught.

Requirements

  • Go 1.25 or later installed on your machine.

That's it. The program has no other dependencies and exposes no configuration options. Caught Pokemon are kept in memory only, so they reset each time you run the program.

Installation

Install the CLI with go install:

go install github.com/geneowak/go-pokedexcli@latest

This builds the binary and places it in your Go bin directory ($GOPATH/bin or $GOBIN). If the go-pokedexcli command isn't found after installing, make sure that directory is on your PATH:

export PATH="$PATH:$(go env GOPATH)/bin"

You can also build and run from the source directly with go run ..

Usage

Start the Pokedex REPL:

go-pokedexcli

You'll be greeted with a Pokedex > prompt. Type a command and press Enter. Available commands:

Command Description
help Displays a help message
map Displays the names of 20 location areas in the Pokemon world
mapb Displays the names of the previous 20 location areas in the Pokemon world
explore <location> Lists all the Pokemon in the specified location
catch <pokemon> Attempts to catch the specified Pokemon and add it to your Pokedex
inspect <pokemon> See details about a Pokemon that you have caught
pokedex See all the names of the caught Pokemon
exit Exit the Pokedex

Example session:

Pokedex > explore canalave-city-area
Exploring canalave-city-area...
Found Pokemon:
- tentacool
- tentacruel

Pokedex > catch tentacool
Throwing a Pokeball at tentacool...
tentacool was caught!

Pokedex > inspect tentacool
Name: tentacool
Height: 9
Weight: 455
Stats:
  - hp: 40
  - attack: 40
Types:
  - water
  - poison

Pokedex > pokedex
- tentacool

Pokedex > exit

Data fetched from the PokeAPI is cached in memory for 5 minutes to reduce repeated network calls.

About

An interactive Pokedex CLI written in Go

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages