A comprehensive Reddit CLI plugin that enables you to manage your Reddit presence directly from the command line. Post, comment, vote, search, message, and automate your Reddit interactions with ease.
- Complete Reddit API Integration - Full OAuth2 authentication with automatic token refresh
- Content Management - Create, edit, delete posts and comments
- Social Interactions - Upvote, downvote, save, and reply to content
- Advanced Search - Search across subreddits with filtering and sorting
- User Analytics - Track karma, post history, and engagement metrics
- Messaging System - Send and receive private messages
- Community Management - Subscribe/unsubscribe, manage flairs
- Multi-subreddit Support - Browse multiple communities simultaneously
- JSON Output - Structured data perfect for automation and scripting
- Node.js 18.0.0 or higher
- A Reddit account
- Reddit API credentials (client ID and secret)
Deploy this plugin instantly to your OpenClaw instance:
PinchKit will:
- ✅ Automatically clone and install the plugin
- ✅ Set up the environment and dependencies
- ✅ Configure the skill for immediate use
- ✅ Provide setup guidance for Reddit API credentials
# Clone to your OpenClaw skills directory
cd /root/.openclaw/workspace/skills/
git clone https://github.com/jugs-eth/reddit-plugin.git reddit
cd reddit
# Install dependencies
npm install
# Set up environment variables (see Setup section below)- Go to reddit.com/prefs/apps
- Click "Create App" or "Create Another App"
- Fill in the details:
- Name:
openclaw-reddit-plugin(or any name you prefer) - App type: Select "script"
- Description: OpenClaw Reddit automation
- About URL: (leave blank or add your website)
- Redirect URI:
http://localhost:8080(required but not used)
- Name:
- Click "Create app"
After creating the app, you'll see:
- Client ID: The string directly under the app name (looks like:
abcd1234wxyz) - Client Secret: The longer string labeled "secret"
Add these to your /root/.openclaw/.env file:
REDDIT_CLIENT_ID=your_client_id_here
REDDIT_CLIENT_SECRET=your_client_secret_here
REDDIT_USERNAME=your_reddit_username
REDDIT_PASSWORD=your_reddit_passwordThe plugin provides a comprehensive set of commands for Reddit interaction:
# Via shell wrapper (recommended)
./reddit <command> [arguments]
# Direct invocation
npx ts-node cli.ts <command> [arguments]# Text post
reddit post "programming" "My coding journey" "Just wanted to share my experience learning Python..."
# Link post with flair
reddit post "technology" "AI Breakthrough" "https://example.com/ai-news" "News"# Comment on a post
reddit comment "t3_abc123" "Great article! Thanks for sharing."
# Reply to a comment
reddit reply "t1_def456" "I completely agree with your analysis."# Vote on content
reddit upvote "t3_abc123"
reddit downvote "t1_def456"
# Save content for later
reddit save "t3_abc123"# Edit your own posts/comments
reddit edit "t3_abc123" "Updated content with corrections..."
# Delete your own content
reddit delete "t1_def456"# Search across all of Reddit
reddit search "machine learning"
# Search within specific subreddit
reddit search "python tips" "programming" "top" "week"
# Browse subreddit content
reddit subreddit-hot "technology" 25
reddit subreddit-new "programming" 10
reddit subreddit-top "artificial" "month" 50# Get posts from multiple subreddits at once
reddit multireddit "programming,webdev,javascript" 30# Get user profile (defaults to your own)
reddit user-profile
reddit user-profile "spez"
# Get user's posts and comments
reddit user-posts "gallowboob" 25
reddit user-comments "AutoModerator" 10# Check your inbox
reddit inbox
# Send a private message
reddit message-send "username" "Subject Here" "Message body content..."# Get karma breakdown by subreddit
reddit karma# Manage subscriptions
reddit subscribe "artificial"
reddit unsubscribe "funny"
# List available post flairs
reddit flair-list "programming"All commands return structured JSON for easy parsing and automation:
{
"success": true,
"post_id": "abc123",
"url": "https://reddit.com/r/programming/comments/abc123/my_first_react_app/",
"permalink": "https://reddit.com/r/programming/comments/abc123/my_first_react_app/",
"message": "Posted to r/programming"
}{
"query": "python machine learning",
"subreddit": "all",
"total_results": 25,
"posts": [
{
"id": "abc123",
"title": "Best Python ML Libraries in 2024",
"subreddit": "MachineLearning",
"score": 1337,
"num_comments": 89,
"url": "https://reddit.com/r/MachineLearning/comments/abc123/...",
"permalink": "https://reddit.com/r/MachineLearning/comments/abc123/...",
"created_utc": 1641234567,
"author": "ml_expert"
}
]
}# Morning routine
reddit inbox # Check messages
reddit subreddit-hot "programming" 10 # Browse favorite subs
reddit karma # Check karma growth
# Evening engagement
reddit search "interesting topics" "" "top" "day"
reddit comment "t3_abc123" "Great insights!"# Research phase
reddit search "topic keywords" "target_subreddit"
reddit flair-list "target_subreddit"
# Publishing
reddit post "target_subreddit" "Post Title" "Content or URL" "Appropriate Flair"
# Follow-up engagement
reddit user-posts # Check your recent posts for comments# Multi-community discovery
reddit multireddit "programming,webdev,javascript,reactjs"
# User research
reddit user-profile "influential_user"
reddit user-posts "influential_user" 50
reddit user-comments "influential_user" 50- Environment Variable Configuration - Credentials never hardcoded
- OAuth2 Token Management - Automatic token refresh and secure storage
- Rate Limit Compliance - Built-in respect for Reddit's API limits
- Proper User-Agent - Identifies as
openclaw-reddit-plugin/1.0.0 - HTTPS Only - All API communications encrypted
Reddit enforces strict rate limits:
- 60 requests per minute for OAuth applications
- 1 request per second recommended for sustained usage
- The plugin handles rate limiting gracefully with informative error messages
# Verify environment variables
echo $REDDIT_CLIENT_ID
echo $REDDIT_USERNAME
# Common fixes:
# - Use username, not email address
# - Ensure app type is "script"
# - Double-check client ID and secret- 429 Too Many Requests: Wait 60 seconds between heavy operations
- 403 Forbidden: Check if you have permission to post in target subreddit
- 401 Unauthorized: Verify credentials and app configuration
- Posts:
t3_abc123 - Comments:
t1_def456 - Users:
t2_user123 - Messages:
t4_msg789
The plugin automatically uses openclaw-reddit-plugin/1.0.0 by ${REDDIT_USERNAME} as required by Reddit's API terms.
By default, the plugin looks for environment variables in /root/.openclaw/.env. This can be customized by modifying the dotenv config path in cli.ts.
This plugin integrates seamlessly with OpenClaw's skill system:
- Automatic Discovery - OpenClaw recognizes the plugin via
SKILL.md - JSON Output - All responses are structured for easy parsing
- Error Handling - Consistent error formatting for automation
- Shell Wrapper - Simple command execution via the
redditwrapper script
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Reddit API team for comprehensive documentation
- OpenClaw community for plugin architecture
- TypeScript and Node.js communities for excellent tooling
Ready to automate your Reddit presence? Deploy this plugin instantly:
PinchKit handles all the setup complexity, so you can start managing Reddit from the command line in minutes, not hours.
Made with ❤️ for the OpenClaw community