关于 csctf
CSCTF 是一个命令行工具,可将 AI 对话分享链接转换为 Markdown 和静态 HTML,适合归档或发布对话内容的用户。它保留代码围栏、生成稳定文件名,并可选择发布到 GitHub Pages。
主要功能
- 01转换 ChatGPT、Gemini、Grok 和 Claude 分享链接
- 02生成保留代码围栏的 Markdown
- 03生成带目录和语法高亮的静态 HTML
- 04支持输出格式、路径和日志选项
- 05可发布到 GitHub Pages
适用场景
- 01将分享的 AI 对话保存为 Markdown 文件
- 02生成便于浏览和分享的静态 HTML
- 03批量归档多个对话链接
- 04将对话归档发布到 GitHub Pages
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ dicklesworthstone/ agent_flywheel_clawdbot_skills_and_integrations --skill csctf安装后在 Claude Code 中输入/csctf确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
references/ALGORITHMS.mdCOMMANDS.mdGITHUB-PAGES.md详细介绍
CSCTF — 聊天共享对话转文件
核心功能: 将 AI 分享链接转换为简洁的 Markdown + HTML,保留代码围栏、使用稳定的文件名,并可选择发布到 GitHub Pages。
快速开始
# Install
curl -fsSL https://raw.githubusercontent.com/Dicklesworthstone/chat_shared_conversation_to_file/main/install.sh | bash
# Convert any share link
csctf https://chatgpt.com/share/69343092-91ac-800b-996c-7552461b9b70
输出:
<conversation_title>.md— 保留代码围栏的简洁 Markdown<conversation_title>.html— 样式化的静态 HTML(零 JavaScript)
精确提示词 — 转换分享链接
Convert this conversation to Markdown:
csctf <share-url>
# Example providers:
csctf https://chatgpt.com/share/69343092-91ac-800b-996c-7552461b9b70
csctf https://gemini.google.com/share/66d944b0e6b9
csctf https://grok.com/share/bGVnYWN5_d5329c61-f497-40b7-9472-c555fa71af9c
csctf https://claude.ai/share/549c846d-f6c8-411c-9039-a9a14db376cf
精确提示词 — 发布到 GitHub Pages
# Publish with defaults (creates repo if needed)
csctf <url> --publish-to-gh-pages --yes
# Save settings for future use
csctf <url> --publish-to-gh-pages --remember --yes
# Subsequent: just use --yes
csctf <url> --yes
# Custom repo
csctf <url> --publish-to-gh-pages \
--gh-pages-repo myuser/my-chats \
--gh-pages-branch main \
--yes
精确提示词 — 批量归档
# Archive multiple conversations
for url in $URLS; do
csctf "$url" --outfile ~/archive/ --quiet
done
# Markdown only (faster, smaller)
csctf <url> --md-only --quiet
# HTML only for embedding
csctf <url> --html-only --outfile site/chat.html
支持的提供商
| 提供商 | URL 模式 | 方法 |
|---|---|---|
| ChatGPT | chatgpt.com/share/* | 无头 Chromium |
| Gemini | gemini.google.com/share/* | 无头 Chromium |
| Grok | grok.com/share/* | 无头 Chromium |
| Claude | claude.ai/share/* | 你的 Chrome 会话 |
Claude.ai 特殊处理
Claude.ai 使用 Cloudflare 保护。CSCTF 会自动处理:
- 将你的 Chrome 会话 Cookie 复制到临时配置文件
- 使用远程调试启动 Chrome
- 通过 Chrome DevTools Protocol 提取对话
要求: 已安装 Chrome,并已登录 claude.ai
常用命令
| 标志 | 说明 |
|---|---|
--outfile <path> | 覆盖输出路径 |
--md-only | 跳过 HTML 输出 |
--html-only | 跳过 Markdown 输出 |
--quiet | 最少日志 |
--timeout-ms <ms> | 导航超时时间(默认:60000) |
--publish-to-gh-pages | 发布到 GitHub Pages |
--yes | 跳过确认提示 |
输出格式
Markdown
# Conversation: <Title>
**Source:** https://chatgpt.com/share/...
**Retrieved:** 2026-01-08T15:30:00Z
## User
How do I sort an array in Python?
## Assistant
Here's how to sort:
```python
my_list.sort()
### HTML Features
- **Zero JavaScript** — Safe for any hosting
- **Inline CSS** — Light/dark mode via `prefers-color-scheme`
- **Syntax highlighting** — highlight.js themes inline
- **Table of contents** — Auto-generated from headings
---
## Filename Generation
“如何构建 REST API” → how_to_build_a_rest_api.md “Python 技巧与诀窍!” → python_tips_tricks.md “文件已存在” → file_exists_already_2.md
Rules: lowercase, non-alphanumerics → `_`, max 120 chars, collision suffix
---
## Performance
| Phase | Time |
|-------|------|
| First run (Chromium download) | 30-60s |
| Subsequent runs | 5-15s |
| Claude.ai (uses local Chrome) | 5-10s |
---
## Troubleshooting
| Symptom | Fix |
|---------|-----|
| "No messages found" | Link is private; verify public share |
| Bot detection | Retry; verify link in browser |
| Timeout | Raise `--timeout-ms 90000` |
| Publish fails (auth) | Ensure `gh auth status` passes |
| Claude.ai Cloudflare | Complete verification in Chrome window |
---
## Installation
```bash
# One-liner
curl -fsSL https://raw.githubusercontent.com/Dicklesworthstone/chat_shared_conversation_to_file/main/install.sh | bash
# Pin version
VERSION=v1.0.0 curl -fsSL .../install.sh | bash
# Verify checksum
curl -fsSL .../install.sh | bash -s -- --verify
参考资料
| 主题 | 参考资料 |
|---|---|
| 完整命令参考 | COMMANDS.md |
| 处理算法 | ALGORITHMS.md |
| GitHub Pages 设置 | GITHUB-PAGES.md |
评论
支持 Markdown