Skip to content

Instantly share code, notes, and snippets.

@ericclemmons
Created January 8, 2026 23:30
Show Gist options
  • Select an option

  • Save ericclemmons/1ff86466ae903c9ea0f130cb60cd0e2d to your computer and use it in GitHub Desktop.

Select an option

Save ericclemmons/1ff86466ae903c9ea0f130cb60cd0e2d to your computer and use it in GitHub Desktop.
`/today` in Raycast to kick off `today` skill
description allowed-tools
Sync Twitter bookmarks to Obsidian vault with metadata and embedded media
Bash(bird:*), Read, Write, Edit, Glob, Grep, AskUserQuestion, WebFetch

Sync Twitter Bookmarks

Fetches Twitter bookmarks using the Bird CLI and creates/updates notes in the Bookmarks/ folder with full metadata and embedded media.

Sources to Sync:

  1. Twitter Bookmarks (via Bird CLI):
    • Fetch bookmarks: bird bookmarks -n <count> --json
    • Get full tweet details: bird <tweet-id> --json
    • Extract text, media, author, timestamps, and engagement metrics

Implementation Strategy:

  1. Determine sync count:

    • Check if user provided an argument (e.g., /sync-bookmarks 5 to sync 5 bookmarks)
    • Default to 10 bookmarks for testing
    • Ask user if they want to sync all bookmarks or a specific count
  2. Fetch bookmarks:

    • Use bird bookmarks -n <count> --json to get bookmark list (for structured data)
    • For each bookmark, fetch full details using bird thread <tweet-url> to get:
      • Full tweet text (not truncated)
      • Parent tweets if it's a reply (for context)
      • Thread context
      • Better formatting than JSON
  3. Process each bookmark:

    • Extract metadata: author, created date, tweet text, media URLs, engagement metrics
    • Generate filename: <author-username>-<tweet-id>.md (e.g., ryancarson-2008548371712135632.md)
    • Check if note already exists in ~/Obsidian/Bookmarks/ to avoid duplicates
  4. Create note with frontmatter:

    ---
    title: "<First 60 chars of tweet text>..."
    source: "https://twitter.com/<username>/status/<tweet-id>"
    author:
      - "[[<Author Name> (@username)]]"
    created: YYYY-MM-DD
    tweet_date: "<full created timestamp>"
    engagement:
      replies: <count>
      retweets: <count>
      likes: <count>
    tags:
      - "bookmarks"
      - "twitter"
    ---
  5. Format note content:

    • Include full tweet text
    • Embed media (images/videos) using Obsidian syntax
    • For images: ![Image](<image-url>) or embed multiple images
    • For videos: Embed using Twitter video URL or <video> tag
    • Include link back to original tweet
    • Add engagement metrics as metadata
  6. Handle media embedding:

    • Check tweet JSON for media field
    • Images: Use ![](url) markdown syntax
    • Videos: Embed with <video src="url" controls></video> or link to Twitter video
    • GIFs: Treat as images
    • For tweets with multiple images, embed all in sequence
  7. Create Bookmarks directory if needed:

    • Ensure ~/Obsidian/Bookmarks/ exists before writing notes
    • Use mkdir -p via Bash if needed
  8. Deduplicate:

    • Use Glob to find existing bookmark notes: ~/Obsidian/Bookmarks/*.md
    • Extract tweet IDs from filenames to skip already-synced bookmarks
    • Only create new notes for bookmarks not already synced

Output Format:

Example Note: ryancarson-2008548371712135632.md

---
title: "Step-by-step guide to get Ralph working and shipping code"
source: "https://twitter.com/ryancarson/status/2008548371712135632"
author:
  - "[[Ryan Carson (@ryancarson)]]"
created: 2026-01-06
tweet_date: "Tue Jan 06 14:37:03 +0000 2026"
engagement:
  replies: 80
  retweets: 207
  likes: 2928
tags:
  - "bookmarks"
  - "twitter"
---

Step-by-step guide to get Ralph working and shipping code

Everyone is raving about Ralph. What is it?
Ralph is an autonomous AI coding loop that ships features while you sleep.
Created by @GeoffreyHuntley and announced in his original post, it runs @AmpCode (or your agent of choice) repeatedly until all tasks are complete.

[Full tweet text...]

---

**Original Tweet**: [View on Twitter](https://twitter.com/ryancarson/status/2008548371712135632)

**Engagement**: 2928 likes · 207 retweets · 80 replies

For tweets with media:

---
title: "Tweet with image/video"
source: "https://twitter.com/username/status/id"
author:
  - "[[Author Name (@username)]]"
created: YYYY-MM-DD
media_type: "image" # or "video", "gif"
tags:
  - "bookmarks"
  - "twitter"
---

Tweet text here...

![Tweet Image](https://pbs.twimg.com/media/image-url.jpg)

<!-- For videos -->
<video src="https://video.twimg.com/video-url.mp4" controls></video>

<!-- Or multiple images -->
![Image 1](url1)
![Image 2](url2)

---

**Original Tweet**: [View on Twitter](https://twitter.com/username/status/id)

Important Notes:

  • CRITICAL: Always check existing bookmarks first! Use Glob to list ~/Obsidian/Bookmarks/*.md and extract tweet IDs from filenames to avoid duplicates
  • CRITICAL: Fetch full tweet details! Use bird thread <tweet-url> for each bookmark to get:
    • Full context and thread
    • Parent tweets for replies
    • Better formatting than JSON
    • Parse the human-readable output instead of JSON
  • CRITICAL: Use ~ for paths! Always use ~/Obsidian/Bookmarks/ not full paths
  • Default to testing mode: Sync 10 bookmarks by default unless user specifies a count
  • Filename format: <username>-<tweet-id>.md for easy identification and deduplication
  • Media embedding: Check JSON for media, photos, video fields - format varies
  • Thread support: For threads, consider adding thread context or parent tweet reference
  • Quoted tweets: Include quoted tweet content if present
  • Handle errors gracefully: If Bird CLI fails or tweet is deleted, skip and continue
  • Preserve formatting: Keep line breaks and formatting from original tweets
  • Author wiki-links: Use format [[Author Name (@username)]] for easy linking
  • Tag consistently: Always include bookmarks and twitter tags
  • Summary output: After syncing, report how many bookmarks were synced, how many were skipped (duplicates), and any errors

User Arguments:

If the user provides a count (e.g., /sync-bookmarks 50), use that count. Otherwise, default to 10 for testing.

After Syncing:

Provide a summary:

  • ✅ Synced: X new bookmarks
  • ⏭️ Skipped: Y existing bookmarks
  • ❌ Errors: Z failed bookmarks (if any)
  • 📁 Location: ~/Obsidian/Bookmarks/
description allowed-tools
Access Twitter/X via Bird CLI - read bookmarks, tweets, threads, and post content
Bash(bird:*), Bash(bird *), Read, Write

Bird CLI - Twitter/X Access Tool

When to Use This Tool

ALWAYS use the bird CLI command (via the Bash tool) when the user asks about or references:

  • Twitter or X (the platform)
  • Tweets, bookmarks, likes, mentions
  • URLs containing x.com or twitter.com
  • Following/followers lists
  • Twitter threads or conversations
  • Searching tweets
  • Posting tweets or replies

Examples of triggers:

  • "What are my recent bookmarks?"
  • "Show me tweets about AI"
  • "Read this tweet: https://x.com/..."
  • "What did I bookmark recently?"
  • "Search for tweets about..."

Available Commands

Reading Content

# Get bookmarks (default: 20)
bird bookmarks
bird bookmarks -n 50

# Read a specific tweet
bird read <tweet-id-or-url>
bird <tweet-id-or-url>  # shorthand

# Read a thread
bird thread <tweet-id-or-url>

# Get replies to a tweet
bird replies <tweet-id-or-url>

# Search for tweets
bird search "query"

# Get your mentions
bird mentions

# Get your likes
bird likes

User Info

# Check logged-in account
bird whoami

# Get following list
bird following

# Get followers
bird followers

Posting

# Post a tweet
bird tweet "Your tweet text"

# Reply to a tweet
bird reply <tweet-id-or-url> "Your reply"

# Tweet with media
bird tweet "Text" --media /path/to/image.jpg --alt "Alt text"

Output Options

  • Add --json to most commands for JSON output
  • Use --plain for no emoji/color
  • Use -n <number> to control count of results

Full Help Reference

bird 0.5.1 (42abae9c) — fast X CLI for tweeting, replying, and reading
Usage: bird [options] [command]

Post tweets and replies via Twitter/X GraphQL API

Options:
  -V, --version                        output the version number
  --auth-token <token>                 Twitter auth_token cookie
  --ct0 <token>                        Twitter ct0 cookie
  --chrome-profile <name>              Chrome profile name for cookie extraction
  --firefox-profile <name>             Firefox profile name for cookie extraction
  --cookie-timeout <ms>                Cookie extraction timeout in milliseconds
  --cookie-source <source>             Cookie source for browser cookie extraction
  --media <path>                       Attach media file (repeatable, up to 4 images or 1 video)
  --alt <text>                         Alt text for the corresponding --media (repeatable)
  --timeout <ms>                       Request timeout in milliseconds
  --quote-depth <depth>                Max quoted tweet depth (default: 1; 0 disables)
  --plain                              Plain output (stable, no emoji, no color)
  --no-emoji                           Disable emoji output
  --no-color                           Disable ANSI colors (or set NO_COLOR)
  -h, --help                           display help for command

Commands:
  help [command]                       Show help for a command
  query-ids [options]                  Show or refresh cached Twitter GraphQL query IDs
  tweet <text>                         Post a new tweet
  reply <tweet-id-or-url> <text>       Reply to an existing tweet
  read [options] <tweet-id-or-url>     Read/fetch a tweet by ID or URL
  replies [options] <tweet-id-or-url>  List replies to a tweet (by ID or URL)
  thread [options] <tweet-id-or-url>   Show the full conversation thread
  search [options] <query>             Search for tweets
  mentions [options]                   Find tweets mentioning a user
  bookmarks [options]                  Get your bookmarked tweets
  following [options]                  Get users that you (or another user) follow
  followers [options]                  Get users that follow you (or another user)
  likes [options]                      Get your liked tweets
  whoami                               Show which Twitter account the credentials belong to
  check                                Check credential availability

Examples:
  bird whoami                          Show the logged-in account
  bird tweet "hello from bird"         Send a tweet
  bird 1234567890123456789 --json      Read a tweet and print JSON
  bird bookmarks                       Get your bookmarked tweets
  bird search "AI agents"              Search for tweets

Shortcuts:
  bird <tweet-id-or-url> [--json]      Shorthand for `bird read <tweet-id-or-url>`

JSON Output:
  Add --json to: read, replies, thread, search, mentions, bookmarks, likes, following, followers, query-ids

Config:
  Reads ~/.config/bird/config.json5 and ./.birdrc.json5 (JSON5)
  Supports: chromeProfile, firefoxProfile, cookieSource, cookieTimeoutMs, timeoutMs, quoteDepth

Environment Variables:
  NO_COLOR, BIRD_TIMEOUT_MS, BIRD_COOKIE_TIMEOUT_MS, BIRD_QUOTE_DEPTH

Important Notes

  • Bird uses browser cookies for authentication (Chrome/Firefox profiles)
  • No need to manually provide auth tokens - it extracts from your browser
  • Tweet IDs and URLs are interchangeable in commands
  • Most read commands support --json for programmatic access
#!/bin/zsh -l
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title /today
# @raycast.mode fullOutput
# Optional parameters:
# @raycast.argument1 { "type": "text", "placeholder": "", "optional": true }
# @raycast.description Run Claude /today and open daily note
# @raycast.icon 📅
# @raycast.packageName Obsidian
# Documentation:
# @raycast.description Run claude with /today
# @raycast.author ericclemmons
# @raycast.authorURL https://x.com/ericclemmons
cd ~/Obsidian
~/.local/bin/claude -p "/today $1" \
--output-format=stream-json \
--verbose \
| jq -r --unbuffered 'select(.type == "assistant") | .message.content[]?.text // ""'
@ericclemmons
Copy link
Author

ericclemmons commented Jan 8, 2026

Screenshot 2026-01-08 at 5 28 11 PM image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment