hotedit

io.github.Thewhey-Brian由 GitHub 帳號 Thewhey-Brian 發布v0.5.0更新於 Oct 30, 2026

Open HTML reports in the browser and edit them live while the person watches, or by hand.

概覽

AI 產生的概覽

在使用者瀏覽器中開啟本機 HTML 檔案,讓助理列出元素、讀取原始碼並就地修改,變更即時顯示。

可以做什麼
  • 在 hotedit 與使用者瀏覽器中開啟 HTML 檔案並回傳頁面網址
  • 以縮排樹列出頁面元素及其 id、標籤、類別與文字
  • 依 id 讀取單一元素的精確 HTML 原始碼
  • 以尋找取代方式修改檔案中的文字,儲存後立即呈現給使用者
適用情境
適合助理產生或維護 HTML 報告、儀表板、摘要後,使用者想一邊看瀏覽器畫面一邊做小幅修改,例如改錯字、標題、樣式或圖表資料。
執行需求
以 npm 套件形式透過 npx 在本機執行,需要 Node.js 18 以上版本,並用現代瀏覽器檢視頁面。MCP 工具未宣告需要帳號、API 金鑰或環境變數;伺服器僅監聽 127.0.0.1 並驗證工作階段權杖。
安裝前請注意
edit 工具會直接寫入使用者的 HTML 檔案,變更立即儲存並顯示,未復原的錯誤會留在檔案中。元素新增、刪除或移動後 id 會改變,過期的元素清單可能改錯位置。內建 AI 面板可選用 Anthropic API 金鑰(保存在本機設定檔或 ANTHROPIC_API_KEY 變數),代理命令列工具也可能操作頁面;備份保存在使用者家目錄下。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 hotedit,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

hotedit

Edit any HTML file in your browser — text, styles, layout and charts — and save the changes straight back into the file. Built for the HTML reports that AI assistants write.

[hotedit tour: edit text, restyle, change Plotly, Chart.js, Vega-Lite and Mermaid charts, edit maths, add and drag blocks, ask the AI to change one block live]

▶ Watch the narrated 95-second tour (MP4, sound on) · or try it yourself: npx hotedit demo

AI assistants produce a lot of HTML: reports, dashboards, summaries. They look great, but fixing a typo, renaming a chart title or moving a section means digging through thousands of lines of generated markup, or asking the AI again. hotedit opens the page in your browser so you can click what you see and change it. Only the bytes you changed are rewritten, so the file stays clean, diff-friendly and yours.

It doesn't change what your AI makes. Let it write the report exactly as it normally would, at the same quality and with the same charts, design and depth. hotedit only adds the ability to edit it afterwards. Nothing is simplified or re-generated, and nothing is added to the file.

Quick start (30 seconds)

You need Node.js 18+. Then:

bash
npx hotedit report.html

Your browser opens the page. Click ✎ Edit (or press ⌥E / Alt+E), click any text and type. Changes are saved into report.html as you go, ⌘Z / Ctrl+Z undoes them, and ✓ Done (top right, always in the same place) saves anything still open and stops editing. Hover any button to see its shortcut: they are all ⌥ / Alt + a key (⌥E edit, ⌥A ask AI, ⌥S style, ⌥I add, ⌥D duplicate, ⌥⌫ delete, ⌥↑/↓ move), so plain keys never trigger anything and typing is never affected.

Just want to see it? Open a sample report (charts, maths, diagrams) in a throwaway copy:

bash
npx hotedit demo

Not sure which file? Run it with no file and click one from the list:

bash
npx hotedit          # lists the HTML files in this folder

To install it permanently, so you can just type hotedit:

bash
npm install -g hotedithotedit report.html

What you can do

How
Edit textClick and type; the caret lands where you click. Click the next block to save and move on; Enter saves, Esc cancels, ⌘B / ⌘I for bold and italic. In a list, Enter at the end of an item starts a new one.
Add thingsSelect a block and click +: paragraph, heading, list or list item, box, quote, table, code, divider, image, chart, Mermaid diagram or your own HTML. Choose above, below or inside.
Move thingsDrag ⠿ to move a block anywhere: list items into another list, a paragraph into a box. Or use ⋯ → Move up / down (Alt+↑ / Alt+↓).
StyleAa: size, weight, colour, alignment, font, spacing, background, corners and border.
ChartsClick a Plotly, Chart.js, Vega-Lite or Mermaid chart. Pick a type from the tiles (bar, line, area, dots, pie, donut…) and it redraws instantly. Style has switches, menus and colour pickers for titles, axes, legend and series; Data is an editable table with + row; Code is the full spec. Everything previews live; Apply saves.
Images & links🖼 replaces an image, 🔗 changes a link.
Everything else⋯: duplicate, hide, delete, or Edit HTML for the selected block. The name chip (e.g. Paragraph ▴) selects the block around it.
Ask AI, live✨ on a block (or ✨ AI for the whole page): type what should change, and the AI edits the page while you watch, in place, without reloading. Select a block first and it changes only that block. Every change glows as it lands and Undo AI changes takes them all back. It's a chat: ask follow-ups in the box at the bottom, and it shows which AI and model answered.

Things that are generated by the page's own scripts, such as KaTeX maths, Mermaid output or tables built in JavaScript, are never saved as rendered output. hotedit opens their source instead.

Working with AI agents

✨ Built in: ask, and watch it change

Click ✨, say what you want ("make this shorter", "turn the bars orange", "add a row for March"), and press Do it. The AI reads the page, makes small edits in the file and each one shows up in your browser straight away, without reloading. Connect it once with ⚙, using an AI you already have:

  • Claude Code: your Claude plan. Install Claude Code and run claude once to log in.
  • Codex: your ChatGPT plan. npm install -g @openai/codex and run codex once to log in.
  • Anthropic API key: paste a key (kept only on your computer, in ~/.htmledit/config.json), or set ANTHROPIC_API_KEY. Uses claude-opus-5-5 unless you pick another model.
  • Other agent: any agent CLI that has hotedit's MCP tools, e.g. after gemini mcp add hotedit npx -y hotedit mcp, type gemini -y. The request is added as the last argument (or wherever you put {prompt}).

Change just one thing. With a block selected, the panel says Only changes: … and the AI can edit that block only (for a chart, also the code that draws it). Anything else it tries is rejected. Click another block to point it there, or Whole page to lift the limit. All its changes are normal undo steps.

Your own agent, live (MCP)

Give any coding agent that speaks MCP (Claude Code, Codex, Cursor, Gemini CLI…) hotedit's tools, and it can open a report in your browser and edit it while you watch:

bash
claude mcp add hotedit -- npx -y hotedit mcpcodex mcp add hotedit -- npx -y hotedit mcp

Tools: open (opens the file in hotedit and your browser), outline, read and edit (saved and shown live). The agent finds pages you already have open in hotedit, too.

Skill: your agent's reports open in hotedit by themselves

Install it once. Your agent then writes reports that are easy to edit (text in HTML, chart specs inline), and every HTML report it writes opens in hotedit in your browser automatically, ready to edit. Later edits by the agent show up on the page live.

As a Claude Code plugin (skill, auto-open hook and MCP tools in one go):

/plugin marketplace add Thewhey-Brian/hotedit/plugin install hotedit@hotedit

Or from the command line:

bash
npx hotedit skill install            # Claude Code, all projects (~/.claude)npx hotedit skill install --project  # Claude Code, this project only (./.claude)npx hotedit skill install --codex    # Codex (~/.codex)

This adds the skill and a small hook that runs after the agent writes a file. It ignores files that aren't HTML, pages that belong to an app or website (under src/, public/, node_modules/… or with template tags), and pages already open. The page is served in the background, and the server stops by itself once you've closed it for a while. Your other settings and hooks are left as they are.

  • Skill only, no auto-open: add --no-auto. Pause it for one session: HOTEDIT_AUTO=0.
  • Remove it: npx hotedit skill uninstall (add --codex or --project to match).
  • Codex asks you once to trust the new hook.
  • Other agents: npx hotedit skill print (paste it into AGENTS.md). They open a report with npx -y hotedit open report.html --background, which returns at once.

The skill only shapes how the HTML is written: text in the markup, chart specs inline. It tells the agent never to simplify or leave anything out for the sake of editing.

How it works

report.html ──parse (keeps source positions)──► served copy with element ids + editor overlay     ▲                                                              │     └──────── small byte patch ◄── map your edit back to source ◄──┘
  • Your file is never "re-written". The editor and the element ids exist only in the copy the local server sends to your browser. Each edit becomes a minimal patch on the original bytes. Entities like ·, quote styles, indentation and comments elsewhere stay exactly as they were.
  • Charts are edited in their source. The chart spec literal in the page's <script> is patched value by value, keeping its own quote and key style.
  • Safe by default.
    • A backup is taken when a session starts (~/.htmledit/backups/).
    • Undo and redo cover every change.
    • If the file changes on disk (say, your agent edited it), the page updates in place.
    • Files that aren't UTF-8 are refused rather than corrupted.
    • The server only listens on 127.0.0.1 and checks a per-session token.

FAQ

Does it work on any HTML file? Yes, any local .html file: hand-written, AI-generated, or exported from Jupyter, plotly.py, R Markdown or Quarto. It is tested on pages with KaTeX, Mermaid, inline SVG charts, JavaScript-built dashboards, base64 images and deliberately odd markup.

Will it mess up my file? It is designed not to. Every test page is opened, every editable element is saved unchanged, and the file must stay byte-identical. Each real edit must produce exactly the expected diff.

Does it need the internet? No, hotedit runs locally. Your page may load its own libraries from a CDN, as many AI reports load KaTeX or Plotly.

Which browsers? Any modern browser. Automated tests run in Chromium.

Can I edit content that a script builds? Use ⋯ → Edit HTML on the script's block, or ask the AI with ✨.

Limitations

  • One HTML file at a time. External .css and .js files are not edited, and styles are written as inline style attributes.
  • Chart specs must be literals in an inline <script> (directly, or through const spec = {...}). Specs computed at runtime or loaded from separate files open as source.
  • Undo history lasts for the session. Backups persist.

Development

bash
git clone https://github.com/Thewhey-Brian/hotedit && cd hoteditnpm installnpx playwright install chromium   # browser for the end-to-end testsnpm test                          # unit, CLI and real-browser tests (~3 min)node demo/audio.mjs               # tour narration, sound effects, music (ElevenLabs key)node demo/record.js               # re-record the tour video + GIF (needs ffmpeg)

See CONTRIBUTING.md and docs/ARCHITECTURE.md.

Get involved

hotedit is young and contributions are very welcome. Good places to start:

Roadmap: more chart libraries (ECharts, Observable Plot, Bokeh), editing external CSS, a VS Code extension, and guides for more agents (Gemini CLI, Cursor, OpenCode).

Related tools

  • html-visual-editor has a nice touch-up UI, but downloads a new file and has no chart editing.
  • Lavish has a great agent feedback loop, but you can't edit the page yourself.
  • GrapesJS, VvvebJs and Pinegrow are full page builders that re-serialise documents.
  • document.designMode saves whatever the scripts rendered.

License

MIT

來源:README.md,提交 bc0a798

工具

4

open

Open an HTML file in hotedit so the person can watch and edit it in their browser. Returns the page URL. Call this before outline/read/edit when the page isn't open yet.

輸入參數file必填browser

outline

List the elements of the page as an indented tree: [id] tag#id.class “text…”. Use the ids with read. Ids change when elements are added, removed or moved, so call outline again after such edits.

輸入參數file

read

The exact HTML source of one element (by id from outline), as it is in the file. Copy text from here into edit's `find`. Long data: URLs are shortened and can't be edited.

輸入參數id必填file

edit

Replace text in the HTML file: `find` must appear exactly once (add surrounding context to make it unique) unless `all` is true. The change is saved and shown to the user immediately. Use it for text, attributes, styles, inserted or removed elements, and chart data in <script> blocks.

輸入參數allfilefind必填replace必填

版本歷史

1
  1. v0.5.0最新Oct 22, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分