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.2.0.tar.gz (29.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.2.0-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: leetui_terminal-0.2.0.tar.gz
  • Upload date:
  • Size: 29.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.2.0.tar.gz
Algorithm Hash digest
SHA256 f85f2b171cb8cac8498e5d7c10abea7d150b46ae64fe231404f26f06a5a9fda7
MD5 e0d50d75198943b4a33ad067858cc826
BLAKE2b-256 361ee0bcbe19a60745d7d438d128b6923aca100618c786b707fada372c4dbc8b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for leetui_terminal-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fa7806f0f7b6150cbfdfbed3ad55957465eae2c58909cd033220cf19f3b3f660
MD5 ae49a2f0353b87de922dae00256d56a9
BLAKE2b-256 69068880fbc813efbcd68c88ac9734625c9987678b22b18e195c69d4063c3bba

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