{"id":13672107,"url":"https://github.com/dragfire/leetup","last_synced_at":"2025-10-21T04:50:57.335Z","repository":{"id":44933381,"uuid":"274278565","full_name":"dragfire/leetup","owner":"dragfire","description":"Command line tool to solve Leetcode problems. Leet it up!!","archived":false,"fork":false,"pushed_at":"2024-03-28T06:25:29.000Z","size":22229,"stargazers_count":118,"open_issues_count":13,"forks_count":17,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-19T02:44:13.239Z","etag":null,"topics":["cli","leetcode","leetcode-java","leetcode-practice","leetcode-rust","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dragfire.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":null},"created_at":"2020-06-23T01:20:26.000Z","updated_at":"2025-07-20T15:49:24.000Z","dependencies_parsed_at":"2024-07-27T18:20:32.037Z","dependency_job_id":null,"html_url":"https://github.com/dragfire/leetup","commit_stats":{"total_commits":148,"total_committers":4,"mean_commits":37.0,"dds":0.03378378378378377,"last_synced_commit":"48c8a4d9fd7c25b6aa3b66a981e1c73f68d8c811"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"purl":"pkg:github/dragfire/leetup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragfire%2Fleetup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragfire%2Fleetup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragfire%2Fleetup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragfire%2Fleetup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dragfire","download_url":"https://codeload.github.com/dragfire/leetup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dragfire%2Fleetup/sbom","scorecard":{"id":354932,"data":{"date":"2025-08-11","repo":{"name":"github.com/dragfire/leetup","commit":"9f9f6418a87e4558a12c079fd14215bdb964501c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/21 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/mean_bean_ci.yml:1","Warn: no topLevel permission defined: .github/workflows/mean_bean_deploy.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/mean_bean_ci.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/mean_bean_ci.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:89: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:90: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:99: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:108: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:132: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:133: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:142: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/mean_bean_deploy.yml:153: update your workflow using https://app.stepsecurity.io/secureworkflow/dragfire/leetup/mean_bean_deploy.yml/master?enable=pin","Info:   0 out of  11 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   5 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.2.5 not signed: https://api.github.com/repos/dragfire/leetup/releases/148097935","Warn: release artifact v1.2.4 not signed: https://api.github.com/repos/dragfire/leetup/releases/120526119","Warn: release artifact v1.2.3 not signed: https://api.github.com/repos/dragfire/leetup/releases/119754619","Warn: release artifact v1.2.2 not signed: https://api.github.com/repos/dragfire/leetup/releases/119748834","Warn: release artifact v1.2.1 not signed: https://api.github.com/repos/dragfire/leetup/releases/119747799","Warn: release artifact v1.2.5 does not have provenance: https://api.github.com/repos/dragfire/leetup/releases/148097935","Warn: release artifact v1.2.4 does not have provenance: https://api.github.com/repos/dragfire/leetup/releases/120526119","Warn: release artifact v1.2.3 does not have provenance: https://api.github.com/repos/dragfire/leetup/releases/119754619","Warn: release artifact v1.2.2 does not have provenance: https://api.github.com/repos/dragfire/leetup/releases/119748834","Warn: release artifact v1.2.1 does not have provenance: https://api.github.com/repos/dragfire/leetup/releases/119747799"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T09:17:54.220Z","repository_id":44933381,"created_at":"2025-08-18T09:17:54.220Z","updated_at":"2025-08-18T09:17:54.220Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280207180,"owners_count":26290616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","leetcode","leetcode-java","leetcode-practice","leetcode-rust","rust"],"created_at":"2024-08-02T09:01:26.918Z","updated_at":"2025-10-21T04:50:57.296Z","avatar_url":"https://github.com/dragfire.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"\u003e If you use neovim, try this Neovim plugin [leetup.nvim](https://github.com/dragfire/leetup.nvim)\n\n\u003ch1 align=\"center\"\u003e\n\n[![crates](https://img.shields.io/crates/v/leetup.svg)](https://crates.io/crates/leetup) ![Downloads](https://img.shields.io/crates/d/leetup) [![CI](https://github.com/dragfire/leetup/actions/workflows/mean_bean_ci.yml/badge.svg)](https://github.com/dragfire/leetup/actions/workflows/mean_bean_ci.yml)\n\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eSolve Leetcode problems\u003c/h4\u003e\n\n![](assets/leetup.gif)\n\n## Install\n- MacOS:\n```sh\nbrew install leetup\n```\n- Linux:  \nDownload from [releases](https://github.com/dragfire/leetup/releases). Extract the zipped file and set the PATH.\n- Cargo:\n```sh\ncargo install leetup\n```\n- Windows:  \nDownload from [releases](https://github.com/dragfire/leetup/releases). Extract the zipped x86_64 windows target file.\n\u003e Note: You will need to add `leetup.exe` to PATH to access from Command Prompt.\n\n## Quick Start:\n- Login using Cookie: `leetup user -c`\n  - You need to login on leetcode.com first.\n  - Copy `csrftoken` and `LEETCODE_SESSION` from cookie storage in the browser.\n- Pick a problem: `leetup pick -l python 1`\n- Test a problem:\n  `leetup test two-sum.py -t \"[1,2]\\n3\"`\n  or redirect test data using stdin\n  ```\n  leetup test 3sum.java -t \u003c\u003c END\n  [1,-1,0]\n  [0, 1, 1, 1, 2, -3, -1]\n  [1,2,3]\n  END\n  ```   \n       \n- Submit a problem: `leetup submit two-sum.py`\n- List/Show problems: `leetup list`\n    - Search by keyword: `leetup list \u003ckeyword\u003e`\n    - Query easy: `leetup list -q e`\n    - Order by Id, Title, Difficulty: `leetup list -qE -oIdT`  \n- [More Commands](docs/usage.md)\n\n## Inject code fragments:\nYou can inject pieces of code that you frequently use in certain positions of the generated code file. Example: Standard library imports for each language can be put into a config. `Leetup` will pick it up and insert into the generated file.  \n\n### Config:\nCreate `~/.leetup/config.json` and customize according to your preference:\n```json\n{\n    \"lang\": \"java\",\n    \"inject_code\": {\n        \"rust\": {\n            \"before_code\": [\"use std::rc::Rc;\", \"use std::collections::{HashMap, VecDeque};\", \"use std::cell::RefCell;\"],\n            \"before_code_exclude\": [\"// Test comment\", \"// Test code\"],\n            \"after_code\": \"\\nstruct Solution; \\n\\nfn main() {\\n    let solution = Solution::$func();\\n\\n}\\n\",\n            \"before_function_definition\": null\n        },\n        \"java\": {\n            \"before_code\": \"import java.util.*;\",\n            \"before_code_exclude\": [\"// Test comment\", \"// Test code\"],\n            \"after_code\": null,\n            \"before_function_definition\": null\n        },\n        \"python3\": {\n            \"before_code\": \"import math\",\n            \"before_code_exclude\": [\"# Test comment\", \"# Test code\"],\n            \"after_code\": [\"if __name__ = \\\"__main__\\\":\", \"    solution = Solution()\"],\n            \"before_function_definition\": null\n        }\n    }\n}\n```\nGenerated code looks something like this in Rust:\n```rust\n// @leetup=custom\n// @leetup=info id=1 lang=rust slug=two-sum\n\n/*\n* [SNIP]\n*/\n// @leetup=custom\n\n// @leetup=inject:before_code_ex\n// Test comment\n// Test code\n// @leetup=inject:before_code_ex\n\n// @leetup=code\n\n// @leetup=inject:before_code\nuse std::cell::RefCell;\nuse std::collections::{HashMap, VecDeque};\nuse std::rc::Rc;\n// @leetup=inject:before_code\n\nimpl Solution {\n    pub fn two_sum(nums: Vec\u003ci32\u003e, target: i32) -\u003e Vec\u003ci32\u003e {}\n}\n// @leetup=code\n\n// @leetup=inject:after_code\n// This is helpful when you want to run this program locally\n// and avoid writing this boilerplate code for each problem.\nstruct Solution;\n\nfn main() {\n    let solution = Solution::two_sum();\n}\n\n// @leetup=inject:after_code\n```\n\nDuring testing and submitting to Leetcode, only the chunk of code between `@leetup=code` will be submitted:\n```rust\n// @leetup=inject:before_code\nuse std::cell::RefCell;\nuse std::collections::{HashMap, VecDeque};\nuse std::rc::Rc;\n// @leetup=inject:before_code\n\nimpl Solution {\n    pub fn two_sum(nums: Vec\u003ci32\u003e, target: i32) -\u003e Vec\u003ci32\u003e {\n    }\n}\n```\nOthers are ignored!\n\n## Hook up script for Pick:\nRun scripts before/after code generation. It's useful when you want more ergonomics to move \naround the generated file e.g. create a directory, move the generated file to the directory, rename, etc.\n`@leetup=working_dir` will be replaced by `working_dir` in config.  \n`@leetup=problem` will be replaced by the current problem tile e.g. `two-sum`.\n```json\n{\n    \"lang\": \"rust\",\n    \"inject_code\": {\n        ...SNIP...\n    },\n    \"pick_hook\": {\n        \"rust\": {\n            \"working_dir\": \"~/lc/rust\",\n            \"script\": {\n                \"pre_generation\": [\"cd @leetup=working_dir; mkdir -p @leetup=problem\"],\n                \"post_generation\": [\"mv @leetup=working_dir/@leetup=problem.rs @leetup=working_dir/@leetup=problem/Solution.rs\"]\n            }\n        },\n        \"java\": {\n            \"working_dir\": \"~/lc/java\",\n            \"script\": {\n                \"pre_generation\": [\"cd @leetup=working_dir\", \"mvn archetype:generate -DartifactId=@leetup=problem  -DgroupId=leetup  -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false\"], \n                \"post_generation\": [\"mv @leetup=working_dir/@leetup=problem.java @leetup=working_dir/@leetup=problem/src/main/java/App.java\"]\n            }\n        }\n    }\n}\n```\n\n### Credit:\nThis project is inspired by: https://github.com/leetcode-tools/leetcode-cli\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragfire%2Fleetup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdragfire%2Fleetup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdragfire%2Fleetup/lists"}