Skip to main content

Asciicade

Asciicade is a polished, extensible arcade game collection for Linux terminals.

The initial release, v0.1.0, focuses on Snake and provides a unified terminal interface, persistent player profiles, local two-player matches, high scores and match history.

Features

  • Unified retro/neon terminal interface built with Textual.
  • Persistent player profiles stored in SQLite.
  • Snake single-player mode.
  • Snake competitive local two-player mode on one keyboard.
  • Persistent high scores and match history.
  • Short in-application instructions.
  • Consistent keyboard controls with normalized player input.
  • PyPI-compatible package with the asciicade command.

Terminal preview

Main menu:

+--------------------------------------------------+
|                    ASCIICADE                     |
|             A modular terminal arcade            |
|                                                  |
|  +------------------------------+                |
|  | > Play                       |                |
|  |   High Scores                |                |
|  |   Match History              |                |
|  |   Instructions               |                |
|  |   Quit                       |                |
|  +------------------------------+                |
+--------------------------------------------------+

Snake arena:

SNAKE — SINGLE-PLAYER
Guest 1: 3

+----------------------------------------------+
|                                              |
|        ██████                              |
|        ██    ██                            |
|        ██    ██            ****            |
|        ██11████                            |
|                                              |
+----------------------------------------------+

Installation

From PyPI

pip install asciicade
asciicade

pipx and uv work as well:

pipx install asciicade
# or
uv tool install asciicade

From source

Requirements: Python 3.11 or newer and uv.

git clone https://github.com/pamagister/asciicade.git
cd asciicade
uv sync --all-groups
uv run asciicade

Supported Python versions are 3.11 and newer. CI tests 3.11, 3.12, 3.13 and 3.14 on Linux.

Usage

asciicade [--data-dir PATH] [--version]
  • --data-dir PATH overrides the directory used for persistent game data.
  • --version prints the installed version.

The application starts in the main menu. Use the arrow keys and Enter to navigate, or select an entry directly.

Controls

Action Player 1 Player 2
Up Arrow Up W
Down Arrow Down S
Left Arrow Left A
Right Arrow Right D

Global controls:

Action Key
Pause / resume or go back Escape
Quit or leave the current game Q

In single-player mode, WASD is accepted as an alternative to the arrow keys. Direction changes are buffered and applied on the next game tick. Immediate 180-degree reversals are rejected.

Gameplay

Snake single-player

  • Eat food to increase your score and length.
  • The snake moves continuously on the grid.
  • Hitting a wall or your own body ends the game.
  • Your score is stored in the single-player leaderboard.

Snake two-player

  • Both players start at the same time on a shared arena.
  • Both snakes compete for the same food.
  • Hitting a wall, yourself or the other snake eliminates you.
  • The surviving snake wins.
  • If both snakes are eliminated on the same tick, the match is a draw.

Player 1 is shown in green and player 2 in cyan. Each logical arena cell is rendered as two horizontal characters, so the playfield stays visually square in terminals where characters are about twice as tall as they are wide. The head of each snake also uses a distinct two-character marker (11 or 22), so the players remain distinguishable without relying on color alone.

Player profiles and high scores

  • Player profiles are persistent and can be created from the player-selection screen.
  • A guest option is available for quick sessions without creating a profile.
  • A profile cannot occupy both player slots in a two-player match.
  • Single-player scores appear in the leaderboard.
  • Multiplayer results appear in the match history with both participants, scores and the winner or draw.
  • Guest results are stored without a permanent profile.

Application data is stored in the XDG data directory, normally:

~/.local/share/asciicade/asciicade.db

Set XDG_DATA_HOME to change the base directory.

Architecture

Asciicade separates game logic, persistence and the terminal UI.

src/asciicade/
├── cli/           Command-line entry point
├── core/          Player, game, input, session and result contracts
├── games/
│   └── snake/     UI-independent Snake engine and registration
├── persistence/   SQLite schema, migrations and repositories
└── ui/            Textual application, screens and theme

Key boundaries:

  • The core has no Textual dependency and can be tested without a terminal.
  • Games implement the Game protocol and do not execute SQL.
  • Persistence is accessed through repositories.
  • The application layer and UI do not contain game-specific rules.

Extension points

To add a game:

  1. Implement the Game protocol from asciicade.core.game.
  2. Declare a GameMetadata instance with an identifier, name, description, supported modes and instructions.
  3. Register the game in asciicade.games.build_default_registry.
  4. Add a game-specific Textual screen for rendering and input.

The registry drives the game and mode menus, so no menu changes are required. Third-party plugin discovery is intentionally not implemented yet.

Development

Requirements: Python 3.11+ and uv.

uv sync --all-groups   # install all dependency groups
make test              # Ruff, mypy, pytest and coverage
make lint              # Ruff and mypy only
make fmt               # format and apply safe lint fixes
make build             # build sdist and wheel
make validate          # build and run twine check
make precommit         # format, lint and test

Run a single test file:

uv run pytest tests/test_snake_engine.py -v

docs/index.md is the source for README.md. After editing it, run:

make syncdocs

MkDocs documentation can be built with make docs.

Release

The project version is 0.1.0. Releases are created by tagging a commit:

make release

Pushing a tag triggers the release workflow, which:

  1. Runs the full quality gate.
  2. Builds and validates the source and wheel distributions.
  3. Creates a GitHub release with the distributions.
  4. Publishes to PyPI using Trusted Publishing (OIDC).

Trusted Publishing does not require a long-lived PyPI API token. Configure a pending publisher for this repository and the release.yml workflow in the PyPI project settings.

License

Asciicade is released under the Unlicense (public domain). See LICENSE.

Metadata

Release files for asciicade 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for asciicade 0.1.0
File Size Uploaded Provenance Actions
asciicade-0.1.0.tar.gz 40.0 kB With provenance Details for asciicade-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for asciicade 0.1.0
File Interpreter ABI Platform Actions
asciicade-0.1.0-py3-none-any.whl Python 3 none any Details for asciicade-0.1.0-py3-none-any.whl

Total release size: 83.5 kB

Release files / asciicade-0.1.0.tar.gz

Download URL asciicade-0.1.0.tar.gz
Size 40.0 kB
Tags Source
SHA-256 checksum
How to use checksums
95f367dec0bc80e1852b28ef3d41b9be34fb9a676c48175c037e5ce7ac24d93d
BLAKE2b-256 checksum
How to use checksums
2da0d094784c40001e0036e27e20b34b606b48073fd5a508554a817aed64b3b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / asciicade-0.1.0-py3-none-any.whl

Download URL asciicade-0.1.0-py3-none-any.whl
Size 43.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8c5012086a34c33c02cc3e79557f130bd33bf88a3bd7594a9525f190fbce21d
BLAKE2b-256 checksum
How to use checksums
5b815eba2ad7a326885fd45ed7454e13fc55f054b0c5e845bc1dfbcf98f0d041
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for asciicade 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for asciicade-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page