r/OpenSourceAI • • 4h ago

shoji: an open-source WebKit browser inside the terminal that coding agents can drive (no headless Chrome)

I moved my coding setup from VS Code to Neovim in the terminal. The missing piece was a browser: I produce a lot of HTML slides and SVG diagrams, and my coding agents need to see the pages they build.

The usual answer is headless Chrome plus Node/Playwright. That's a whole second browser. macOS already ships one (WebKit), so I built shoji, a browser that draws a live WebKit page inside the terminal (Ghostty, kitty, WezTerm).

For agents, there's a small CLI:

shoji ctl open ./index.html
shoji ctl snapshot --view
# textbox "Full name" [e2]
# button "Save" [e6]
shoji ctl fill e2 "Ada Lovelace"
shoji ctl click Save
shoji ctl errors # exceptions, console.error, failed requests

The agent gets plain text with short ids instead of a screenshot or an HTML dump, so it can change the code, use the page, check errors and fix, on its own. Inside Neovim, the page I'm looking at answers the same commands.

Numbers on my Mac, vs headless Chrome (one machine, one run each):

  • Memory, tiny page: 77 MB vs 267 MB
  • Memory, Wikipedia article: 218 MB vs 351 MB
  • Processes: 4 vs 12
  • On disk: about 1 MB vs 1.5 GB

Honest limits:

  • Early prototype: no tabs, downloads, right-click menus or tmux yet.
  • Mac first. It uses one private WebKit call to keep the off-screen page live.
  • Linux works (WPE WebKit 2.54, packages for Debian testing/sid and Arch, or Docker), mainly for agents, and the memory win there is small.
  • WebKit isn't Chrome, so test on Chrome too if your users are there.

Apache-2.0. Repo: https://github.com/kunalkushwaha/shoji
Write-up with diagrams: https://kunalkushwaha.github.io/2026/11/28/agent-needs-eyes-not-another-chrome/

Feedback welcome, especially on the ctl output format for agents and what you'd need before using it in an agent pipeline.

3 Upvotes

0 comments sorted by