Skip to main content

Terminal-first LeetCode practice app powered by Textual

Project description

LeetUI (macOS-first Terminal LeetCode TUI)

A terminal-only LeetCode-style practice app built with Textual + Rich.

Install

pip install leetui-terminal

or

pip3 install leetui-terminal

Then run:

leetui

That's it. No virtual environment needed.

Requires: macOS (Terminal.app or iTerm2) with Python 3.10+

If you don't have Python: brew install python

Run from source (for contributors)

git clone https://github.com/siddartha018/leetcodecli.git
cd leetcodecli
pip install -e .
leetui

Keyboard shortcuts (keyboard-only flow)

  • / : Move selection / scroll content
  • / : Move across filters on problem browser
  • Enter: Confirm current step (onboarding, sheet, problem, open editor)
  • Esc: Back one level
  • s: Open Solutions page from question view
  • F6 / Option+E (Alt+E): Toggle question <-> editor
  • Option+R / Option+T / Option+D: Run current / run all / save
  • Ctrl+R / Ctrl+T / Ctrl+D: Compatibility fallback
  • PageUp / PageDown: Fast scroll in question/solutions
  • q: Quit app

Language support

  • Current build is Python-only for writing and running code.
  • Onboarding asks you to continue with Python before sheet selection.

Search and filters

Start screen includes:

  • Free text search (title/tags/patterns/companies)
  • Company filter
  • Pattern filter
  • Difficulty filter (easy, medium, hard)
  • Source filter (leetcode, cses, web, local)

Sheets support

Included sheet catalog:

  • NeetCode 150
  • Striver DSA Sheet
  • TLE Eliminators CP Sheet
  • CSES Problem Set

The app shows local coverage as (<local>/<total>) per sheet.

To make these filters useful, include metadata in problem JSON:

{
  "source": "leetcode",
  "companies": ["amazon", "google"],
  "patterns": ["two-pointers", "hashmap"]
}

Adding questions from web / LeetCode

LeetUI reads local JSON files in leetui/problems/. To include web/LeetCode questions, export or curate them into this JSON format and set:

  • "source": "leetcode" (or "web")
  • "source_url": "<original problem URL>"
  • "companies": [...]
  • "patterns": [...]

This keeps the app terminal-only and fast while still supporting web-curated problem sets.

You can also import a JSON catalog directly:

leetui-import /path/to/catalog.json
# or
leetui-import https://example.com/leetui-catalog.json

Share with friends

Tell them to run:

pip install leetui-terminal
leetui

Or using pipx (isolated install):

brew install pipx
pipx ensurepath
pipx install leetui-terminal
leetui

Solutions page

Each problem has a read-only solutions page with:

  • Brute Force explanation + Python code
  • Better explanation + Python code
  • Optimal explanation + Python code

Project layout

leetui/
├── app.py
├── ui/
│   ├── layout.py
│   └── bindings.py
├── problems/
│   └── two_sum.json
├── workspace/
│   └── solution.py
├── runner/
│   └── executor.py
├── models/
│   └── problem.py
├── storage/
│   └── progress.db (auto-created on first run)
└── utils/
    └── markdown.py

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

leetui_terminal-0.1.1.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

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

leetui_terminal-0.1.1-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file leetui_terminal-0.1.1.tar.gz.

File metadata

  • Download URL: leetui_terminal-0.1.1.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for leetui_terminal-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0582b58b107375a01b7be9e73f246638889263b69ed2e09124856a3f68d25afe
MD5 942fb23e280997d0c1f4b6ed57d5a0a2
BLAKE2b-256 2f7992883cd4cdfe9f6e19a3222bf918c95d5126140fa15b996309549d7e90a0

See more details on using hashes here.

File details

Details for the file leetui_terminal-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for leetui_terminal-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a2e9a9b3991afc9b15c7dc7e5bd9034c56ccb2a1dea529adb720b042695b6262
MD5 33c7a511ca3aac3f1dfb1e45d075eab6
BLAKE2b-256 87deef9f785ce220904c66288df4c3d16eb3ada8edf030d5fca009e1a040c91a

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