A terminal Tetris game with persistent highscores (curses + SQLite)
Project description
termtris
Terminal Tetris (termtris) — a CLI Tetris-like game with persistent highscores.
Installation
Recommended (for most users): pipx — isolated global CLI install
- Install pipx (if you don't have it):
- macOS (Homebrew):
brew install pipxand thenpipx ensurepath
- macOS (Homebrew):
- Install termtris from PyPI:
pipx install termtris
Install from TestPyPI (for testing a pre-release on TestPyPI):
pipx install --pip-args="--index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple" termtris
Alternative: Install into a Virtual Environment (recommended for developers)
macOS / Linux
python3 -m venv .venvsource .venv/bin/activatepython3 -m pip install --upgrade pippython3 -m pip install termtris
Windows
python -m venv .venv.venv\Scripts\activatepython -m pip install --upgrade pippython -m pip install termtris
Install directly from TestPyPI (for testing)
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple termtris
If you see externally-managed-environment (PEP 668)
Some system Python installations (e.g., Homebrew on macOS, certain Linux distros) prevent pip from installing packages into the system site-packages.
If you hit an error like:
error: externally-managed-environment
Recommended fixes (in order):
- Use pipx (best for CLI tools) — shown above.
- Use a virtual environment — shown above.
- Only if you understand the risk: use
--break-system-packages(not recommended):
python3 -m pip install termtris --break-system-packages
Quick start / Usage
After installing, run:
- Start the game:
termtris - Or run via module:
python -m termtris play
CLI commands
termtris→ Start the gametermtris scores→ Show top scorestermtris reset→ Reset highscores
Controls
| Key | Action |
|---|---|
| A / D | Move left/right |
| Left/Right | Move left/right |
| Down | Soft drop |
| Q / E | Rotate left/right |
| Space | Hard drop |
| P | Pause |
| X | Quit |
| C | Toggle Colors |
Ghost Piece: The game shows a boundary-style preview (ghost piece) of where the current piece will land, helping you plan your moves. The ghost piece updates automatically when you move or rotate the current piece.
Arrow keys are supported in addition to A/D.
Colors require a color-capable terminal (xterm-256color, Windows terminal with proper support, etc).
Configuration & Data
High scores are stored in the user config directory:
~/.config/termtris/termtris.db
Uninstall
- If installed with pipx:
pipx uninstall termtris - If installed in a virtualenv: deactivate and remove the
.venvfolder - If installed with pip globally (not recommended):
python3 -m pip uninstall termtris
Testing / Development
To install the package locally for development:
git clone https://github.com/shay-ff/termtris.gitcd termtrispython3 -m venv .venvsource .venv/bin/activatepython -m pip install -e .python -m termtris play
Notes
- If you published a test release on TestPyPI, the project page is available at:
https://test.pypi.org/project/termtris/ - For a frictionless install experience for end-users, pipx is the recommended distribution method for CLI apps.
Have fun!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tetriskekw-0.11.0.tar.gz.
File metadata
- Download URL: tetriskekw-0.11.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc84a59348894193726d977ad256bbcb07fe3307be8082213a86f1b618e664a2
|
|
| MD5 |
d7255148cee343be2e8fb58ac2760aef
|
|
| BLAKE2b-256 |
174e6bbbc9f8ed38d6d558b069335cb01bc3183470d9f68884584b9386afb640
|
File details
Details for the file tetriskekw-0.11.0-py3-none-any.whl.
File metadata
- Download URL: tetriskekw-0.11.0-py3-none-any.whl
- Upload date:
- Size: 11.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
434f667773e286000ad93a37e01f6121757d504f5ec92499c7ff9d5a260f15ff
|
|
| MD5 |
21820cc74d9614a7c34ee8000aeaee37
|
|
| BLAKE2b-256 |
d8047eaefdb3488f8bc2cd5f2b350e7027de3995aa374f4e54b95c2c40be528d
|