Skip to main content

Collection of terminal CLI games

Project description

CLI Games

Collection of small terminal games bundled with a single CLI launcher.

Requirements

  • Python 3.8+
  • On Windows: install windows-curses for curses support:
pip install windows-curses

Quick start (developer)

# install editable (recommended during development)
pip install -e .

# list installed console aliases and available games
clig list

# run interactive menu
clig

# run a game by zero-based index or name
clig run 0
clig run "Byte Bouncer"

# reset highscores for one game or all
clig reset 0
clig reset "Byte Bouncer"
clig reset -y  # skip confirmation

If the clig command is not found after installation, the installer likely wrote scripts to your user Scripts directory. On Windows add this to your PATH (PowerShell):

$env:Path += ";$env:APPDATA\Python\Python<version>\Scripts"
# or permanently via System settings: add %APPDATA%\Python\Python<version>\Scripts to your user PATH

You can always run the CLI directly without installing:

python -m cli

Commands

  • clig — interactive curses menu
  • clig list — print available games and zero-based indices
  • clig run <index|name> — run a game directly (index is zero-based)
  • clig reset [<index|name>] [-y] — delete highscores for a game or all games
  • Aliases available: cli-games, cli-game

Highscores storage and migration

  • Highscores are now stored in a user-writable application data directory. Typical locations:
    • Windows (appdirs): %LOCALAPPDATA%\cli-games\games\<game>\highscores.json
    • Fallback (no appdirs): %USERPROFILE%\.cli-games\games\<game>\highscores.json
  • On first run the CLI attempts to migrate any legacy games/<game>/highscores.json found in the project into the user data directory.

Packaging & publishing (brief)

  • setup.cfg now declares packages = find: and include_package_data = true so game_classes/ and games/ are included in sdist/wheels. Remember to add a MANIFEST.in if you need additional files in source distributions.
  • Update setup.cfg version.
  • Build: python -m build (requires build package).
  • Upload: twine upload dist/* (requires twine).
  • The package exposes several console script aliases (see setup.cfg -> options.entry_points.console_scripts).

Notes & Troubleshooting

  • On Windows, curses requires windows-curses.
  • The CLI requires a minimum terminal size; if the menu exits with an error, try enlarging your terminal or run python -m cli in a larger window.
  • Games should live in their own subdirectory (games/<slug>/game.py) and export a main(stdscr) entry point. The CLI uses the directory name (slug) as the display title.

Terminal recommendations (Windows)

  • Recommended: use Windows Terminal or the VS Code integrated terminal for the best UTF-8 + glyph support.
    • Install Windows Terminal via Microsoft Store or winget:
winget install --id Microsoft.WindowsTerminal -e
  • PowerShell (external) often uses OEM code page 437 and may not render some Unicode glyphs. If you prefer the external shell to render glyphs, either use Windows Terminal or make these changes:
    • Change the console font to a glyph-capable font (Cascadia Code PL, Fira Code, DejaVu Sans Mono, or modern Consolas) via the console Properties → Font.
    • Ensure UTF-8 is enabled for the session (temporary):
chcp 65001
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$env:PYTHONIOENCODING = 'utf-8'
- To make the change persistent, add the above lines to your PowerShell profile (see `code $profile`), or prefer PowerShell Core (`pwsh`) which typically handles UTF-8 better.
  • If you cannot enable UTF-8 in your external terminal, the CLI will automatically fall back to safe ASCII glyphs for problematic terminals. To force ASCII output regardless of terminal detection, set the environment variable CLI_GAMES_FORCE_ASCII=1 before running the CLI.

  • Advanced: enable system-wide UTF-8 (Region → Administrative → Change system locale → check “Beta: Use Unicode UTF-8 for worldwide language support”) and restart. This affects other apps and requires caution.

Contributing

  • Add a new game by creating a subdirectory under games/ with a game.py file that exports main(stdscr).
  • Keep changes minimal and run clig locally to verify.

License

  • MIT

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

cli_arcade-2026.0.0.tar.gz (106.5 kB view details)

Uploaded Source

Built Distribution

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

cli_arcade-2026.0.0-py3-none-any.whl (123.8 kB view details)

Uploaded Python 3

File details

Details for the file cli_arcade-2026.0.0.tar.gz.

File metadata

  • Download URL: cli_arcade-2026.0.0.tar.gz
  • Upload date:
  • Size: 106.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for cli_arcade-2026.0.0.tar.gz
Algorithm Hash digest
SHA256 598fa0c87fc200f76ffc4cc44279552884756760acfcea0ba6d1f48a6d651c19
MD5 b37a8505a7f55727c55111239c5cae9a
BLAKE2b-256 5e470dbe29403c6e74375670c8cb9ddf5ed4a6bbadb994c3957f7d4c80803df2

See more details on using hashes here.

File details

Details for the file cli_arcade-2026.0.0-py3-none-any.whl.

File metadata

  • Download URL: cli_arcade-2026.0.0-py3-none-any.whl
  • Upload date:
  • Size: 123.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for cli_arcade-2026.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb84bfa085e644a1474897734b326b62cc472ee1f7da96e1b81fc413af20de75
MD5 9eb90e3f258a10a2cd7bb8107d393c7c
BLAKE2b-256 391668e9b839fe89a421b89b9c6cf92068251d4e6d11932f22050a0ffa9ec11b

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