html-anything: The Agentic HTML Editor That Turns Local CLIs Into a Publishing Engine

A local-first workflow where your AI coding agent writes the markup, preserves design through diff edits, and exports the same content to magazine pages, decks, posters, and social formats.

8-10 min read • View on GitHub • More from nexu-io

A workbench scene shows raw markdown entering a small mechanical press on the left, passing through a narrow skill stencil in the middle, and emerging on the right as polished HTML pages, a slide deck, and a poster layout. It explains how html-anything treats local AI agents as the compositor between draft content and publishable output.
Markdown in, HTML out, with the local CLI doing the composing.
Key Takeaways

Most AI writing tools stop at generation. html-anything is more interesting because it treats generation as a local production line. Your machine already has authenticated coding CLIs on it, and the app uses them as the backend.

The CLI Is the Backend

The architectural surprise is simple: no direct model API is required. The app detects local agents on PATH, picks one, and streams a constrained prompt into that CLI. That means the user’s own authenticated tools, not a vendor endpoint, do the actual conversion work.

The app does not call a remote editor API. It orchestrates local CLIs, then routes the result into preview and export surfaces.

That changes the product from the ground up. Privacy improves because the content stays local. Cost becomes a function of the user’s existing subscriptions. And the app can support multiple agents without rewriting its own core.

Why Diff Editing Matters

The most underrated choice in the codebase is buildEditPrompt. When content changes, the system does not throw away the page and start over. It sends the old HTML and the new text back through the agent and asks for a diff edit that preserves the layout.

Two versions of the same page sit side by side in close view. The left page has a stable title block, columns, and spacing. The right page keeps the same composition but shows revised text, while a narrow strip between them isolates only the changed lines. It explains how diff editing preserves design while updating content.
Regeneration is easy. Preservation is the harder and more useful problem.
ApproachWhat changesWhat stays stableRisk
Regenerate from scratchEverythingAlmost nothingLayout drift
Diff editOnly the content that changedHierarchy, spacing, visual rhythmPrompt complexity
Manual HTML editingWhatever the editor touchesWhatever the editor leaves aloneSlow iteration

That is why the workflow feels like editing instead of generating. A good diff edit keeps the page recognizable, which matters if the output is meant to ship as a magazine spread, a deck, or a poster.

Skills Are the Real Product

The library of 75-plus skills is not just template sprawl. It is the project’s design grammar. Each skill packages structure, tone, and constraints so the model is not inventing the page from scratch every time.

LayerWhat it doesWhy it matters
Raw promptDescribes the taskToo open-ended for reliable layout
SkillConstrains tone and structureTurns prompt into a reusable design unit
HTML outputBecomes the final artifactCan be previewed, exported, and published

That matters because the system is not trying to be a general-purpose chat assistant. It is trying to produce repeatable surfaces. A skill is closer to a page type than a prompt trick.

Preview Is Not Passive

The preview pane behaves like an inspector, not a dead iframe. It can sanitize streamed HTML, detect deck-like layouts, and switch views when the content behaves like slides instead of a long page.

// Simplified behavior
const cleaned = sanitize(streamedHtml)
const isDeckView = isDeck(cleaned)

if (isDeckView) {
  renderDeckViewer(cleaned)
} else {
  renderIframePreview(cleaned)
}

The point is not just fast feedback. It is that the app can notice what the agent is building while the agent is still building it. That shortens the loop between draft, inspection, and revision.

HTML as the Universal Intermediate Format

Markdown is useful for drafting. HTML is useful for shipping. html-anything makes that distinction explicit by treating HTML as the thing that travels to the reader, the platform, and the export pipeline.

SurfaceWhy HTML helpsWhat the app adds
Web pageNative renderingPreview and sanitization
WeChat or ZhihuNeeds inlined stylesCSS inlining with juice
PNG or posterNeeds rasterizationScreenshot export
SlidesNeeds structured sectionsDeck detection and viewer

That is also why the export story matters. The same source can move across surfaces if the HTML is clean enough and the styles are prepared correctly. In this repo, that means inline styles, export tooling, and layout conventions all belong to the core product, not a postscript.

Why This Wins Over Generic AI Editors

WorkflowAPI keyDesign preservationExport surfacesBest use case
Traditional CMSUsually noManual onlyLimitedForm-driven publishing
Generic prompt-to-HTML toolOften yesWeakMostly webQuick one-off pages
html-anythingNo direct API keyStrong through diff editsHTML, PNG, deck, socialRepeatable publishing workflows

The broader shift is clear. If the output is going to be read, shared, exported, or printed, then the editor should optimize for those endpoints first. html-anything does that better than tools that stop at a single generated page.

What It Suggests About the Next Web Workflow

The most interesting implication is not that AI can write HTML. It is that local agent tools may become the real compositor layer for publishing. The prompt becomes the brief, the skill becomes the house style, and HTML becomes the contract.

That is a very different mental model from a CMS with a few AI helpers bolted on. It is closer to a design system expressed as constrained instructions, with the agent doing the tedious assembly work. If that pattern spreads, more of the web workflow will move from form-filling to orchestration.