
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Automate YouTube comment replies using AI - A TypeScript library and CLI tool for intelligent YouTube comment management with OpenAI GPT integration
Replyt is a TypeScript npm package that allows you to automate YouTube comment replies using AI. Built with OpenAI GPT and YouTube Data API v3.
There are two main ways to use Replyt:
Best for: Quick setup, production use, non-developers
# Install globally
npm install -g replyt
# Setup configuration
replyt setup
# Run the bot
replyt
Best for: Developers, customization, contributing, learning
# Clone repository
git clone https://github.com/rfqma/replyt.git
cd replyt
# Install dependencies
npm install
# Setup configuration
npm run setup
# Run in development mode
npm run dev
Both methods require a .env
file with your API credentials:
# YouTube API
YOUTUBE_API_KEY=your_youtube_api_key_here
YOUTUBE_CHANNEL_ID=your_channel_id_here
# OpenAI
OPENAI_API_KEY=your_openai_api_key_here
# OAuth (optional - for posting comments)
YOUTUBE_CLIENT_ID=your_client_id_here
YOUTUBE_CLIENT_SECRET=your_client_secret_here
YOUTUBE_REFRESH_TOKEN=your_refresh_token_here
YOUTUBE_ACCESS_TOKEN=your_access_token_here
# Bot Configuration
CHECK_INTERVAL_MINUTES=5
MAX_REPLIES_PER_RUN=10
REPLY_STYLE="friendly and helpful"
DATABASE_PATH=./data/replyt.db
For CLI (Global Install):
replyt setup # Interactive setup wizard
For Local Development:
npm run setup # Setup YouTube API Key
npm run oauth # Setup OAuth for posting (optional)
npm run test # Test configuration
After global installation and setup:
# Start the bot
replyt
# That's it! The bot will run automatically
Running the Bot:
npm run dev # Development mode with auto-restart
npm run start # Production mode (requires build)
npm run watch # Development with file watching
Development Commands:
npm run build # Compile TypeScript
npm run clean # Clean build files
npm run test # Test API connections
npm run setup # Run setup wizard
npm run oauth # Setup OAuth authentication
You can also use Replyt as a library in your own projects:
# Install as dependency
npm install replyt
import { Replyt, AutoReplyBot, config } from "replyt";
// Using the Replyt wrapper class
const bot = new Replyt(config);
// Start bot with cron scheduling
await bot.start("*/5 * * * *"); // Every 5 minutes
// Or use manually
await bot.initialize();
await bot.processNewComments();
const stats = await bot.getStats();
import { AutoReplyBot, config, validateConfig } from "replyt";
// Validate configuration
validateConfig();
// Create bot instance
const bot = new AutoReplyBot(config);
// Initialize
await bot.initialize();
// Process comments once
await bot.processNewComments();
// View statistics
const stats = await bot.getStats();
console.log(stats);
// Shutdown
bot.shutdown();
Replyt
Wrapper class for easy library usage.
class Replyt {
constructor(config: Config);
async initialize(): Promise<void>;
async processNewComments(): Promise<void>;
async getStats(): Promise<object>;
async start(cronExpression?: string): Promise<void>;
shutdown(): void;
}
AutoReplyBot
Core bot class with full control.
class AutoReplyBot {
constructor(config: Config);
async initialize(): Promise<void>;
async processNewComments(): Promise<void>;
async getStats(): Promise<object>;
shutdown(): void;
}
YouTubeService
OpenAIService
DatabaseService
interface Config {
youtubeApiKey: string;
youtubeChannelId: string;
youtubeOAuth: OAuthCredentials;
openaiApiKey: string;
checkIntervalMinutes: number;
maxRepliesPerRun: number;
replyStyle: string;
databasePath: string;
}
interface YouTubeComment {
id: string;
videoId: string;
authorDisplayName: string;
textDisplay: string;
publishedAt: string;
// ... other properties
}
Variable | Required | Default | Description |
---|---|---|---|
YOUTUBE_API_KEY | ā | - | YouTube Data API v3 key |
YOUTUBE_CHANNEL_ID | ā | - | Your YouTube channel ID |
OPENAI_API_KEY | ā | - | OpenAI API key |
YOUTUBE_CLIENT_ID | ā | - | OAuth client ID (for posting) |
YOUTUBE_CLIENT_SECRET | ā | - | OAuth client secret |
YOUTUBE_REFRESH_TOKEN | ā | - | OAuth refresh token |
CHECK_INTERVAL_MINUTES | ā | 5 | Comment check interval (minutes) |
MAX_REPLIES_PER_RUN | ā | 10 | Max replies per cycle |
REPLY_STYLE | ā | "friendly and helpful" | AI reply style |
DATABASE_PATH | ā | "./data/replyt.db" | SQLite database path |
You can customize AI reply style by changing REPLY_STYLE
:
"friendly and helpful"
"professional and formal"
"casual and funny"
"educational and informative"
"Always reply in Indonesian with emojis"
If you don't configure OAuth, the bot will run in read-only mode:
To enable posting:
CLI: replyt oauth
Local: npm run oauth
The bot provides detailed logging and statistics:
š¤ Bot initialized successfully - FULL MODE (can post replies)
š Found 25 total comments
š Found 5 new comments to process
š§ Generating reply for comment by John Doe...
š¤ Posting reply: "Thank you for watching! ..."
ā
Successfully replied to comment abc123
š Total comments processed: 150
git clone https://github.com/rfqma/replyt.git
cd replyt
npm install
npm run setup
npm run dev
Command | Description |
---|---|
npm run dev | Development mode with auto-restart |
npm run start | Production mode (requires build) |
npm run build | Compile TypeScript |
npm run watch | Development with file watching |
npm run setup | Setup wizard |
npm run oauth | OAuth setup |
npm run test | Test configuration |
npm run clean | Clean build files |
npm run validate | Validate package structure |
replyt/
āāā src/
ā āāā bin/replyt.ts # CLI executable
ā āāā lib/index.ts # Library exports
ā āāā services/ # Core services
ā āāā config/ # Configuration
ā āāā types/ # TypeScript types
āāā scripts/ # Setup scripts
āāā examples/ # Usage examples
āāā dist/ # Compiled output
API Key Invalid
Error: The request cannot be completed because you have exceeded your quota.
OAuth Issues
Error: invalid_grant
replyt oauth
npm run oauth
OpenAI Rate Limits
Error: Rate limit exceeded
MAX_REPLIES_PER_RUN
CHECK_INTERVAL_MINUTES
CLI: DEBUG=replyt:* replyt
Local: DEBUG=replyt:* npm run dev
MIT License - see LICENSE file for details.
Contributions are welcome! Please:
git checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)Built with ā¤ļø using:
ā Star this repository if it's helpful!
FAQs
Automate YouTube comment replies using AI - A TypeScript library and CLI tool for intelligent YouTube comment management with OpenAI GPT integration
The npm package replyt receives a total of 0 weekly downloads. As such, replyt popularity was classified as not popular.
We found that replyt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Ā It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.