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.4.0.tar.gz (156.6 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.4.0-py3-none-any.whl (246.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: leetui_terminal-0.4.0.tar.gz
  • Upload date:
  • Size: 156.6 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.4.0.tar.gz
Algorithm Hash digest
SHA256 f1985fbc33c8e2fefbf8ebb09e82ae798c99628d9200729a2b362eb973dee989
MD5 2e23a5883a09f927d87169f263bcdc27
BLAKE2b-256 6a1a1f0ba43378beb9c1c90949f98008378beacc4ead05f184cc835d112ac7d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for leetui_terminal-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 276d21805965ea550ae6632ee7be50a10f4dccd9231dbc379f99e3d96d6e4af2
MD5 0ed0154af3d510ad721beeb4b3c1e99b
BLAKE2b-256 4f5f7064dd3e5060812c803d9bb257199fb6229e63600334a0e8166234beabaf

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