Loading...
Loading...
Compare original and translation side by side
scripts/SKILL_DIR${SKILL_DIR}/scripts/main.tsscripts/SKILL_DIR${SKILL_DIR}/scripts/main.tsundefinedundefined
**Step 2**: If `accepted: true` and `disclaimerVersion: "1.0"` → print warning and proceed:
**Step 3**: If missing or version mismatch → display disclaimer:
Use `AskUserQuestion` with options: "Yes, I accept" | "No, I decline"
**Step 4**: On accept → create consent file:
```json
{
"version": 1,
"accepted": true,
"acceptedAt": "<ISO timestamp>",
"disclaimerVersion": "1.0"
}
**步骤2**: 如果`accepted: true`且`disclaimerVersion: "1.0"` → 打印警告并继续:
**步骤3**: 如果文件缺失或版本不匹配 → 显示免责声明:
使用`AskUserQuestion`,选项: "Yes, I accept" | "No, I decline"
**步骤4**: 用户同意后 → 创建同意文件:
```json
{
"version": 1,
"accepted": true,
"acceptedAt": "<ISO timestamp>",
"disclaimerVersion": "1.0"
}undefinedundefined
┌────────────────────────────────────────────────────────────┬───────────────────┐
│ Path │ Location │
├────────────────────────────────────────────────────────────┼───────────────────┤
│ .canghe-skills/canghe-danger-x-to-markdown/EXTEND.md │ Project directory │
├────────────────────────────────────────────────────────────┼───────────────────┤
│ $HOME/.canghe-skills/canghe-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
┌────────────────────────────────────────────────────────────┬───────────────────┐
│ 路径 │ 位置 │
├────────────────────────────────────────────────────────────┼───────────────────┤
│ .canghe-skills/canghe-danger-x-to-markdown/EXTEND.md │ 项目目录 │
├────────────────────────────────────────────────────────────┼───────────────────┤
│ $HOME/.canghe-skills/canghe-danger-x-to-markdown/EXTEND.md │ 用户主目录 │
└────────────────────────────────────────────────────────────┴───────────────────┘
┌───────────┬───────────────────────────────────────────────────────────────────────────┐
│ 结果 │ 操作 │
├───────────┼───────────────────────────────────────────────────────────────────────────┤
│ 找到 │ 读取、解析、应用设置 │
├───────────┼───────────────────────────────────────────────────────────────────────────┤
│ 未找到 │ **必须**运行首次设置(见下文)—— 不得静默创建默认设置 │
└───────────┴───────────────────────────────────────────────────────────────────────────┘
**EXTEND.md支持**: 默认下载媒体 | 默认输出目录AskUserQuestionAskUserQuestionAskUserQuestionAskUserQuestion| Key | Default | Values | Description |
|---|---|---|---|
| | | |
| empty | path or empty | Default output directory (empty = |
--download-media-o| 配置项 | 默认值 | 可选值 | 描述 |
|---|---|---|---|
| | | |
| 空 | 路径或空 | 默认输出目录(空 = |
--download-media-onpx -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> --jsonnpx -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 |
|---|---|
| Tweet or article URL |
| Output path |
| JSON output |
| Download image/video assets to local |
| Refresh cookies only |
| 选项 | 描述 |
|---|---|
| 推文或文章URL |
| 输出路径 |
| JSON格式输出 |
| 将图片/视频资源下载到本地 |
| 仅刷新Cookie |
https://x.com/<user>/status/<id>https://twitter.com/<user>/status/<id>https://x.com/i/article/<id>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}.md--download-mediaimgs/videos/---
url: "https://x.com/user/status/123"
author: "Name (@user)"
tweetCount: 3
coverImage: "https://pbs.twimg.com/media/example.jpg"
---
内容...x-to-markdown/{username}/{tweet-id}.md--download-mediaimgs/videos/download_media| Setting | Behavior |
|---|---|
| Run script with |
| Run script without |
| Follow the ask-each-time flow below |
download_media| 设置值 | 行为 |
|---|---|
| 使用 |
| 不使用 |
| 遵循下方的每次询问流程 |
--download-mediahttps://AskUserQuestion--download-media--download-mediahttps://AskUserQuestion--download-mediaX_AUTH_TOKENX_CT0X_AUTH_TOKENX_CT0