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
python3 -m venv .venv
source .venv/bin/activate
pip3 install -e .
leetui

Always work inside the venv when developing. To re-enter it later:

cd leetcodecli
source .venv/bin/activate

Keyboard shortcuts (keyboard-only flow)

Problem browser:

  • / : Move between search, filters, and problem list
  • / : Move across filters
  • Enter: Open selected problem in workspace
  • Esc: Back to home

Workspace (split view):

  • e: Focus the code editor (right pane)
  • s: Toggle between Description and Solutions tabs (left pane)
  • Esc: Editor → question pane → problem browser
  • / : Scroll description or navigate solutions list
  • Ctrl+R / Alt+R: Run current test
  • Ctrl+T / Alt+T: Run all tests
  • Ctrl+D / Alt+D: Save solution
  • PageUp / PageDown: Fast scroll
  • Ctrl+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.3.0.tar.gz (147.4 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.3.0-py3-none-any.whl (236.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: leetui_terminal-0.3.0.tar.gz
  • Upload date:
  • Size: 147.4 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.3.0.tar.gz
Algorithm Hash digest
SHA256 18533c34624776f5dcfa26b1ae09e983d8924e6abf777f195c9c8763c0bfb436
MD5 8108b9cbc1b26f4afb9a2b8039c52a30
BLAKE2b-256 da478d83e3371920a4556b03d956c0d14a708924592a9a047d82a1a5bab72f55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for leetui_terminal-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6b9224e1b7bd9585306384c0c7a1ed10de8a5c4c9cc34735bb114cd9adddc53
MD5 2897f631c4e4a0af41df198cd6c1e118
BLAKE2b-256 48be1437a590acbe2dfb2ab0bfb6d482aaafd38eedf09ce83fd53520ebec35cc

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