Skip to content
Tech News
← Back to articles

Show HN: Openleetcode – local LeetCode runner where tests live in the repo

read original more articles
Why This Matters

Openleetcode introduces a local, open-source LeetCode runner that allows developers to test and judge solutions directly within their repositories, eliminating reliance on online platforms. Built with Haskell and leveraging Docker, it offers a customizable and privacy-conscious environment for coding interviews and practice. This development enhances the flexibility and security of coding workflows for both individual learners and teams in the tech industry.

Key Takeaways

"There are no magic machines and no magic operators." - DHH

openleetcode is a local LeetCode runner built around open test suites, made in Haskell.

It takes a normal solution file, finds the matching problem manifest, builds a tiny language-specific harness, sends it to a pluggable execution backend, and judges the result locally. The tests live in the repo. The runtime templates live in the repo. The CLI is just the glue.

$ openleetcode submit ./solution.py --id 1 $ openleetcode submit ./solution.rs --title two-sum

Demo

Install

You need Docker for the execution backend. On Linux and macOS the installer will try to start the default Piston backend for you through Docker Compose. On Windows, the installer only installs the CLI. Bring Docker yourself and start the backend manually.

... continue reading