Skip to content

croakingtoad/saved-search

Repository files navigation

Saved Search

A simple CLI tool and Claude Code slash command to search through your GitHub starred repos and Reddit saved posts.

Ever saved a GitHub repo or Reddit post thinking "I'll need this later" but can't remember where it is? This tool helps you quickly find your saved content across both platforms.

Features

  • 🔍 Search GitHub starred repositories
  • 🔴 Search Reddit saved posts
  • 🎯 Filter by source (GitHub, Reddit, or both)
  • 📋 Returns formatted markdown results with links
  • ⚡ Works as both a CLI tool and Claude Code slash command
  • 🚀 GitHub search works out-of-the-box (no API setup needed)

Installation

# Clone the repository
git clone <repo-url>
cd saved-search

# Install dependencies
npm install

# Install Claude Code slash command (optional)
./install.sh

Setup

1. Install Dependencies

npm install

2. Configure Reddit API (Optional)

If you want to search Reddit saved posts:

  1. Go to https://www.reddit.com/prefs/apps

  2. Click "Create App" or "Create Another App"

  3. Fill in the form:

    • name: saved-search (or whatever you like)
    • type: select "script"
    • description: (optional)
    • about url: (optional)
    • redirect uri: http://localhost:8080 (or your server's IP address)
  4. Click "Create app"

  5. Note your client ID (under the app name) and client secret

  6. Copy .env.example to .env:

    cp .env.example .env
  7. Edit .env and add your credentials:

    REDDIT_CLIENT_ID=your_client_id_here
    REDDIT_CLIENT_SECRET=your_client_secret_here
    REDDIT_USERNAME=your_reddit_username
    REDDIT_PASSWORD=your_reddit_password
    REDDIT_REDIRECT_URI=http://localhost:8080
    

3. Ensure GitHub CLI is Authenticated

The tool uses gh CLI for GitHub searches:

gh auth status

If not authenticated:

gh auth login

Usage

Direct Command Line

# Search both GitHub and Reddit (default)
node index.js "claude code workflows"

# Search only GitHub
node index.js "typescript tips" --github

# Search only Reddit
node index.js "machine learning" --reddit

# Explicitly search both
node index.js "react hooks" --all

Claude Code Slash Command

From within Claude Code:

/saved-search "search query" --github
/saved-search "search query" --reddit
/saved-search "search query" --all

How It Works

GitHub Search

  • Fetches all your starred repositories using gh api user/starred
  • Searches through:
    • Repository name
    • Repository description
    • Full name (owner/repo)
    • Topics/tags

Reddit Search

  • Authenticates with Reddit API
  • Fetches your saved posts (up to 100 most recent)
  • Searches through:
    • Post title
    • Post text (selftext)
    • Subreddit name

Output Format

Results are returned as markdown:

## 🎯 Search Results

### 📦 GitHub Starred Repos

- [owner/repo-name](https://github.com/owner/repo-name) ⭐ 1234
  Repository description here

### 🔴 Reddit Saved Posts

- [Post Title](https://reddit.com/r/subreddit/...) ⬆️ 567
  r/subreddit - Post excerpt...

**Total Results:** 5

Limitations

  • Reddit search currently fetches up to 100 most recent saved posts
  • GitHub search fetches all starred repos (may be slow with many stars)
  • Case-insensitive substring matching only (no fuzzy search)

Future Enhancements

  • Add caching for faster repeat searches
  • Support for fuzzy/semantic search
  • Search GitHub repo READMEs
  • Paginate through all Reddit saved posts
  • Filter by date range
  • Export results to file

About

Quick & dirty Claude Code /slash-command for searching your saved reddit posts, and starred github repos

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published