Metadata-Version: 2.4
Name: leetui-terminal
Version: 0.1.1
Summary: Terminal-first LeetCode practice app powered by Textual
Author: siddartha018
License-Expression: MIT
Project-URL: Homepage, https://github.com/siddartha018/leetcodecli
Project-URL: Repository, https://github.com/siddartha018/leetcodecli
Project-URL: Issues, https://github.com/siddartha018/leetcodecli/issues
Keywords: leetcode,terminal,tui,practice,dsa,competitive-programming
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Education
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: textual>=0.40
Requires-Dist: rich>=13.0

# LeetUI (macOS-first Terminal LeetCode TUI)

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

## Install

```bash
pip install leetui-terminal
```

or

```bash
pip3 install leetui-terminal
```

Then run:

```bash
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)

```bash
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:

```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:

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

## Share with friends

Tell them to run:

```bash
pip install leetui-terminal
leetui
```

Or using pipx (isolated install):

```bash
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

```text
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
```
