GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - clearloop/leetcode-cli: May the code be with you 👻

BranchesTags
Open more actions menu

Latest commit

 

History

221 Commits
221 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
src
src
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
flake.lock
flake.lock
 
 
flake.nix
flake.nix
 
 
rust-toolchain.toml
rust-toolchain.toml
 
 
rustfmt.toml
rustfmt.toml
 
 

Repository files navigation

leetcode-cli

Rust crate doc downloads telegram LICENSE

May the code be with you.

Install

# Linux build deps: system SQLite + OpenSSL headers + pkg-config
#   (Debian/Ubuntu: libsqlite3-dev libssl-dev pkg-config). macOS ships both.
cargo install leetcode-cli

Python filtering scripts (the --plan flag) require the optional pym feature:

cargo install leetcode-cli --features pym

Nix users can nix build / nix develop against the bundled flake.nix.

Quickstart

Sign in to LeetCode in Chrome first — on macOS and Linux leetcode-cli reads its cookies automatically (on Windows, set them manually). See Cookies for manual setup and environment-variable overrides.

leetcode pick 1        # pick a problem and print its description
leetcode edit 1        # open the solution file in your editor
leetcode test 1        # run the sample test cases
leetcode exec 1        # submit the solution

Run leetcode --help (or leetcode <command> --help) for the full, always-current list of commands and flags. The headline ones:

Command Alias What it does
pick p Pick a problem by id, --name, --tag, --query, --plan, or --daily
edit e Open a problem's code file; --lang overrides the configured language, --daily opens today's challenge
test t Run test cases; --watch re-runs on save, --daily targets today's challenge
exec x Submit the solution
list l List/filter problems by category, tag, id range, or --query
stat s Show a chart of your submissions
data d Manage the local cache (--update, --delete)
completions c Generate shell completions (bash, elvish, fish, powershell, zsh)
Shell completions

By default the shell is inferred from $SHELL:

eval "$(leetcode completions)"

Copy that line into .bash_profile or .zshrc. Pass a shell explicitly to target another:

leetcode completions fish

Documentation

  • Configuration — the full leetcode.toml reference: editor, code generation, filename templates, and storage paths.
  • Cookies — automatic Chrome cookies, manual setup from any browser, leetcode.cn support, and environment-variable overrides.
  • Editors & LSP — getting rust-analyzer (and other language servers) working with generated solution files.
  • Scripting — filtering problems with custom Python plans.

Contributing

Feel free to add your name and email to the authors field of Cargo.toml, and open a pull request.

License

MIT

About

May the code be with you 👻

Topics

cratesleetcodeleetcode-clirust

Resources

Readme
MIT license
Activity

Stars

503 stars

Watchers

4 watching

Forks

79 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.