// HACKER NEWS — CYBERSECURITY
Show HN: Openleetcode – local LeetCode runner where tests live in the repo
"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.
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.
The backend may take a while to install runtimes on the first start.
openleetcode currently uses Piston as its execution backend. The default config points to:
Override language detection when the file extension is ambiguous:
Each runtime provides the small compatibility layer LeetCode problems tend to need: JSON output, arrays, matrices, linked lists, binary trees, etc. Imports and common libraries are kept close to the official LeetCode environments, so a solution should look like a normal LeetCode submission, not a custom openleetcode program.
For code changes, you need a Haskell toolchain with Cabal.
Start with TEST_FORMAT.md. Seriously. It is the contract between the YAML, the runtime templates, and the judge.