tuzi-url-to-markdown by tuziapi/tuzi-skills
npx skills add https://github.com/tuziapi/tuzi-skills --skill tuzi-url-to-markdown通过 Chrome CDP 获取任何 URL 并将 HTML 转换为干净的 Markdown。
重要提示:所有脚本都位于此技能的 scripts/ 子目录中。
智能体执行说明:
SKILL.md 文件的目录路径确定为 SKILL_DIR${SKILL_DIR}/scripts/<script-name>.ts${SKILL_DIR} 替换为实际路径脚本参考:
| 脚本 | 用途 |
|---|---|
scripts/main.ts |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 用于 URL 获取的 CLI 入口点 |
使用 Bash 检查 EXTEND.md 是否存在(优先级顺序):
# 首先检查项目级别
test -f .tuzi-skills/tuzi-url-to-markdown/EXTEND.md && echo "project"
# 然后检查用户级别(跨平台:$HOME 在 macOS/Linux/WSL 上有效)
test -f "$HOME/.tuzi-skills/tuzi-url-to-markdown/EXTEND.md" && echo "user"
┌────────────────────────────────────────────────────────┬───────────────────┐ │ 路径 │ 位置 │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ .tuzi-skills/tuzi-url-to-markdown/EXTEND.md │ 项目目录 │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.tuzi-skills/tuzi-url-to-markdown/EXTEND.md │ 用户主目录 │ └────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ 结果 │ 操作 │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 找到 │ 读取、解析、应用设置 │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 未找到 │ 必须 运行首次设置(见下文)— 切勿静默创建默认值 │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md 支持:默认下载媒体 | 默认输出目录 | 默认捕获模式 | 超时设置
关键:当未找到 EXTEND.md 时,在创建 EXTEND.md 之前,你必须使用 AskUserQuestion 来询问用户的偏好设置。切勿在不询问的情况下使用默认值创建 EXTEND.md。这是一个阻塞式操作 — 在设置完成之前,不要进行任何转换。
使用 AskUserQuestion 一次性提出所有问题:
问题 1 — 标题:"媒体",问题:"如何处理页面中的图片和视频?"
问题 2 — 标题:"输出",问题:"默认输出目录?"
问题 3 — 标题:"保存",问题:"偏好设置保存到哪里?"
用户回答后,在所选位置创建 EXTEND.md,确认"偏好设置已保存到 [路径]",然后继续。
| 键 | 默认值 | 值 | 描述 |
|---|---|---|---|
download_media | ask | ask / 1 / 0 | ask = 每次提示,1 = 总是下载,0 = 从不 |
default_output_dir | 空 | 路径或空 | 默认输出目录(空 = ./url-to-markdown/) |
值优先级:
--download-media, -o)# 自动模式(默认)- 页面加载时捕获
npx -y bun ${SKILL_DIR}/scripts/main.ts <url>
# 等待模式 - 等待用户信号后再捕获
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> --wait
# 保存到特定文件
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> -o output.md
# 将图片和视频下载到本地目录
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> --download-media
| 选项 | 描述 |
|---|---|
<url> | 要获取的 URL |
-o <path> | 输出文件路径(默认:自动生成) |
--wait | 捕获前等待用户信号 |
--timeout <ms> | 页面加载超时时间(默认:30000) |
--download-media | 将图片/视频资源下载到本地的 imgs/ 和 videos/ 目录,并将 Markdown 链接重写为本地相对路径 |
| 模式 | 行为 | 适用场景 |
|---|---|---|
| 自动(默认) | 网络空闲时捕获 | 公开页面,静态内容 |
等待 (--wait) | 用户发出就绪信号时捕获 | 需要登录,懒加载,付费墙 |
等待模式工作流程:
--wait 运行 → 脚本输出 "Press Enter when ready"包含 url、title、description、author、published、captured_at 字段的 YAML 前置元数据,后跟转换后的 Markdown 内容。
url-to-markdown/<domain>/<slug>.md
<slug>:来自页面标题或 URL 路径(短横线分隔,2-6 个单词)<slug>-YYYYMMDD-HHMMSS.md当启用 --download-media 时:
imgs/ 目录videos/ 目录基于 EXTEND.md 中的 download_media 设置:
| 设置 | 行为 |
|---|---|
1(总是) | 使用 --download-media 标志运行脚本 |
0(从不) | 不使用 --download-media 标志运行脚本 |
ask(默认) | 遵循下述每次询问流程 |
--download-media 运行脚本 → Markdown 已保存https://)AskUserQuestion:
--download-media(用本地化链接覆盖 Markdown)| 变量 | 描述 |
|---|---|
URL_CHROME_PATH | 自定义 Chrome 可执行文件路径 |
URL_DATA_DIR | 自定义数据目录 |
URL_CHROME_PROFILE_DIR | 自定义 Chrome 配置文件目录 |
故障排除:未找到 Chrome → 设置 URL_CHROME_PATH。超时 → 增加 --timeout。复杂页面 → 尝试 --wait 模式。
通过 EXTEND.md 进行自定义配置。有关路径和支持的选项,请参阅偏好设置部分。
每周安装数
74
仓库
GitHub 星标数
24
首次出现
2026年3月5日
安全审计
安装于
openclaw58
opencode45
gemini-cli45
github-copilot45
amp45
cline45
Fetches any URL via Chrome CDP and converts HTML to clean markdown.
Important : All scripts are located in the scripts/ subdirectory of this skill.
Agent Execution Instructions :
SKILL_DIR${SKILL_DIR}/scripts/<script-name>.ts${SKILL_DIR} in this document with the actual pathScript Reference :
| Script | Purpose |
|---|---|
scripts/main.ts | CLI entry point for URL fetching |
Use Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .tuzi-skills/tuzi-url-to-markdown/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.tuzi-skills/tuzi-url-to-markdown/EXTEND.md" && echo "user"
┌────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ .tuzi-skills/tuzi-url-to-markdown/EXTEND.md │ Project directory │ ├────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.tuzi-skills/tuzi-url-to-markdown/EXTEND.md │ User home │ └────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ Result │ Action │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Found │ Read, parse, apply settings │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ Not found │ MUST run first-time setup (see below) — do NOT silently create defaults │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md Supports : Download media by default | Default output directory | Default capture mode | Timeout settings
CRITICAL : When EXTEND.md is not found, you MUST useAskUserQuestion to ask the user for their preferences before creating EXTEND.md. NEVER create EXTEND.md with defaults without asking. This is a BLOCKING operation — do NOT proceed with any conversion until setup is complete.
Use AskUserQuestion with ALL questions in ONE call:
Question 1 — header: "Media", question: "How to handle images and videos in pages?"
Question 2 — header: "Output", question: "Default output directory?"
Question 3 — header: "Save", question: "Where to save preferences?"
After user answers, create EXTEND.md at the chosen location, confirm "Preferences saved to [path]", then continue.
Full reference: references/config/first-time-setup.md
| Key | Default | Values | Description |
|---|---|---|---|
download_media | ask | ask / 1 / 0 | ask = prompt each time, 1 = always download, 0 = never |
default_output_dir |
Value priority :
--download-media, -o)# Auto mode (default) - capture when page loads
npx -y bun ${SKILL_DIR}/scripts/main.ts <url>
# Wait mode - wait for user signal before capture
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> --wait
# Save to specific file
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> -o output.md
# Download images and videos to local directories
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> --download-media
| Option | Description |
|---|---|
<url> | URL to fetch |
-o <path> | Output file path (default: auto-generated) |
--wait | Wait for user signal before capturing |
--timeout <ms> | Page load timeout (default: 30000) |
--download-media | Download image/video assets to local imgs/ and videos/, and rewrite markdown links to local relative paths |
| Mode | Behavior | Use When |
|---|---|---|
| Auto (default) | Capture on network idle | Public pages, static content |
Wait (--wait) | User signals when ready | Login-required, lazy loading, paywalls |
Wait mode workflow :
--wait → script outputs "Press Enter when ready"YAML front matter with url, title, description, author, published, captured_at fields, followed by converted markdown content.
url-to-markdown/<domain>/<slug>.md
<slug>: From page title or URL path (kebab-case, 2-6 words)<slug>-YYYYMMDD-HHMMSS.mdWhen --download-media is enabled:
imgs/ next to the markdown filevideos/ next to the markdown fileBased on download_media setting in EXTEND.md:
| Setting | Behavior |
|---|---|
1 (always) | Run script with --download-media flag |
0 (never) | Run script without --download-media flag |
ask (default) | Follow the ask-each-time flow below |
--download-media → markdown savedhttps:// in image/video links)AskUserQuestion:
--download-media (overwrites markdown with localized links)| Variable | Description |
|---|---|
URL_CHROME_PATH | Custom Chrome executable path |
URL_DATA_DIR | Custom data directory |
URL_CHROME_PROFILE_DIR | Custom Chrome profile directory |
Troubleshooting : Chrome not found → set URL_CHROME_PATH. Timeout → increase --timeout. Complex pages → try --wait mode.
Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
Weekly Installs
74
Repository
GitHub Stars
24
First Seen
Mar 5, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
openclaw58
opencode45
gemini-cli45
github-copilot45
amp45
cline45
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
44,900 周安装
Cosmos dbt Fusion 实施指南:在 Airflow 中集成 dbt Fusion 的完整步骤
423 周安装
Docassemble 表单构建器技能 - 创建智能动态问卷与文档生成工具
437 周安装
Pulumi Automation API 教程 - 基础设施即代码自动化编排与部署
431 周安装
Awwwards作品集首页模板 - Next.js + GSAP + Locomotive Scroll 流畅滚动动画实现
429 周安装
TresJS:Vue 3 的 Three.js 框架,声明式构建3D场景
430 周安装
Playwright视觉测试与浏览器自动化工具 - 跨浏览器UI测试与视觉回归检测
430 周安装
| empty |
| path or empty |
Default output directory (empty = ./url-to-markdown/) |