A command-line Pokedex built with TypeScript and Node.js. It uses the PokeAPI to explore location areas, inspect Pokemon, and catch them from an interactive REPL.
- Interactive REPL
- Paginated location browsing
- Location exploration
- Pokemon catching
- In-memory Pokedex for the current session
- Basic test coverage with Vitest
- TypeScript
- Node.js 22
- Vitest
- PokeAPI
- Node.js
22.15.0 - npm
If you use nvm:
nvm usenpm installBuild:
npm run buildStart:
npm startBuild and run in one step:
npm run devnpm testhelp- list commandsmap- show the next page of location areasmapb- show the previous page of location areasexplore <location-area>- list Pokemon in a location areacatch <pokemon>- attempt to catch a Pokemoninspect <pokemon>- inspect a caught Pokemonpokedex- list caught Pokemonexit- quit the REPL
> help
> map
> explore canalave-city-area
> catch pikachu
> inspect pikachu
> pokedex
src/
main.ts
repl.ts
state.ts
command.ts
command_*.ts
pokeapi.ts
pokecache.ts
tests/
The current version is a single-session CLI. Caught Pokemon are kept in memory and are lost when the process exits.
The best way to extend this project is to turn it into a terminal-based party and battle game instead of just a catch-and-inspect demo.
That path should focus on two things:
- party management
- multiplayer-friendly terminal play
It keeps the project true to the REPL format while adding real game systems:
- a team-building loop instead of a flat collection list
- meaningful command design
- battle state and turn resolution
- richer testing around game rules
- a better reason for people to actually use the CLI
Add a real party system on top of the current Pokedex:
party add <pokemon>party remove <pokemon>party listparty lead <pokemon>
Rules:
- max 6 Pokemon in party
- only caught Pokemon can be added
- one active lead Pokemon at a time
Expand caught Pokemon into trainer-owned Pokemon instances:
- nickname support
- level
- HP
- move set
- status effects
This is the point where Pokemon from the API should stop being the full runtime model. You will want a separate domain model for owned Pokemon.
Add battle flows that work naturally in a terminal:
battle wildbattle attack <move>battle switch <pokemon>battle run
Keep the output text-first and easy to follow. The REPL format is an advantage here, not a limitation.
If you want this to feel more substantial, make battles playable with friends over a shared terminal session or a lightweight host/join model.
Good options:
- shared local session through one REPL
- host/join over TCP for two terminal clients
- spectator-friendly battle logs
The clean version of this is: one player hosts a battle session, another joins, both manage their own parties, and the game resolves turns server-side.
Build party management before multiplayer.
That gives you a clean sequence:
- refactor the current Pokedex into trainer-owned Pokemon
- add
partycommands and party validation - build single-player wild battles
- add two-player terminal battles
If you skip straight to multiplayer, the data model will stay weak and the command layer will get messy fast.
- move game logic out of command handlers
- create a
Trainermodel and a party service - separate API data from runtime battle data
- add tests for catch rules, party rules, and battle turns
- persist trainer and party state to disk once the model stabilizes
ISC