id = "leetcode-cli"
name = "leetcode-cli"
homepage = "https://github.com/clearloop/leetcode-cli"
description = "A command-line tool for solving LeetCode problems."
executables = ["leetcode"]
[dotfiles]
paths = ["~/.leetcode/leetcode.toml"]
exclude = []
secret = []
[[dotfiles.secret_paths]]
file = "~/.leetcode/leetcode.toml"
match = { key_path = ["cookies.csrf", "cookies.session"] }
[commands]
format = 1
label = "leetcode"
description = "Pick, edit, test and submit LeetCode problems by id, or work on today's daily challenge. List, stat, data and completions commands are left out."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = false, short_bundles = false }
[[commands.subcommand]]
path = ["pick"]
label = "Pick a problem"
description = "Pick a problem by id, name or daily challenge and print its description."
[[commands.subcommand.source]]
id = "readme"
kind = "help"
url = "https://github.com/clearloop/leetcode-cli/blob/master/README.md"
revision = "2026-10"
evidence = """
leetcode pick 1 # pick a problem and print its description
| `pick` | `p` | Pick a problem by id, `--name`, `--tag`, `--query`, `--plan`, or `--daily` |
"""
[[commands.subcommand.field]]
id = "id"
label = "Problem id"
type = "integer"
position = 0
sources = ["readme"]
[[commands.subcommand.field]]
id = "name"
label = "Problem name"
type = "string"
option = ["--name"]
sources = ["readme"]
[[commands.subcommand.field]]
id = "tag"
label = "Tag"
type = "string"
option = ["--tag"]
sources = ["readme"]
[[commands.subcommand.field]]
id = "daily"
label = "Daily challenge"
type = "boolean"
option = ["--daily"]
sources = ["readme"]
[[commands.subcommand.task]]
id = "pick_id"
label = "Pick by id"
fields = ["id"]
required = ["id"]
[[commands.subcommand.task]]
id = "pick_daily"
label = "Today's challenge"
fields = ["daily"]
required = ["daily"]
set = { daily = [true] }
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["id", "name", "tag", "daily"]
[[commands.subcommand]]
path = ["edit"]
label = "Edit a solution"
description = "Open a problem's code file in your editor."
[[commands.subcommand.source]]
id = "readme"
kind = "help"
url = "https://github.com/clearloop/leetcode-cli/blob/master/README.md"
revision = "2026-10"
evidence = """
leetcode edit 1 # open the solution file in your editor
| `edit` | `e` | Open a problem's code file; `--lang` overrides the configured language, `--daily` opens today's challenge |
"""
[[commands.subcommand.field]]
id = "id"
label = "Problem id"
type = "integer"
position = 0
sources = ["readme"]
[[commands.subcommand.field]]
id = "lang"
label = "Language"
type = "string"
option = ["--lang"]
suggestions = [{ value = "rust", label = "Rust" }, { value = "python3", label = "Python 3" }, { value = "cpp", label = "C++" }]
sources = ["readme"]
[[commands.subcommand.field]]
id = "daily"
label = "Daily challenge"
type = "boolean"
option = ["--daily"]
sources = ["readme"]
[[commands.subcommand.task]]
id = "edit_id"
label = "Edit by id"
fields = ["id", "lang"]
required = ["id"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["id", "lang", "daily"]
[[commands.subcommand]]
path = ["test"]
label = "Test a solution"
description = "Run the sample test cases for a problem."
[[commands.subcommand.source]]
id = "readme"
kind = "help"
url = "https://github.com/clearloop/leetcode-cli/blob/master/README.md"
revision = "2026-10"
evidence = """
leetcode test 1 # run the sample test cases
| `test` | `t` | Run test cases; `--watch` re-runs on save, `--daily` targets today's challenge |
"""
[[commands.subcommand.field]]
id = "id"
label = "Problem id"
type = "integer"
position = 0
sources = ["readme"]
[[commands.subcommand.field]]
id = "watch"
label = "Re-run on save"
type = "boolean"
option = ["--watch"]
sources = ["readme"]
[[commands.subcommand.field]]
id = "daily"
label = "Daily challenge"
type = "boolean"
option = ["--daily"]
sources = ["readme"]
[[commands.subcommand.task]]
id = "test_id"
label = "Test by id"
fields = ["id", "watch"]
required = ["id"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["id", "watch", "daily"]
[[commands.subcommand]]
path = ["exec"]
label = "Submit a solution"
description = "Submit the solution for a problem."
[[commands.subcommand.source]]
id = "readme"
kind = "help"
url = "https://github.com/clearloop/leetcode-cli/blob/master/README.md"
revision = "2026-10"
evidence = """
leetcode exec 1 # submit the solution
| `exec` | `x` | Submit the solution |
"""
[[commands.subcommand.field]]
id = "id"
label = "Problem id"
type = "integer"
position = 0
effect = "exec"
sources = ["readme"]
[[commands.subcommand.task]]
id = "submit"
label = "Submit by id"
fields = ["id"]
required = ["id"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["id"]