Live Markdown Viewer
Live markdown viewer for AI pair-editing. When you collaborate, the updates render instantly. Works with any AI agent and web browser.
GitHub: wipcomputer/wip-markdown-viewer
npm: @wipcomputer/markdown-viewer
Install
CODEBLOCK0
This installs the mdview command globally. Zero runtime dependencies. Pure Node.js.
Quick start
Start the server (binds to 127.0.0.1 only, never exposed to the network):
CODEBLOCK1
Open a file in your default browser:
CODEBLOCK2
How it works
- 1. Tell your AI coding tool to install
@wipcomputer/markdown-viewer globally - Tell your AI to open a .md file in md view
- AI opens the file in your default browser
- Every save re-renders the page instantly. No refresh needed.
Open multiple tabs to work on multiple documents at once.
Security
- - Server binds to
127.0.0.1 only. It is not accessible from other machines. - The
/view?path= parameter reads files from your local filesystem. Use --root <dir> to restrict access to a specific directory tree. Recommended for shared environments. - Zero npm dependencies. No supply chain risk beyond Node.js itself.
Features
- - SSE-powered live reload (works in Safari, Chrome, Firefox)
- Multi-file support (each tab watches its own file)
- GitHub Flavored Markdown (tables, task lists, strikethrough)
- Syntax highlighting (180+ languages)
- Dark mode
- Table of contents
- Mermaid diagrams
- KaTeX math equations
Troubleshooting
Page shows the index instead of my file: The server was started with --root restricting access. Restart without --root.
Safari stalls or shows blank page: Hard refresh (Cmd+Shift+R) or restart the server. Safari caches SSE connections aggressively.
macOS open drops the query string: Use AppleScript instead:
CODEBLOCK3
Notes
- - Server runs at
http://127.0.0.1:3000 by default. Use mdview --port 8080 to change. - The server does not survive reboots. The curl check in quick start restarts it if needed.
- Do NOT start the server with a file path argument. Always start bare (
mdview). Starting with a path locks the server to that directory. - Drag and drop any .md file onto the homepage to view it.
- Zero external requests. All dependencies bundled locally.
实时 Markdown 查看器
用于 AI 结对编辑的实时 Markdown 查看器。协作时,更新会即时渲染。兼容任何 AI 代理和网页浏览器。
GitHub:wipcomputer/wip-markdown-viewer
npm:@wipcomputer/markdown-viewer
安装
bash
npm install -g @wipcomputer/markdown-viewer
这将全局安装 mdview 命令。零运行时依赖。纯 Node.js 实现。
快速开始
启动服务器(仅绑定到 127.0.0.1,永不暴露到网络):
bash
curl -s http://127.0.0.1:3000/ > /dev/null 2>&1 || mdview &
在默认浏览器中打开文件:
bash
macOS
open http://127.0.0.1:3000/view?path=/absolute/path/to/file.md
Linux
xdg-open http://127.0.0.1:3000/view?path=/absolute/path/to/file.md
Windows
start http://127.0.0.1:3000/view?path=/absolute/path/to/file.md
工作原理
- 1. 告诉你的 AI 编码工具全局安装 @wipcomputer/markdown-viewer
- 告诉你的 AI 在 md 视图中打开一个 .md 文件
- AI 在默认浏览器中打开该文件
- 每次保存都会即时重新渲染页面。无需刷新。
可同时打开多个标签页处理多个文档。
安全性
- - 服务器仅绑定到 127.0.0.1。其他机器无法访问。
- /view?path= 参数从本地文件系统读取文件。使用 --root 可将访问限制在特定目录树内。建议在共享环境中使用。
- 零 npm 依赖。除 Node.js 本身外无供应链风险。
功能特性
- - 基于 SSE 的实时加载(兼容 Safari、Chrome、Firefox)
- 多文件支持(每个标签页监控自己的文件)
- GitHub 风格 Markdown(表格、任务列表、删除线)
- 语法高亮(支持 180+ 种语言)
- 深色模式
- 目录生成
- Mermaid 图表
- KaTeX 数学公式
故障排除
页面显示索引而非我的文件: 服务器以 --root 参数启动限制了访问。请不带 --root 重新启动。
Safari 卡住或显示空白页面: 强制刷新(Cmd+Shift+R)或重启服务器。Safari 会激进地缓存 SSE 连接。
macOS 的 open 命令丢弃查询字符串: 改用 AppleScript:
bash
osascript -e tell application Safari to open location http://127.0.0.1:3000/view?path=/your/file.md
注意事项
- - 服务器默认运行在 http://127.0.0.1:3000。使用 mdview --port 8080 更改端口。
- 服务器不会在重启后保持运行。快速启动中的 curl 检查会在需要时重新启动它。
- 不要使用文件路径参数启动服务器。始终以裸命令启动(mdview)。带路径启动会将服务器锁定到该目录。
- 将任意 .md 文件拖放到主页即可查看。
- 零外部请求。所有依赖项本地打包。