Skip to content

Repository files navigation

Obsidian Clip Bot

Telegram bot that clips URLs and text into Obsidian markdown notes, powered by Claude Code CLI.

Architecture

iPhone / Mac / Anywhere
  → Share URL to Telegram Bot
    → Node.js bot on server
      → Detect source (X/YouTube/Web/...)
      → Pre-extract content
      → Claude CLI generates structured note
      → GitHub API commits to repo
      → Bot replies with .md file
        → Obsidian syncs from GitHub

Prerequisites

  • Node.js >= 18 (or Bun)
  • Claude Code CLI with OAuth token
  • Telegram bot token (from @BotFather)
  • GitHub repo for Obsidian vault with fine-grained PAT (Contents: read/write)
  • yt-dlp (optional, for YouTube transcript extraction)

Quick Start

git clone <this-repo>
cd obsidian-clip-bot
bun install

# Configure environment
cp .env.example .env
# Edit .env with your values

bun start

Environment Variables

Variable Description
TELEGRAM_BOT_TOKEN Bot token from @BotFather
ALLOWED_USER_ID Your Telegram user ID (from @userinfobot)
CLAUDE_CODE_OAUTH_TOKEN Claude Code OAuth token (from claude setup-token)
GITHUB_TOKEN Fine-grained PAT with Contents read/write on your Obsidian repo
GITHUB_REPO GitHub repo in owner/name format (e.g. sskys18/Obsidian)

Supported Sources

Source Detection Extraction
Twitter/X x.com, twitter.com fxtwitter API + linked articles
YouTube youtube.com, youtu.be yt-dlp metadata + subtitles
Substack *.substack.com Readability
Web/Blog Any URL Readability + JSDOM
Plain text No URL detected Passed directly to Claude

Portfolio Setup

To use the /company application generation feature, create a Project/Resume/ folder in your Obsidian vault with your portfolio materials:

Project/Resume/
  projects.md        — project descriptions, tech stack, outcomes
  experience.md      — work history, roles, achievements
  skills.md          — technical + soft skills inventory
  stories.md         — reusable narratives (teamwork, challenges, motivation)
  자기소개서/
    삼성전자_2025.md  — previously submitted cover letters

No strict format required — free-form markdown is fine.

Deployment (pm2)

pm2 start "bun run start" --name clip-bot

How It Works

  1. You send a URL or text to the Telegram bot
  2. Bot detects source type (Twitter, YouTube, web, etc.)
  3. Content is pre-extracted using source-specific methods
  4. Extracted content is sent to Claude CLI with a structured prompt
  5. Claude returns {filename, content} JSON via --json-schema
  6. Note is committed to Resource/inbox/ via GitHub Contents API
  7. Bot replies with the .md file as a document attachment
  8. Bot confirms with filename and path

Maintenance

Frequency Task
Yearly Renew OAuth token: claude setup-token
Occasionally Update yt-dlp: yt-dlp -U
Occasionally Update deps: bun update

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages