{"id":15011037,"url":"https://github.com/brokad/tinycode","last_synced_at":"2026-03-17T07:39:21.567Z","repository":{"id":50373081,"uuid":"423181309","full_name":"brokad/tinycode","owner":"brokad","description":"A lightweight command-line tool to crunch coding challenges in your favorite editor","archived":false,"fork":false,"pushed_at":"2022-08-10T09:22:59.000Z","size":657,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-29T00:58:02.047Z","etag":null,"topics":["coding-challenges","competitive-coding","emacs","go","golang","hackerrank","learning","leetcode","vim"],"latest_commit_sha":null,"homepage":"","language":"Go","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/brokad.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}},"created_at":"2021-10-31T15:11:27.000Z","updated_at":"2022-12-23T00:15:25.000Z","dependencies_parsed_at":"2022-09-15T16:02:48.053Z","dependency_job_id":null,"html_url":"https://github.com/brokad/tinycode","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/brokad/tinycode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brokad%2Ftinycode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brokad%2Ftinycode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brokad%2Ftinycode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brokad%2Ftinycode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brokad","download_url":"https://codeload.github.com/brokad/tinycode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brokad%2Ftinycode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30617552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T04:46:40.957Z","status":"ssl_error","status_checked_at":"2026-03-17T04:46:32.538Z","response_time":56,"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":["coding-challenges","competitive-coding","emacs","go","golang","hackerrank","learning","leetcode","vim"],"created_at":"2024-09-24T19:38:33.920Z","updated_at":"2026-03-17T07:39:21.537Z","avatar_url":"https://github.com/brokad.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003etinycode\u003c/h1\u003e\n\n\u003ch3\u003eCoding challenges in your favorite IDE or editor.\u003c/h3\u003e\n\n- [Installation](#installation)\n- [Getting Started](#getting-started)\n  - [HackerRank](#hackerrank)\n  - [LeetCode](#leetcode)\n- [Basic Usage](#basic-usage)\n  - [login](#login)\n  - [checkout](#checkout)\n  - [submit](#submit)\n- [Supported Languages](#supported-languages)\n- [Contributing](#contributing)\n\n## Installation\n\nTo install `tinycode` run:\n\n```bash\n$ go install github.com/brokad/tinycode@latest\n```\n\n## Getting Started\n\n`tinycode` works with both LeetCode and HackerRank. Before you can\nstart solving problems, you must login with at least one of them.\n\n### HackerRank\n\nTo get started on HackerRank, login with\n\n```shell\n$ tinycode login -p hackerrank\n```\n\nYou will get prompted for your HackerRank username and password. You\ncan make sure you've been successfully logged in by checking out a\nsample unsolved problem:\n\n```shell\n$ tinycode checkout --track algorithms --lang cpp \n```\n\nSee [login](#login) for more on the `login` command.\n\n### LeetCode\n\nTo use LeetCode, it is currently a bit more involved as\nthe LeetCode API does not support programmatic login and `tinycode` \ndoes not support extracting credentials from cookies (yet). \n\nLogin on LeetCode with a browser and extract the CSRF and\nsession tokens from the developer console.\n\nHere's how to do it with Firefox, but it's the same idea\nwith any browser you might be using.\n\nHead over to\n[https://leetcode.com/accounts/login/](https://leetcode.com/accounts/login/)\nand login. Open the developer console (Tools \u003e Browser Tools \u003e Web Developer Tools \non macOS).\n\n\u003cimg src=\"./resources/firefox_developer_console.png\" width=\"420\"/\u003e\n\nGo to \"Storage\" and open the cookies for `https://leetcode.com`. You\nshould see two cookies, one for `csrftoken` and one for `LEETCODE_SESSION`.\n\n\u003cimg src=\"./resources/firefox_cookies.png\" width=\"920\"/\u003e\n\nRun the command `tinycode login -p leetcode` and paste the corresponding values when prompted:\n\n```shell\n$ tinycode login -p leetcode \ncsrf: {paste your 'csrftoken' cookie value}\nsession token: {paste your 'LEETCODE_SESSION' cookie value}\n```\n\nYou can test everything works as expected by running\n\n```shell\n$ tinycode checkout -p leetcode --lang rust\n```\n\nSee [login](#login) for more on the `login` command.\n\n## Basic Usage\n\n### login\n\nTo login to a supported platform (HackerRank or LeetCode) use the `tinycode login` command. \n\nThe available options are:\n\n- `-p`/`--provider`: the problem provider to use, either `leetcode` or `hackerrank` (DEFAULT: `hackerrank`)\n- `-s`/`--session`: manually set the session token (only required with `--provider=leetcode`)\n- `-c`/`--csrf`: manually set the X-CSRF-Token (only required with `--provider=leetcode`)\n\nThe login credentials are saved under `$HOME/.config/tinycode/config.toml`.\n\n### checkout\n\nTo check a problem out, use the `tinycode checkout` command. For example:\n\n```shell\n$ tinycode checkout -p leetcode --lang rust --open\n```\n\nThis command runs a search of available problems from the specified provider. \n\nThe available options are:\n\n- `-p`/`--provider`: the problem provider to use, either `leetcode` or `hackerrank` (DEFAULT: `hackerrank`)\n- `-d`/`--difficulty`: limit search to a given difficulty, either `easy`, `medium` or `hard`\n- `--status`: limit search to problems with a given \"status\", either `todo`, `attempted` or `solved`\n- `-l`/`--lang`: limit search to problems that admit a solution in a specific language (e.g. `cpp`); \n  see [Supported Languages](#supported-languages) for the list of possible values\n- `--id`: specify an exact problem id (e.g. `1`)\n- `--problem`: specify an exact problem slug (e.g. `two-sum`)\n\nThe available flags are:\n\n- `-o`/`--open`: if specified, open the checked out problem with the text editor configured in the `EDITOR`\n  environment variable\n- `-s`/`--submit`: if specified, implies `--open` and submit the solution immediately upon closing the editor\n\nThese options are **only** available when `--provider=leetcode`:\n\n- `-t`/`--tags`: limit search to problems with the given tags; the tags should be specified \n  by a comma-separated list (e.g. `array,hash-table,graph`). The list of valid tags can be found \n  in the LeetCode dashboard under the tags search filter.\n\nThese options are **only** available when `--provider=hackerrank`:\n\n- `--track`: limit search to problems belonging to a specific HackerRank \"track\". \n  These correspond to \"Topics\" from the GUI. Possible values are: \n  - `algorithms`\n  - `data-structures`\n  - `mathematics`\n  - `ai`\n  - `c`\n  - `cpp`\n  - `java`\n  - `python`\n  - `ruby`\n  - `sql`\n  - `databases`\n  - `shell`\n  - `fp`\n  - `regex`\n\nAdding a path argument to `tinycode checkout` will have the problem prompt and associated code stub saved to \nfile at that path. With HackerRank, this also creates an `.html` file to be opened separately in a browser. \n\nIf no path is specified the problem's code stub is output to stdout.\n\n### submit\n\nTo submit a solution, you can use the `--submit` flag with `tinycode checkout` (see above) or the `tinycode submit`\ncommand. For example:\n\n```bash\n$ tinycode submit -p hackerrank --problem a-very-big-sum --contest master --track algorithms a-very-big-sum.cpp \n```\n\nIf you are passing in a path to a file created by the `tinycode checkout`, none of the options below are required. \nFor example:\n\n```bash\n$ tinycode checkout --track algorithms --lang cpp problem.cpp\n$ emacs problem.cpp\n$ tinycode submit problem.cpp\n```\n\nThe available options are:\n\n- `-p`/`--provider`: the problem provider to use, either `leetcode` or `hackerrank` (DEFAULT: `hackerrank`)\n- `--id`: the problem id to submit a solution for (e.g. `1`)\n- `--problem`: the slug of the problem to submit a solution for (e.g. `a-very-big-sum`)\n- `-l`/`--lang`: the programming language for which to submit a solution to this problem (should match the language \n  used in the input file)\n\nThese flags are **only** available when `--provider=hackerrank`:\n\n- `--purchase`: if specified, purchase the last failed testcase (using HackerRank credits)\n\n## Supported Languages\n\nAn exhaustive list of the languages supported by `tinycode` (and the\naccepted values for the `--lang` option) can be found in\n[provider/provider.go](./provider/provider.go).\n\n## Contributing\n\nIf you find a bug and know how to fix it - feel free to go ahead and [open\na PR][open-a-pr] for it! They will all be accepted. If you have a feature request, or \nencounter a problem while using `tinycode`, please [open an issue][open-an-issue] and \nlet me know how to reproduce it. If you want to chat about something bigger you'd want\nto work on, the easiest is to connect with me on Discord [94a84d2e#7864][find-me-on-discord]!\n\n[open-a-pr]: https://github.com/brokad/tinycode/compare\n[open-an-issue]: https://github.com/brokad/tinycode/issues/new\n[find-me-on-discord]: https://discordapp.com/users/1001719492356866091","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrokad%2Ftinycode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrokad%2Ftinycode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrokad%2Ftinycode/lists"}