An interactive terminal RPG game that teaches you Bash console commands through combat, exploration, and adventure.
You are the Bash Warrior – destined to save the Kingdom of Terminal from creatures of chaos and confusion. Traverse five distinct regions, each guarded by monsters that test your knowledge of real Bash commands. Defeat them by answering correctly, level up your hero, and restore order to the terminal world!
- 🗡️ Turn-based combat – answer Bash command questions to attack enemies
- 📈 RPG progression – XP, levels, HP, attack/defense stats
- 🎒 Inventory system – collect potions and magical items
- 🛒 Inter-level shop – buy items between chapters, with prices scaled by current level
- 💾 Auto-save – progress saved to
~/.bash_rpg/save.datafter each chapter - 🎨 Colorful terminal UI – ANSI colors, ASCII art, status bars
- 📚 50+ Bash challenges across 5 categories
| Chapter | Region | Commands |
|---|---|---|
| 1 | Forest of Navigation | ls, pwd, cd, mkdir, rmdir |
| 2 | Cave of Files | touch, cat, cp, mv, rm, ln, file |
| 3 | Temple of Text | grep, find, head, tail, wc, sort, uniq, cut |
| 4 | River of Pipes | |, >, >>, <, 2>, tee, xargs |
| 5 | Wizard's Tower | variables, if, for, while, functions, $? |
- Bash 4.0+ (macOS users:
brew install bash) - Git – to clone the repository
- A terminal with ANSI color support (any modern terminal)
Choose the section that matches your operating system and follow the steps in order.
Most Linux distributions ship with Bash 4+ and Git pre-installed.
-
Open a terminal (e.g. GNOME Terminal, Konsole, xterm).
-
Install Git if it is not already present:
# Debian / Ubuntu / Mint sudo apt install git # Fedora / RHEL / CentOS sudo dnf install git # Arch / Manjaro sudo pacman -S git
-
Clone the repository and start the game:
git clone https://github.com/MatPomGit/bash-rpg.git cd bash-rpg bash bash_rpg.sh
macOS ships with Bash 3.2, which is too old. You need to install Bash 4+ via Homebrew.
-
Install Homebrew (skip if already installed):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" -
Install Git and Bash 4+:
brew install git bash
-
Clone the repository and start the game:
git clone https://github.com/MatPomGit/bash-rpg.git cd bash-rpg bash bash_rpg.shTip: You can also double-click
start.commandin Finder. The first time, right-click → Open to bypass the Gatekeeper warning.
Windows does not include Bash natively. Choose one of the options below.
-
Download and install Git for Windows.
During setup you can keep all default options. -
Open Git Bash (search for "Git Bash" in the Start menu).
-
Clone the repository and start the game:
git clone https://github.com/MatPomGit/bash-rpg.git cd bash-rpg bash bash_rpg.shTip: You can also double-click
start.batin Explorer. It automatically finds Git Bash and launches the game.
-
Enable WSL (run in PowerShell as Administrator):
wsl --installRestart your computer when prompted.
-
Open the WSL terminal (e.g. "Ubuntu" from the Start menu).
-
Clone the repository and start the game:
git clone https://github.com/MatPomGit/bash-rpg.git cd bash-rpg bash bash_rpg.sh
-
Download and run the Cygwin installer.
-
During package selection, add git and bash (both are in the default selection).
-
Open the Cygwin Terminal, then clone and run:
git clone https://github.com/MatPomGit/bash-rpg.git cd bash-rpg bash bash_rpg.sh
-
Download and install MSYS2.
-
Open the MSYS2 MSYS terminal and install Git:
pacman -S git
-
Clone the repository and start the game:
git clone https://github.com/MatPomGit/bash-rpg.git cd bash-rpg bash bash_rpg.sh
bash_rpg.sh ← main entry point
lib/
colors.sh ← ANSI color definitions
ui.sh ← UI helpers (headers, bars, dialogs)
player.sh ← player state management
challenges.sh ← Bash-command challenge database
combat.sh ← turn-based combat engine
save_load.sh ← save/load game state
shop.sh ← inter-level shop and dynamic pricing
levels/
level_01.sh ← Forest of Navigation
level_02.sh ← Cave of Files
level_03.sh ← Temple of Text
level_04.sh ← River of Pipes
level_05.sh ← Wizard's Tower
tests/
run_tests.sh ← test runner
test_player.sh ← player unit tests
test_combat.sh ← combat unit tests
test_challenges.sh ← challenge database tests
bash tests/run_tests.sh- Start the game and create your hero.
- In each battle, choose [1] Attack to face a Bash challenge.
- Type the correct Bash command or answer to deal damage.
- Wrong answers miss your turn – the enemy still attacks!
- Use Health Potions from your inventory to survive tough fights.
- After each chapter, visit the shop to spend gold on useful consumables.
- Shop prices scale with
CURRENT_LEVEL, so your economy stays balanced throughout the campaign. - Your progress is auto-saved – you can quit and continue later.
After completing a level, you can enter a shop before continuing.
- Items include healing, hint-restoring elixirs, temporary shields, and status-cleansing consumables.
- Prices are dynamically scaled with
CURRENT_LEVEL(higher chapters = higher prices). - Item names with spaces are fully supported in inventory and save files.
- Answers are case-insensitive –
ls,LS, andLsall work. - You can type just the command name (e.g.,
grep) or the full usage. - After each challenge, an explanation is shown – read it!
- If you die, you can restart from your last save with half HP.