Skip to content

Insightslab-ai/rdt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rdt — Reddit CLI

Command-line interface for Reddit via Composio — no API registration required

Browse subreddits, search posts, read comments, post and comment, and track account warm-up — all from your terminal.


Why This Exists

Reddit's official API registration process is painful: approval delays, app reviews, and strict rate limits. Composio handles OAuth so you don't have to. Connect your Reddit account once via Composio's dashboard, then use rdt from anywhere.

No app registration. No client secrets. Just a Composio API key and a connected Reddit account.


Installation

git clone https://github.com/insightslab-ai/rdt
cd rdt
pip install -e .

# Make the wrapper executable and add to PATH
chmod +x rdt
ln -s "$(pwd)/rdt" /usr/local/bin/rdt

Setup

1. Sign up for Composio

Go to https://app.composio.dev and create a free account.

2. Connect Reddit

In the Composio dashboard, go to Apps → Reddit and connect your Reddit account via OAuth. This is the account rdt will act as.

3. Get your API key

Go to https://app.composio.dev/settings and copy your API key.

4. Configure rdt

Create ~/.config/composio/secrets.env:

COMPOSIO_API_KEY=your_api_key_here

Or copy the example:

cp config.example.env ~/.config/composio/secrets.env
# Edit and fill in your API key

5. Discover your connection ID

rdt setup

This fetches your Reddit connection from Composio and saves the connection ID automatically. You only need to do this once.

6. Verify

rdt me

Configuration

rdt loads config in this order:

  1. ~/.config/composio/secrets.env (recommended)
  2. Environment variables

Required:

  • COMPOSIO_API_KEY — your Composio API key

Optional (or auto-discovered via rdt setup):

  • COMPOSIO_REDDIT_CONNECTION_ID — your Reddit connected account ID

Warm-up state file (optional):

  • Default: ~/.config/rdt/warm-up-state.json
  • Override: RDT_WARMUP_STATE=/path/to/file.json

Commands

rdt setup

Discover and save your Reddit connection ID.

rdt setup

rdt me

Show your Reddit connection status.

rdt me
rdt me --json

rdt feed <subreddit>

Get posts from a subreddit.

rdt feed Python
rdt feed learnprogramming --sort hot --limit 10
rdt feed MachineLearning --json

Options:

  • --sort hot|new|top|rising (default: hot)
  • --limit N (default: 25)
  • --time hour|day|week|month|year|all
  • --json — raw JSON output

rdt search <subreddit> <query>

Search posts within a subreddit (or all of Reddit).

rdt search Python "asyncio best practices"
rdt search all "open source CLI tools" --sort top
rdt search learnpython "beginner resources" --limit 5

Options:

  • --sort relevance|hot|top|new (default: relevance)
  • --limit N (default: 25)
  • --json

Use all as the subreddit to search site-wide.

rdt comments <post_id>

Get comments on a post.

rdt comments abc123
rdt comments t3_abc123 --limit 50
rdt comments abc123 --json

The t3_ prefix is optional.

rdt rules <subreddit>

Fetch subreddit rules (uses Reddit's public API — no auth required).

rdt rules learnpython
rdt rules MachineLearning --json

rdt flairs <subreddit>

List available post flairs.

rdt flairs learnpython

rdt comment <post_fullname> <text> --confirm

Post a comment. Requires --confirm flag.

rdt comment t3_abc123 "Great write-up, thanks!" --confirm

rdt post <subreddit> --title <title> [options] --confirm

Create a new post. Requires --confirm flag.

# Text post
rdt post learnpython --title "My first Python script" --text "Here's what I built..." --confirm

# Link post
rdt post Python --title "Interesting article on asyncio" --url "https://example.com/article" --confirm

# With flair
rdt post learnpython --title "Question about decorators" --text "..." --flair-id <uuid> --confirm

Use rdt flairs <subreddit> to get valid flair IDs.


Safety Gates

All write commands (comment, post) require an explicit --confirm flag. Running without it will print a warning and exit without making any changes.

# This does nothing — safe to run
rdt comment t3_abc123 "Hello world"
# ⚠️  Write action requires --confirm flag. Rerun with --confirm to proceed.

# This actually posts
rdt comment t3_abc123 "Hello world" --confirm

This prevents accidental writes when testing commands or reviewing syntax.


Warm-Up Protocol

Fresh Reddit accounts get flagged for spam if they jump straight into posting links or promotional content. The warm-up command helps you track a healthy engagement period first.

Why warm-up matters:

  • Reddit's spam filters look at account age and karma
  • New accounts that only post links get shadowbanned
  • Genuine comments in relevant communities build karma and credibility
  • 2–4 weeks of organic activity before any promotional posts is recommended

Usage:

# Start tracking
rdt warm-up --start

# Log a genuine comment you left
rdt warm-up --log learnpython t3_abc123 "This explanation of decorators is really clear!"

# Check progress
rdt warm-up --status

State is stored at ~/.config/rdt/warm-up-state.json. Override the path with RDT_WARMUP_STATE.

Suggested warm-up checklist:

  • 20+ genuine comments across 5+ different subreddits
  • Comment karma > 50
  • Account age > 14 days
  • No comment-only account pattern (mix in occasional posts too)

Limitations

These Reddit actions are not available via the Composio integration:

  • Voting — no upvote/downvote endpoint
  • Direct messages — no inbox access
  • Moderation actions — no mod queue

Available write actions: comment, post, delete (via Composio dashboard), edit (via Composio dashboard).


License

MIT — see LICENSE


Built by Insights Lab

About

Command-line interface for Reddit via Composio — no API registration required

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors