Commands Reference
Every command the player can type, with all synonyms and how the engine parses them.
How Commands Are Parsed
The CommandParser breaks player input into three parts:
// "use key on door" becomes: { "verb": "use", // the action "target": "key", // first object "modifier": "door", // second object (after preposition) "raw": "use key on door" }
Articles (the, a, an) and prepositions (to, at, on, with, from, of) are stripped during parsing.
Movement
| Command | Synonyms | Usage |
|---|---|---|
go |
go, move, walk, travel, head | go north, walk east, n |
enter |
enter | enter cave |
leave |
leave, exit | leave, exit |
climb |
climb, scale | climb up, scale wall |
Bare directions also work as movement commands: typing north or just n is the same as go north.
Direction Shortcuts
| Full | Short | Full | Short |
|---|---|---|---|
| north | n | south | s |
| east | e | west | w |
| northeast | ne | northwest | nw |
| southeast | se | southwest | sw |
| up | u | down | d |
| in | — | out | — |
Observation
| Command | Synonyms | Usage |
|---|---|---|
look |
look, l | look — describes the current room |
examine |
examine, inspect, x, check, read | examine sword, x note, read sign |
inventory |
inventory, inv, i | i — lists items you're carrying |
Item Interaction
| Command | Synonyms | Usage |
|---|---|---|
take |
take, get, grab, pickup, pick | take sword, grab key, get potion |
drop |
drop, discard | drop sword |
use |
use, activate, employ, apply | use key, use key on door |
Containers
| Command | Synonyms | Usage |
|---|---|---|
open |
open, unlock | open chest, unlock cabinet |
close |
close, shut | close chest, shut door |
Social Interaction
| Command | Synonyms | Usage |
|---|---|---|
talk |
talk, speak, chat, ask, say | talk to wizard, ask wizard about quest, talk to rat (for creatures with talk_text) |
give |
give, offer, hand | give gem to wizard, offer sword to knight |
Combat
| Command | Synonyms | Usage |
|---|---|---|
attack |
attack, kill, hit, strike, fight | attack goblin, fight dragon |
defend |
defend, block, guard, parry | defend, block (during combat) |
flee |
flee, run, escape, retreat | flee, run (during combat) |
Other
| Command | Synonyms | Usage |
|---|---|---|
roll |
roll | roll — when prompted by a dice check |
help |
help, h, ? | help — shows available commands in-game |
restart |
restart, reset | restart — restart the game (with confirmation) |
Command Routing
Commands are routed to handlers with these priority rules:
1. Pending Roll (highest priority)
If a dice roll is pending, only the roll command is accepted. Everything else is rejected.
2. Active Combat
If in combat, only combat commands are accepted: attack, defend, flee, use, inventory, examine, look.
3. Normal Routing
Commands route to their appropriate handler based on verb.
Handler Map
| Handler | Verbs |
|---|---|
| MovementHandler | go, enter, leave, climb |
| ExamineHandler | look, examine, inventory |
| ItemHandler | take, drop, use |
| ContainerHandler | open, close |
| InteractHandler | talk, give, attack (to start combat) |
| CombatHandler | attack, defend, flee, use (during combat) |
| RollHandler | roll |
| RestartHandler | restart |