{"id":24956157,"url":"https://github.com/lmriccardo/leetcode-fetcher","last_synced_at":"2026-02-18T04:32:21.835Z","repository":{"id":272153232,"uuid":"915498170","full_name":"lmriccardo/leetcode-fetcher","owner":"lmriccardo","description":"CLI Application for fetching leetcode problems locally using GraphQL API","archived":false,"fork":false,"pushed_at":"2025-03-12T22:01:12.000Z","size":958,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-10T14:27:52.108Z","etag":null,"topics":["graphql","leetcode","typescript"],"latest_commit_sha":null,"homepage":"https://lmriccardo.github.io/leetcode-fetcher/","language":"TypeScript","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/lmriccardo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"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,"zenodo":null}},"created_at":"2025-01-12T02:05:20.000Z","updated_at":"2025-02-27T15:22:48.000Z","dependencies_parsed_at":"2025-01-12T15:29:06.481Z","dependency_job_id":"9aeab96b-4f04-4003-b65b-da79c4d4c3db","html_url":"https://github.com/lmriccardo/leetcode-fetcher","commit_stats":null,"previous_names":["lmriccardo/leetcode-fetcher"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/lmriccardo/leetcode-fetcher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmriccardo%2Fleetcode-fetcher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmriccardo%2Fleetcode-fetcher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmriccardo%2Fleetcode-fetcher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmriccardo%2Fleetcode-fetcher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmriccardo","download_url":"https://codeload.github.com/lmriccardo/leetcode-fetcher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmriccardo%2Fleetcode-fetcher/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29568466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T04:18:28.490Z","status":"ssl_error","status_checked_at":"2026-02-18T04:13:49.018Z","response_time":162,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["graphql","leetcode","typescript"],"created_at":"2025-02-03T06:27:44.271Z","updated_at":"2026-02-18T04:32:16.809Z","avatar_url":"https://github.com/lmriccardo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eLeetCode Problem Fetcher\u003c/h1\u003e\n\u003cdiv align=\"center\"\u003e\n\n### A CLi Application for local fetching of leetcode problems\n\n\u003cimg src=\"https://img.shields.io/badge/License-MIT-green.svg\"/\u003e\n\u003cimg src=\"https://img.shields.io/npm/v/npm.svg?logo=nodedotjs\"/\u003e\n\u003cimg src=\"https://img.shields.io/github/v/release/lmriccardo/leetcode-fetcher\"/\u003e\n\u003cimg src=\"https://img.shields.io/npm/dm/leetcode-fetcher-cli?\u0026logo=npm\"/\u003e\n\u003cimg src=\"https://img.shields.io/github/downloads/lmriccardo/leetcode-fetcher/total?logo=github\n\"/\u003e\n\u003cimg src=\"https://img.shields.io/docker/pulls/lmriccardo/leetcode-fetcher?logo=docker\"/\u003e\n\n![LeetCode](https://img.shields.io/badge/LeetCode-000000?style=for-the-badge\u0026logo=LeetCode\u0026logoColor=#d16c06)\n![Node.js](https://img.shields.io/badge/Node.js-%2320232a?style=for-the-badge\u0026logo=node.js\u0026logoColor=43853D)\n![TypeScript](https://img.shields.io/badge/typetscript-%2320232a.svg?style=for-the-badge\u0026logo=typescript\u0026logoColor=%fff)\n\n\u003cp\u003e\u003cstrong\u003eNPM Package\u003c/strong\u003e: \u003ca href=\"https://www.npmjs.com/package/leetcode-fetcher-cli\"\u003ehttps://www.npmjs.com/package/leetcode-fetcher-cli\u003c/a\u003e\u003c/p\u003e\n\u003cp\u003e\u003cstrong\u003eDocker Repository\u003c/strong\u003e: \u003ca href=\"https://hub.docker.com/repository/docker/lmriccardo/leetcode-fetcher/general\"\u003ehttps://hub.docker.com/repository/docker/lmriccardo/leetcode-fetcher/general\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eCurrent Version\u003c/strong\u003e: v0.1.1 (Release), v0.1.2 (Development)\u003c/p\u003e\n\n\u003c/div\u003e\n\n---\n\n\u003e _GitHub Pages_ Documentation is in construction 👷\n\u003e\n\u003e Give a look to [TODO.md](./TODO.md) for upcoming changes\n\n---\n\n## About ✨\n\nWhen solving leetcode problems, I would have like to have a tool or a utility able to automatically provides me with a number of problems and, for each of them, creates a local instance with the problem description and the provided snippet of code. Thus avoiding every time to manually copy everything locally, resolve the imports and setup the tests.\n\nThe final result of this need is **leetcode-fetcher**, a simple cli applications that interacts with leetcode through the *GraphQL* endpoint, in order to fetch problems, user statistics, run tests remotely and submit a solution.\n\n## Running the App 🚀\n\n### Cloning the repository and install locally\n\nUp to now, to run the application you need first to clone the repository, install all the required node modules and then run. \n\n```\ngit clone https://github.com/lmriccardo/leetcode-fetcher.git\nnpm install \u0026\u0026 npm run app\n```\n\nPlease, make sure to have node.js and npm installed in your system.\n\n### Using Docker containers\n\nAlternatively, it is possible to run the application using Docker.\n\n```\ndocker run --rm -it -v ./:/leetcode lmriccardo/leetcode-fetcher:latest\n```\n\nNotice that, the bind mount `-v ./:/leetcode` is **required** to obtain the result on the host machine. When the application starts, the first command to execute must be\n\n```\nset FOLDER /leetcode\n```\n\nIn order to set the correct output folder\n\n\u003e **NOTE**: Within Docker containers, user login with browser is not available. The only possible solution is to\n\u003e load a pre-saved JSON state with a logged in user. \n\n### From NPM Packages\n\nThe last way to run the cli application is to install it via *npm*\n\n```\nnpm i leetcode-fetcher-cli\n```\n\nThe command to run the application is just \n\n```\nlcfetcher\n```\n\n## How the application works 💻\n\nWhen first the application starts, the following line will appear:\n\n```\n[Current DateTime] \u003e\u003e (Type help for commands): \n```\n\nIf you type `help` the list with all possible commands will appear. That is, the application works giving specific commands and then pressing ENTER to execute it. Every time, either an error or the output pops out, you will always see the initial line and new commands can be given. Here is the list with all possible commands:\n\n| **Name**  | **Syntax**                      | **Description**                                                                                                                                                               |\n|-----------|---------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| _Help_    | `help [cmd1 cmd2 ...]`          | Shows the helper message for each given command. If no command is provided, consider all.                                                                                     |\n| _Set_     | `set [VAR value ...]`           | Set the value of the specified variable. To inspect available variables use the `show` command.                                                                               |\n| _Unset_   | `unset [VAR1 VAR2 ...]`         | Unset variables bringing back to their default values.                                                                                                                        |\n| _Show_    | `show [sensitive]`              | Shows values and informations about the application state and variables. If sensitive is given then also user cookies are shown.                                              |\n| _List_    | `list`                          | Locally fetches a number of problems from leetcode. The search is filtered using the _variables_ set with `set` or `unset`                                                    |\n| _Detail_  | `detail idx` | Print details about a specified problem. A problem is specified either by local indexing, or remote question IDs.                                                             |\n| _Fetch_   | `fetch \u003ctitle\\|id\u003e value`      | Fetch locally a single problem from remote. The problem is specified either using the title-slug or the remote ID.                                                            |\n| _Create_  | `create \u003cidx\u003e`                  | Create a problem instance in the provided target folder (which is a variable). The problem is specified only by the local index which means that must already exists locally. |\n| _Save_    | `save filepath`                 | Saves the current state into a json file                                                                                                                                      |\n| _Load_    | `load filepath`                 | Loads the state from a json file                                                                                                                                              |\n| _Clear_   | `clear`                         | Clears the screen content                                                                                                                                                     |\n| _Login_   | `login [force]`                 | Open a browser to perform the login and starts a leetcode session.                                                                                                            |\n| _Inspect_ | `inspect [username]`            | Inspect a given user profile if it exists, or the current logged one                                                                                                          |\n| _Daily_   | `daily [create]`                | Fetch the current daily question and optionally create an instance                                                                                                            |\n| _Quit_    | `quit`                          | Quit the application                                                                                                                                                          |\n| _Watch_   | `watch \u003cquestion-idx\\|daily\u003e`   | Cache the given problem for future tests or submissions. An instance of the given problem is create if it does not exists.                                                    |\n| _Test_    | `test`                          | Test the cached problem with leetcode remotely (see `watch`)                                                                                                                  |\n| _Submit_  | `submit`                        | Submit a solution of the cached problem in leetcode (see `watch`)                                                                                                             |\n\nIn order to obtain more informations about the commands, run the `help` command.\n\nAn output example is already present in the \u003ca href=\"./examples/python/9-palindrome-number\"\u003e./examples/python/9-palindrome-number\u003c/a\u003e folder. It has been obtained running the following commands:\n\n```\n[XXX] \u003e\u003e (Type help for commands): fetch id 9\n\nFetched Problems : 1\n\nSTATUS  IDX  ID  DIFFICULTY        TITLE        TAGS\n\n ❌🙉💲   0   9      Easy     Palindrome Number  Math\n\n[XXX] \u003e\u003e (Type help for commands): set FOLDER ./examples/python\n[XXX] \u003e\u003e (Type help for commands): create 0\n[INFO] Result written in folder: examples\\python\\9-palindrome-number\n```\n\n## Current Limitations and futures 🚧\n\n- Up to now, the only possible target language to save the problem code snippet is Python3.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmriccardo%2Fleetcode-fetcher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmriccardo%2Fleetcode-fetcher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmriccardo%2Fleetcode-fetcher/lists"}