Skip to main content

📅 leetrs daily

Fetches today's LeetCode Problem of the Day and opens it the same way pick does.


Usage​

leetrs daily [OPTIONS] [LANGUAGE]

Arguments​

ArgumentTypeRequiredDescription
[LANGUAGE]stringNoLanguage for the code template (python, rust, pandas, mysql, postgres). Defaults to the config.toml setting.

Options​

OptionTypeRequiredDescription
-p, --previewflagNoPrint the problem description Markdown to stdout without opening an editor.
-b, --browserflagNoOpen the problem in your default web browser in addition to default behavior.

Behaviour​

  • The active challenge comes from LeetCode's questionOfToday GraphQL query. Its date, number, title and difficulty are printed to stderr before the problem is picked, so leetrs daily --preview > problem.md keeps that line out of the file.
  • Files are written and reused exactly as with pick.
  • If today's problem is for LeetCode Premium subscribers and your account is not premium, daily stops with a message instead of failing on the missing content. If premium status can't be confirmed, it warns and tries anyway.
  • When -b or --browser is passed, the problem URL (https://leetcode.com/problems/<slug>) is opened in your default browser.
leetrs daily
leetrs daily rust
leetrs daily -b
leetrs daily --preview