A terminal-based interface for browsing, solving, and submitting LeetCode problems, built with Rust and Ratatui.
⚠️ Disclaimer (Please read before judging my code): > This is 100% a personal hobby project. The codebase is heavily AI-generated, held together by duct tape and prayers, and exists solely because I wanted a convenient way to do LeetCode. It is not a polished product built for promotion, and it's definitely not supposed to impress anyone. A few crucial notes:
- Currently supports Rust and Go for scaffolding.
- It proudly wears the "It Works On My Machine™" badge. Specifically, it has only been tested with Neovim (
nvim) inside the Ghostty terminal.If you want to use it, fork it, or fix it—you're more than welcome! Just don't expect enterprise-grade architecture.
- Search problems by name or number with instant results
- Read problem descriptions rendered directly in the terminal
- Scaffold a Rust or Go project with boilerplate for any problem, then open it in your editor
- Run & Submit code against LeetCode test cases without leaving the terminal
- Personal Lists synced with LeetCode -- browse, create, delete, and add problems
- Stats -- your solve counts right in the home screen
- Press
?on any screen for all available keybindings
cargo install leetui
git clone https://github.com/yottaes/leetui.git
cd leetui
cargo install --path .
When you scaffold a problem with o, the CLI opens your editor inside the problem directory. To auto-cd into that directory after exiting, add this to your ~/.zshrc or ~/.bashrc:
lc() {
local dir
dir=$(leetui "$@")
if [ -n "$dir" ] && [ -d "$dir" ]; then
cd "$dir"
fi
}
Then use lc instead of leetui. This is needed because a child process can't change its parent shell's working directory -- the wrapper captures the path printed to stdout and cd's into it.
Without the wrapper everything works the same, you just won't auto-cd after exiting.
The CLI reads your LeetCode session cookies directly from your browser (via the rookie crate). No manual token pasting needed.
On first launch you'll be prompted to log in. The app will attempt to extract cookies automatically. If that fails, it will open leetcode.com/accounts/login in your browser -- log in there, then press Enter to retry.
macOS note: Your OS may show a Keychain access prompt. Grant access so the app can read browser cookies.
Press ? on any screen for the full keybinding reference. Here are the essentials:
| Key | Action |
|---|---|
j / k |
Navigate |
Enter |
View problem |
/ |
Search |
f |
Filter by difficulty / status |
o |
Scaffold & open in editor |
a |
Add to list |
L |
Browse personal lists |
S |
Settings |
q |
Quit |
| Key | Action |
|---|---|
j / k |
Scroll |
d / u |
Half page down / up |
o |
Scaffold & open in editor |
r |
Run code (sample cases) |
s |
Submit solution (all cases) |
a |
Add to list |
b / Esc |
Back |
| Key | Action |
|---|---|
Enter |
Open list / View problem |
n |
Create new list |
d |
Delete list / Remove problem |
Esc |
Back |
Settings are stored in ~/.leetcode-cli/config.toml. You can edit them from within the app by pressing S, or edit the file directly:
- workspace_dir -- where scaffolded projects are created (default:
~/leetcode) - language --
rustorgolang(scaffolding support) - editor -- command to open files (default:
nvim)
This is a hobby project. That said:
- Feel free to fork the repo and do whatever you want with it
- PRs are welcome -- submit directly, no need to open an issue first

