JAICHANGPARK/html-preview
html-preview
HTML을 브라우저처럼 보여 주는 Claude Code mod입니다. Claude가 `.html` 파일을 쓰거나 편집하면 페이지가 바로 열려 생성된 보고서나 계획을 브라우저 페이지처럼 읽을 수 있습니다.
이 mod 소개
Claude가 작성한 HTML 파일(또는 /preview <file>)을 브라우저처럼 보여 줍니다. terminal-browser가 설치되어 있으면 이를 사용하고, 아니면 내장 Chrome 렌더링 창을 사용합니다. .html 파일을 Write/Edit할 때 자동으로 열기, 파일이나 URL을 수동으로 미리 보는 /preview, /config 또는 settings.json을 통한 모드(auto, pane, split, builtin)설정을 지원합니다.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add JAICHANGPARK/html-preview claude plugin install html-preview
원문 / README
html-preview
A Claude Code mod that shows HTML like a browser. When Claude writes or edits a .html file, the page opens right away, so a generated report or plan reads like a page in a browser.
By default the page shows in a Claude Code pane: the terminal-browser plugin's pane when that is installed, otherwise a built-in renderer that takes a screenshot of the page with headless Chrome. Set mode to split to open terminal-browser in a terminal split instead.
Claude가 .html 파일을 만들거나 수정하면 브라우저처럼 바로 보여 주는 Claude Code mod입니다. 기본으로 Claude Code pane 안에 보여 줍니다: terminal-browser 플러그인이 있으면 그 pane, 없으면 내장 렌더러(headless Chrome 스크린샷). 터미널 분할 창의 terminal-browser로 열려면 mode를 split으로 바꾸세요.
Requirements
- Claude Code v2.1.287 or later (
claude --version). Mods are on by default. - A terminal with the kitty graphics protocol, such as Ghostty or kitty.
- One of these:
- Google Chrome, Chromium, Edge or Brave, for the built-in renderer. Nothing else to install.
- terminal-browser, for a real, interactive browser.
Install
- Add the marketplace and install the plugin:
Or, inside Claude Code:claude plugin marketplace add JAICHANGPARK/html-preview claude plugin install html-preview@html-preview/plugin marketplace add JAICHANGPARK/html-preview, then/plugin install html-preview@html-preview. - If a session is already open, run
/reload-pluginsin it. Otherwise the mod loads the next time you start Claude Code. - Check that it loaded:
/pluginshowsmod active · html-previewunder the tabs, and/previewprintsUsage: /preview <file.html | url> · /preview setup. - Optional, for an interactive browser instead of a screenshot:
brew install terminal-browser # or: curl -fsSL https://terminal-browser.sh/install | bash # the pane inside Claude Code: claude plugin marketplace add zenbu-labs/terminal-browser claude plugin install terminal-browser@terminal-browser
Update and uninstall:
claude plugin marketplace update html-preview # get the latest version
claude plugin uninstall html-preview@html-preview
Usage
Auto: Claude writes HTML
Ask Claude for a page, for example:
Write a one-page HTML report of this repo's structure to
report.html.
When the Write or Edit tool saves a *.html / *.htm file, the page opens. Each later edit opens it again, so you see the new version. Set autoOpen to false to stop this.
Manual: /preview
| Command | What it does |
| --- | --- |
| /preview report.html | Shows a file. A relative path resolves against the session's working directory. |
| /preview https://example.com | Shows a URL. |
| /preview | Shows the last page again. Before any page, it prints the usage. |
| /preview setup | Checks for terminal-browser. If it is missing and Homebrew is installed, it asks before it runs brew install terminal-browser. |
In the built-in pane
| Key | Button | Action |
| --- | --- | --- |
| k | ↑ | Scroll up 600px |
| j | ↓ | Scroll down 600px |
| t | top | Go to the top |
| r | reload | Render again |
| x | close | Close the pane |
When terminal-browser is not installed
- In
automode, the built-in renderer's pane shows the page. Nothing is asked. - In
splitorpanemode, the transcript shows one line with the install command at session start. When a page should open, the mod asks if it can install terminal-browser with Homebrew. It never installs without asking. Without Homebrew, or if you say no, it shows the commands:brew install terminal-browser # or curl -fsSL https://terminal-browser.sh/install | bash
설치 방법 (한국어)
- 마켓플레이스를 추가하고 플러그인을 설치합니다:
claude plugin marketplace add JAICHANGPARK/html-preview claude plugin install html-preview@html-preview - 이미 열린 세션이 있으면
/reload-plugins를 실행합니다. 아니면 다음에 Claude Code를 시작할 때 로드됩니다. /plugin화면에mod active · html-preview가 보이고,/preview를 입력해 사용법 안내가 나오면 설치된 것입니다.- (선택) 클릭·스크롤이 되는 실제 브라우저가 필요하면
brew install terminal-browser로 terminal-browser를 설치합니다.
필요한 것: Claude Code v2.1.287 이상(mod는 기본으로 켜져 있음), kitty 그래픽 프로토콜을 지원하는 터미널(Ghostty, kitty)과 Chrome·Chromium·Edge·Brave 중 하나, 또는 terminal-browser.
업데이트: claude plugin marketplace update html-preview · 삭제: claude plugin uninstall html-preview@html-preview
사용 방법 (한국어)
- 자동: Claude가
Write/Edit도구로.html/.htm파일을 저장하면 페이지가 바로 열립니다. 다시 수정하면 새 버전으로 다시 열립니다. 예: "이 저장소 구조를report.html한 페이지 리포트로 만들어 줘." - 수동:
/preview report.html(파일),/preview https://example.com(URL),/preview(마지막 페이지 다시 보기),/preview setup(terminal-browser 확인·설치. 설치 전에 먼저 물어봅니다) - 내장 pane: 마우스 휠·트랙패드로 페이지 스크롤(스크롤할 때마다 다시 렌더링해서 1초쯤 걸림),
k/j위·아래 스크롤,t맨 위,r다시 렌더링,x닫기 - 설정:
/config에서mode(auto,pane,split,builtin),split방향,autoOpen,chromePath를 바꿀 수 있습니다.
auto 모드에서 terminal-browser가 없으면 내장 렌더러로 보여 줍니다. split/pane 모드에서는 설치 안내를 띄우고, Homebrew로 설치할지 먼저 물어봅니다. 묻지 않고 설치하지는 않습니다.
How it shows the page
| mode | Behaviour |
| --- | --- |
| auto (default) | Keeps the page inside Claude Code. Tries, in order: the terminal-browser plugin's pane ($.browser.open), the built-in renderer's pane when Chrome is installed, then a terminal split with terminal-browser open <file> --split <dir>. |
| pane | Uses only the terminal-browser plugin's pane. |
| split | Uses only the CLI split. |
| builtin | Uses only the built-in renderer, even when terminal-browser is installed. |
The built-in renderer
- Headless Chrome renders the page 1280px wide, at a height that fits the pane, and the pane draws the screenshot with the kitty graphics protocol.
- The mouse wheel or trackpad over the pane scrolls the page. Each scroll renders again, so it takes about a second to catch up.
- Buttons in the pane:
↑(k) and↓(j) scroll by 600px,top(t),reload(r),close(x). - Each save of the file renders it again.
- It is a picture: links, forms and scripts that need clicks do not work. Use terminal-browser for that.
- Without Chrome, or on a surface that cannot draw images (the desktop app), the pane shows the page as text.
/previewwith no argument shows the last page again.
Options
Set the options in /config, or in ~/.claude/settings.json:
{
"pluginConfigs": {
"html-preview@html-preview": {
"options": { "mode": "auto", "split": "right", "autoOpen": true, "chromePath": "" }
}
}
}
| Option | Values | Default |
| --- | --- | --- |
| mode | auto, pane, split, builtin | auto |
| split | right, left, down, up | right |
| autoOpen | true, false | true |
| chromePath | path to a Chrome/Chromium binary | empty: found automatically |
Development
claude plugin validate .
claude plugin test .
claude --plugin-dir . # load this checkout in a session
Mods need Claude Code v2.1.287 or later. If you set CLAUDE_CODE_ENABLE_FUNCTION_HOOKS during early access, remove it: Claude Code ignores it now.
License
MIT
