重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
tuzi-danger-x-to-markdown by tuziapi/tuzi-skills
npx skills add https://github.com/tuziapi/tuzi-skills --skill tuzi-danger-x-to-markdown将 X 内容转换为 Markdown:
脚本位于 scripts/ 子目录中。
路径解析 :
SKILL_DIR = 此 SKILL.md 文件所在的目录${SKILL_DIR}/scripts/main.ts在进行任何转换之前,检查并获取同意。
步骤 1:检查同意文件
# macOS
cat ~/Library/Application\ Support/tuzi-skills/x-to-markdown/consent.json
# Linux
cat ~/.local/share/tuzi-skills/x-to-markdown/consent.json
步骤 2:如果 accepted: true 且 → 打印警告并继续:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
disclaimerVersion: "1.0"Warning: Using reverse-engineered X API. Accepted on: <acceptedAt>
步骤 3:如果文件缺失或版本不匹配 → 显示免责声明:
DISCLAIMER
This tool uses a reverse-engineered X API, NOT official.
Risks:
- May break if X changes API
- No guarantees or support
- Possible account restrictions
- Use at your own risk
Accept terms and continue?
使用 AskUserQuestion 并提供选项:"Yes, I accept" | "No, I decline"
步骤 4:接受后 → 创建同意文件:
{
"version": 1,
"accepted": true,
"acceptedAt": "<ISO timestamp>",
"disclaimerVersion": "1.0"
}
步骤 5:拒绝后 → 输出 "User declined. Exiting." 并停止。
使用 Bash 检查 EXTEND.md 是否存在(优先级顺序):
# 首先检查项目级别
test -f .tuzi-skills/tuzi-danger-x-to-markdown/EXTEND.md && echo "project"
# 然后检查用户级别(跨平台:$HOME 在 macOS/Linux/WSL 上均有效)
test -f "$HOME/.tuzi-skills/tuzi-danger-x-to-markdown/EXTEND.md" && echo "user"
┌────────────────────────────────────────────────────────────┬───────────────────┐ │ 路径 │ 位置 │ ├────────────────────────────────────────────────────────────┼───────────────────┤ │ .tuzi-skills/tuzi-danger-x-to-markdown/EXTEND.md │ 项目目录 │ ├────────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.tuzi-skills/tuzi-danger-x-to-markdown/EXTEND.md │ 用户主目录 │ └────────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐ │ 结果 │ 操作 │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 找到 │ 读取、解析、应用设置 │ ├───────────┼───────────────────────────────────────────────────────────────────────────┤ │ 未找到 │ 必须 运行首次设置(见下文)— 切勿静默创建默认值 │ └───────────┴───────────────────────────────────────────────────────────────────────────┘
EXTEND.md 支持:默认下载媒体 | 默认输出目录
关键:当找不到 EXTEND.md 时,在创建 EXTEND.md 之前,必须使用 AskUserQuestion 询问用户的偏好设置。切勿在不询问的情况下创建带有默认值的 EXTEND.md。这是一个阻塞式操作 — 在设置完成之前,不要进行任何转换。
使用 AskUserQuestion 并在一次调用中提出所有问题:
问题 1 — 标题:"Media",问题:"如何处理推文中的图片和视频?"
问题 2 — 标题:"Output",问题:"默认输出目录?"
问题 3 — 标题:"Save",问题:"偏好设置保存在哪里?"
用户回答后,在所选位置创建 EXTEND.md,确认"偏好设置已保存到 [路径]",然后继续。
| 键 | 默认值 | 值 | 描述 |
|---|---|---|---|
download_media | ask | ask / 1 / 0 | ask = 每次提示,1 = 总是下载,0 = 从不 |
default_output_dir | 空 | 路径或空 | 默认输出目录(空 = ./x-to-markdown/) |
值优先级:
--download-media, -o)npx -y bun ${SKILL_DIR}/scripts/main.ts <url>
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> -o output.md
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> --download-media
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> --json
| 选项 | 描述 |
|---|---|
<url> | 推文或文章 URL |
-o <path> | 输出路径 |
--json | JSON 输出 |
--download-media | 将图片/视频资源下载到本地的 imgs/ 和 videos/ 目录,并将 Markdown 链接重写为本地相对路径 |
--login | 仅刷新 cookie |
https://x.com/<user>/status/<id>https://twitter.com/<user>/status/<id>https://x.com/i/article/<id>---
url: "https://x.com/user/status/123"
author: "Name (@user)"
tweetCount: 3
coverImage: "https://pbs.twimg.com/media/example.jpg"
---
Content...
文件结构:x-to-markdown/{username}/{tweet-id}/{content-slug}.md
当启用 --download-media 时:
imgs/ 目录videos/ 目录基于 EXTEND.md 中的 download_media 设置:
| 设置 | 行为 |
|---|---|
1(总是) | 使用 --download-media 标志运行脚本 |
0(从不) | 不使用 --download-media 标志运行脚本 |
ask(默认) | 遵循下面的每次询问流程 |
--download-media → Markdown 保存https://)AskUserQuestion:
--download-media(用本地化链接覆盖 Markdown 文件)X_AUTH_TOKEN, X_CT0通过 EXTEND.md 进行自定义配置。有关路径和支持的选项,请参阅偏好设置部分。
每周安装次数
66
仓库
GitHub Stars
24
首次出现
2026年3月5日
安全审计
安装于
openclaw52
opencode39
gemini-cli39
github-copilot39
amp39
cline39
Converts X content to markdown:
Scripts located in scripts/ subdirectory.
Path Resolution :
SKILL_DIR = this SKILL.md's directory${SKILL_DIR}/scripts/main.tsBefore any conversion , check and obtain consent.
Step 1 : Check consent file
# macOS
cat ~/Library/Application\ Support/tuzi-skills/x-to-markdown/consent.json
# Linux
cat ~/.local/share/tuzi-skills/x-to-markdown/consent.json
Step 2 : If accepted: true and disclaimerVersion: "1.0" → print warning and proceed:
Warning: Using reverse-engineered X API. Accepted on: <acceptedAt>
Step 3 : If missing or version mismatch → display disclaimer:
DISCLAIMER
This tool uses a reverse-engineered X API, NOT official.
Risks:
- May break if X changes API
- No guarantees or support
- Possible account restrictions
- Use at your own risk
Accept terms and continue?
Use AskUserQuestion with options: "Yes, I accept" | "No, I decline"
Step 4 : On accept → create consent file:
{
"version": 1,
"accepted": true,
"acceptedAt": "<ISO timestamp>",
"disclaimerVersion": "1.0"
}
Step 5 : On decline → output "User declined. Exiting." and stop.
Use Bash to check EXTEND.md existence (priority order):
# Check project-level first
test -f .tuzi-skills/tuzi-danger-x-to-markdown/EXTEND.md && echo "project"
# Then user-level (cross-platform: $HOME works on macOS/Linux/WSL)
test -f "$HOME/.tuzi-skills/tuzi-danger-x-to-markdown/EXTEND.md" && echo "user"
┌────────────────────────────────────────────────────────────┬───────────────────┐ │ Path │ Location │ ├────────────────────────────────────────────────────────────┼───────────────────┤ │ .tuzi-skills/tuzi-danger-x-to-markdown/EXTEND.md │ Project directory │ ├────────────────────────────────────────────────────────────┼───────────────────┤ │ $HOME/.tuzi-skills/tuzi-danger-x-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
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 tweets?"
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)npx -y bun ${SKILL_DIR}/scripts/main.ts <url>
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> -o output.md
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> --download-media
npx -y bun ${SKILL_DIR}/scripts/main.ts <url> --json
| Option | Description |
|---|---|
<url> | Tweet or article URL |
-o <path> | Output path |
--json | JSON output |
--download-media | Download image/video assets to local imgs/ and videos/, and rewrite markdown links to local relative paths |
--login |
https://x.com/<user>/status/<id>https://twitter.com/<user>/status/<id>https://x.com/i/article/<id>---
url: "https://x.com/user/status/123"
author: "Name (@user)"
tweetCount: 3
coverImage: "https://pbs.twimg.com/media/example.jpg"
---
Content...
File structure : x-to-markdown/{username}/{tweet-id}/{content-slug}.md
When --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)X_AUTH_TOKEN, X_CT0Custom configurations via EXTEND.md. See Preferences section for paths and supported options.
Weekly Installs
66
Repository
GitHub Stars
24
First Seen
Mar 5, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykWarn
Installed on
openclaw52
opencode39
gemini-cli39
github-copilot39
amp39
cline39
GitHub Actions 官方文档查询助手 - 精准解答 CI/CD 工作流问题
47,200 周安装
| empty |
| path or empty |
Default output directory (empty = ./x-to-markdown/) |
| Refresh cookies only |