I ported JustHTML from Python to JavaScript with Codex CLI and GPT-5.2 in 4.5 hours

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

A single $20/month subscription and eight prompts produced a fully tested 9,000-line JavaScript port of a Python library in 4.5 hours, showing multi-hour unsupervised agent coding now works.

Read this as

Simon Willison used OpenAI's Codex CLI with the GPT-5.2 model to convert a Python program, JustHTML, which reads HTML web code, into an equivalent JavaScript version. The computer did the work largely on its own over about 4.5 hours, passing 9,200 of the industry's standard parser tests while Willison decorated a Christmas tree and watched a movie. The result is a free, reusable tool that anyone building websites or software can now use.

Willison ported the JustHTML Python library to JavaScript in about 4.5 hours using GPT-5.2 via Codex CLI, spending roughly $29 of tokens at API rates, included free in his $20/month ChatGPT Plus plan. The output was 9,000 lines of JavaScript passing 9,200 html5lib-tests in 43 commits. His takeaways: code production is nearly free, but questions of copyright, ethics and production trustworthiness for agent-built ports remain unresolved. Teams doing routine porting work are the ones affected.

Willison ran GPT-5.2 in Codex CLI with --yolo mode to port JustHTML (a Python HTML5 parser) to JavaScript, producing justjshtml: a dependency-free library passing 9,200 html5lib-tests (tokenizer 6,810/6,810, tree 1,770/1,782, serializer 230/230) across 43 commits. Eight total prompts; token usage was 2,089,858 input plus 97M cached plus 625,563 output, estimated at $29.41 at API prices. He attributes success to reducing the task to a robust test suite, 'designing the agentic loop'.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

JustHTML JustJSHTML Codex CLI GPT-5.2 html5lib-tests html5ever

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading