Skip to main content

A terminal Tetris game with persistent highscores (curses + SQLite)

Project description

termtris

Terminal Tetris (termtris) — a CLI Tetris-like game with persistent highscores.

Gameplay snapshot

Installation

Recommended (for most users): pipx — isolated global CLI install

  • Install pipx (if you don't have it):
    • macOS (Homebrew): brew install pipx and then pipx ensurepath
  • 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

  1. python3 -m venv .venv
  2. source .venv/bin/activate
  3. python3 -m pip install --upgrade pip
  4. python3 -m pip install termtris

Windows

  1. python -m venv .venv
  2. .venv\Scripts\activate
  3. python -m pip install --upgrade pip
  4. python -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):

  1. Use pipx (best for CLI tools) — shown above.
  2. Use a virtual environment — shown above.
  3. 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 game
  • termtris scores → Show top scores
  • termtris 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 .venv folder
  • If installed with pip globally (not recommended): python3 -m pip uninstall termtris

Testing / Development

To install the package locally for development:

  1. git clone https://github.com/shay-ff/termtris.git
  2. cd termtris
  3. python3 -m venv .venv
  4. source .venv/bin/activate
  5. python -m pip install -e .
  6. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tetriskekw-0.11.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tetriskekw-0.11.0-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

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

Hashes for tetriskekw-0.11.0.tar.gz
Algorithm Hash digest
SHA256 cc84a59348894193726d977ad256bbcb07fe3307be8082213a86f1b618e664a2
MD5 d7255148cee343be2e8fb58ac2760aef
BLAKE2b-256 174e6bbbc9f8ed38d6d558b069335cb01bc3183470d9f68884584b9386afb640

See more details on using hashes here.

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

Hashes for tetriskekw-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 434f667773e286000ad93a37e01f6121757d504f5ec92499c7ff9d5a260f15ff
MD5 21820cc74d9614a7c34ee8000aeaee37
BLAKE2b-256 d8047eaefdb3488f8bc2cd5f2b350e7027de3995aa374f4e54b95c2c40be528d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page