技能图谱SKILLSGROVE
技能图谱/效率工具/kiki123124/x2o/x2o

x2o

安装

$npx skills add https://github.com/kiki123124/x2o --skill x2o
$git clone --depth 1 https://github.com/kiki123124/x2o.git /tmp/x2o && mkdir -p ~/.claude/skills && cp -r /tmp/x2o/. ~/.claude/skills/x2o
请帮我安装这个 Agent Skill:https://github.com/kiki123124/x2o/tree/372342f8a2449f54e685412ed57c0868e1734ab5/ ,先阅读它的 SKILL.md 和脚本,确认安全后再安装到我的技能目录。

简介

原文描述 · MITExport X (Twitter) bookmarks, classify them with AI, and generate an Obsidian knowledge vault. USE FOR: - Exporting X/Twitter bookmarks to local files - AI-powered bookmark classification and summarization - Generating Obsidian-compatible markdown knowledge bases - Batch processing bookmarks from JSON exports - Resolving t.co short URLs to real URLs - Fetching full content from X Notes (long-form tweets) - Reclassifying existing markdown vaults with a different AI TRIGGERS: - "导出书签", "export bookmarks", "X 书签", "x2o", "书签分类" - "twitter bookmarks", "obsidian vault from bookmarks" - "classify my bookmarks", "organize bookmarks"
以下 SKILL.md 内容转载自 kiki123124/x2o(提交 372342f),依据 MIT 许可证转载正文(文字未改动;仅省略文件头元数据、将图片显示为链接,超长内容会截断);版权归 2026 TweetVault Contributors 所有。许可证:LICENSE。仅展示说明文件,附带脚本请在原仓库查看。

x2o — X Bookmark Export + AI Classification

Export X (Twitter) bookmarks → AI classify → Obsidian knowledge vault. All local, no third-party servers.

What's New (v0.5.0)

  • Host AI classification: use --provider host — no API key needed, the host AI (Claude Code / OpenClaw) classifies bookmarks directly
  • Standalone reclassify: pick existing output folder, reclassify with different AI
  • t.co short URLs automatically resolved to real URLs
  • X Notes (long-form tweets) full content extraction

Usage

Host AI Classification (no API key needed)

The host AI (Claude Code, OpenClaw, etc.) can classify bookmarks directly — no external API key required:

npx tsx ~/.claude/skills/x2o/scripts/x2o.ts \
  --cookie "<X cookie string>" \
  --provider host \
  --output ~/x2o-output \
  --limit 100

This fetches bookmarks and saves bookmarks.json. The host AI then reads the bookmarks, classifies them, and generates the Obsidian vault.

External AI Provider (with API key)

npx tsx ~/.claude/skills/x2o/scripts/x2o.ts \
  --cookie "<X cookie string>" \
  --provider openai \
  --api-key "sk-..." \
  --output ~/x2o-output \
  --limit 100

# Other providers:
# --provider claude  --api-key "sk-ant-..."
# --provider deepseek --api-key "sk-..."
# --provider gemini  --api-key "..."
# --provider ollama  --model llama3.2   (local, no api-key needed)

Re-classify existing bookmarks (skip fetching):

npx tsx ~/.claude/skills/x2o/scripts/x2o.ts \
  --input ~/x2o-output \
  --provider host \
  --output ~/x2o-output

Rebuild from Markdown vault and re-classify:

npx tsx ~/.claude/skills/x2o/scripts/x2o.ts \
  --md-dir ~/x2o-output \
  --provider host \
  --output ~/x2o-output

Parameters

Flag Required Description
--cookie Yes* X browser cookie (must contain ct0)
--input Yes* Path to existing bookmarks JSON or output folder (alternative to cookie)
--reclassify No Alias of --input
--md-dir No Path to a Markdown vault folder
--provider No AI provider: host (no API key), openai, claude, deepseek, gemini, ollama, groq, moonshot, qwen, zhipu, siliconflow, mistral, together, fireworks, xai, openrouter, cohere, deepinfra, perplexity
--api-key No** API key for the chosen provider
--output No Output directory (default: ~/x2o-output)
--limit No Max bookmarks to fetch (default: 800)
--model No Override default model for the provider
--base-url No Override API base URL
--fetch-only No Only fetch bookmarks, skip classification

* One of --cookie or --input is required ** Not required for host (uses host AI) or ollama (local)

Workflow for Claude

When user wants to export bookmarks:

  1. Ask for their X cookie (guide them: F12 → Network → find any request → copy Cookie header)
  2. Default to --provider host — no API key needed, you classify the bookmarks yourself
  3. If user provides an API key, use the corresponding external provider instead
  4. Run the script with appropriate parameters
  5. For host mode: after the script saves bookmarks.json, read the file, classify each bookmark into categories (AI, Design, Crypto, Business, Career, Finance, Life, Tech, Media, News, etc.), and generate Obsidian vault markdown files
  6. Report results: how many bookmarks fetched, categories found, files generated
  7. Optionally open the output in Obsidian: open "obsidian://open?path=<output-dir>"

Supported AI Providers (19+)

Host AI (no API key), OpenAI, Claude, DeepSeek, Gemini, Ollama, OpenRouter, Moonshot, Qwen, Zhipu GLM, SiliconFlow, Groq, Mistral, Together AI, Fireworks, Grok (xAI), Cohere, DeepInfra, Perplexity

Source

GitHub: https://github.com/kiki123124/x2o

查看许可证全文(MIT)
MIT License

Copyright (c) 2026 TweetVault Contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.