A command-line interface for exploring the world of Pokemon. This interactive CLI allows you to navigate through locations, encounter Pokemon, attempt to catch them, and build your personal Pokedex.
- Location Exploration: Browse through different areas in the Pokemon world
- Pokemon Encounters: Discover which Pokemon can be found in specific locations
- Catching Mechanism: Attempt to catch Pokemon with experience-based catch rates
- Pokedex Management: Keep track of your caught Pokemon and inspect their details
- Interactive REPL: User-friendly command-line interface with helpful commands
- Go 1.25.5 or later
git clone https://github.com/xonoxc/pokedex.git
cd pokedex
go build -o pokedexcli .Run the application:
./pokedexcli| Command | Description | Usage |
|---|---|---|
help |
Displays available commands and usage information | help |
exit |
Exits the CLI application | exit |
map |
Browse through Pokemon locations | map front or map back |
explore |
Explore a specific location for Pokemon encounters | explore <location-name> |
catch |
Attempt to catch a Pokemon | catch <pokemon-name> |
inspect |
View detailed information about a Pokemon | inspect <pokemon-name> |
pokedex |
Display all Pokemon you've caught | pokedex |
pokedex> map front
- pallet-town
- viridian-city
- pewter-city
pokedex> explore pallet-town
Exploring location.... pallet-town
Encounters found:
-pikachu
-rattata
-pidgey
pokedex> catch pikachu
Throwing a pokeball at pikachu...Catch chance: 65%
pikachu was caught!
pokedex> inspect pikachu
Name: pikachu
Height: 4
Weight: 60
Stats:
- hp: 35
- attack: 55
- defense: 40
Types:
- electric
pokedex> pokedex
Your Pokedex
-pikachu
The catch success rate is calculated based on the Pokemon's base experience:
- Base rate of 70% with difficulty scaling
- Higher experience Pokemon are harder to catch
- Minimum catch rate of 5% ensures no Pokemon is impossible to catch
This application uses the PokeAPI (pokeapi.co) to fetch:
- Location data and navigation
- Pokemon encounter information
- Detailed Pokemon statistics
go test ./...pokedexcli/
├── main.go # Application entry point and REPL
├── commands/ # CLI command implementations
├── internal/
│ ├── http_client/ # API client for PokeAPI
│ └── pokecache/ # Caching layer for API responses
└── repl/ # REPL utilities and input handling
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- PokeAPI for providing the Pokemon data API
- The Go community for excellent tooling and libraries