A Command Line Interface (CLI) application for exploring Pokémon data, built in Go. This application allows users to interact with the Pokémon API to view and explore Pokémon, their locations, and other details directly from the terminal.
- Explore Pokémon Data: View detailed information about Pokémon.
- Inspect Pokémon Locations: Explore where Pokémon can be found.
- Catch and Cache Pokémon: Simulate catching Pokémon and store them locally.
- Command-Based Interaction: Use various CLI commands to interact with the app, such as
help,map, andexit.
main.go: The entry point for the application.commander.go: Handles CLI commands and their execution.- Commands: Individual Go files implement specific commands (e.g.,
command_map.go,command_help.go,command_exit.go). - Internal API Clients:
pokeapi: Interacts with the Pokémon API for fetching data.pokecache: Implements caching mechanisms for storing and retrieving Pokémon data locally.
internal/pokeapi:client.go: Manages API interactions.pokemon.go: Handles Pokémon-related API requests.locations_list_area.go: Retrieves Pokémon locations.
internal/pokecache:cacheMethods.go: Implements caching logic.cacheStruct.go: Defines cache structures.
go.mod: Defines module dependencies.
- Go 1.20 or higher installed on your system.
- Access to the Pokémon API (
https://pokeapi.co).
-
Clone this repository:
git clone <repository-url> cd pokedex-cli-go
-
Install dependencies:
go mod tidy
Run the CLI application with:
go run main.gohelp: Display a list of available commands and their descriptions.map: Explore location areas in the Pokémon world.inspect: View detailed information about specific Pokémon.catch: Simulate catching Pokémon.exit: Exit the application.
Run tests for the caching system:
go test ./internal/pokecacheContributions are welcome! Feel free to submit issues or pull requests to improve the project.
This project is licensed under the MIT License. See the LICENSE file for details.