Quickstart Guide
Get from zero to your first automatically generated video in just 10 minutes. This guide will walk you through the fastest path to generating content.
Quick Setup
Clone and Install
Get the repository and install dependencies: git clone https://github.com/darkzOGx/youtube-automation-agent.git
cd youtube-automation-agent
npm install
This will install all required packages including:
googleapis - YouTube API integration
openai / @google/generative-ai - AI content generation
express - API server
sqlite3 - Database management
node-cron - Task scheduling
Run Setup Wizard
The interactive setup wizard will guide you through configuration: The setup wizard will:
Create Directory Structure
const directories = [
'config' ,
'logs' ,
'data' ,
'data/production' ,
'data/assets' ,
'data/videos' ,
'data/audio' ,
'data/scripts' ,
'data/captions' ,
'data/thumbnail-templates' ,
'temp/processing' ,
'uploads/thumbnails'
];
All directories created automatically with proper permissions.
await this . database . initialize ();
// Creates SQLite database with tables:
// - content_strategies
// - scripts
// - thumbnails
// - seo_data
// - productions
// - publish_schedule
// - analytics_reports
// - keyword_performance
# Generated .env file with:
NODE_ENV = production
PORT = 3456
LOG_LEVEL = info
YOUTUBE_REGION = US
DEFAULT_PRIVACY_STATUS = public
JWT_SECRET =< auto-generated >
# ... and more
Configure API Keys
You’ll need two sets of credentials: YouTube Data API (Required - FREE)
Create Google Cloud Project
Go to Google Cloud Console
Click “Create Project” (name it “YouTube Automation”)
Wait for project creation to complete
Enable YouTube API
Navigate to “APIs & Services” → “Library”
Search for “YouTube Data API v3”
Click “Enable”
Create OAuth Credentials
Go to “Credentials” → “Create Credentials” → “OAuth client ID”
Choose “Desktop app” as application type
Download the JSON file
Save as config/credentials.json
AI Provider (Choose One) OpenAI (Recommended)
Google Gemini (FREE)
# 1. Visit https://platform.openai.com/
# 2. Go to API Keys section
# 3. Create new secret key
# 4. Add to .env file:
OPENAI_API_KEY = sk-proj-...
# Cost: ~$0.10-0.30 per video
# Add $5-10 credits to start
Start the System
Launch the automation agent: You should see: 🎬 YouTube Automation Agent v1.0
──────────────────────────────────────────────────
✓ Database initialized
✓ Credentials loaded
✓ strategy agent initialized
✓ scriptWriter agent initialized
✓ thumbnailDesigner agent initialized
✓ seoOptimizer agent initialized
✓ production agent initialized
✓ publishing agent initialized
✓ analytics agent initialized
✅ YouTube Automation Agent running on port 3456
──────────────────────────────────────────────────
📊 Dashboard: http://localhost:3456
🔧 API Health: http://localhost:3456/health
📅 Schedule: http://localhost:3456/schedule
📈 Analytics: http://localhost:3456/analytics
──────────────────────────────────────────────────
🤖 Automation is active. Content will be generated and posted daily.
Generate Your First Video
Now let’s create content! You have three options:
Automatic (Recommended)
Custom Topic
Test Mode
Let the AI Choose The Content Strategy Agent will analyze trends and select the best topic: curl -X POST http://localhost:3456/generate \
-H "Content-Type: application/json" \
-d '{}'
This triggers the full workflow: async generateContent () {
// 1. Analyze YouTube trends (50+ trending videos)
const strategy = await this . agents . strategy . generateContentStrategy ();
// 2. Generate engaging script with hooks and CTAs
const script = await this . agents . scriptWriter . generateScript ( strategy );
// 3. Create eye-catching thumbnail
const thumbnail = await this . agents . thumbnailDesigner . generateThumbnail ( script );
// 4. Optimize for SEO (title, description, tags)
const seoData = await this . agents . seoOptimizer . optimize ( script , strategy );
// 5. Process through production pipeline
const productionData = await this . agents . production . processContent ({
strategy , script , thumbnail , seo: seoData
});
// 6. Schedule for optimal publish time
const contentId = await this . db . saveProductionData ( productionData );
return { contentId , title: script . title , scheduledFor: productionData . scheduledPublishTime };
}
Specify Your Topic Generate content about a specific topic: curl -X POST http://localhost:3456/generate \
-H "Content-Type: application/json" \
-d '{
"topic": "Top 10 Life Hacks for Productivity",
"style": "listicle"
}'
Available content types:
tutorial - Step-by-step guides
listicle - Top 10, Best of, etc.
review - Product or service reviews
explainer - Educational content
news - Breaking news format
story - Narrative-driven content
Run System Test Verify all components without creating actual content: This validates:
Database connectivity
API credentials
Agent initialization
File system permissions
Understanding the Response
When you generate content, you’ll receive:
{
"success" : true ,
"result" : {
"contentId" : "production_1234567890_abc123" ,
"title" : "The Ultimate Guide to AI Content Creation in 2025" ,
"scheduledFor" : "2026-03-12T14:00:00.000Z"
}
}
contentId Unique identifier for tracking through production pipeline
title SEO-optimized title generated by the system
scheduledFor Optimal publish time based on audience analysis
Monitoring Your Content
View Dashboard
Access the web dashboard:
open http://localhost:3456
Check Health Status
curl http://localhost:3456/health
Response:
{
"status" : "healthy" ,
"initialized" : true ,
"agents" : [
"strategy" ,
"scriptWriter" ,
"thumbnailDesigner" ,
"seoOptimizer" ,
"production" ,
"publishing" ,
"analytics"
],
"timestamp" : "2026-03-05T12:00:00.000Z"
}
View Publishing Schedule
curl http://localhost:3456/schedule
See all upcoming content:
[
{
"id" : "schedule_1234567890_xyz" ,
"title" : "The Ultimate Guide to AI Content Creation in 2025" ,
"publish_time" : "2026-03-12T14:00:00.000Z" ,
"status" : "scheduled" ,
"priority" : 50
}
]
Get Analytics
curl http://localhost:3456/analytics
What Happens Next?
With the system running, here’s the automatic workflow:
Daily Content Generation (6:00 AM)
cron . schedule ( '0 6 * * *' , async () => {
// Checks content buffer (default: 3 days)
const shouldGenerate = await this . shouldGenerateContentToday ();
if ( shouldGenerate ) {
// Full content generation pipeline
await this . runDailyContentGeneration ();
}
});
Generates new content if buffer is low.
Publishing Queue Processing (Every 15 Minutes)
cron . schedule ( '*/15 * * * *' , async () => {
// Checks for videos ready to publish
await this . processPublishQueue ();
});
Automatically uploads videos at scheduled times.
Analytics Collection (9:00 AM)
cron . schedule ( '0 9 * * *' , async () => {
const recentVideos = await this . getRecentlyPublishedVideos ( 7 );
for ( const video of recentVideos ) {
await this . agents . analytics . analyzeVideoPerformance ( video . youtube_id );
}
});
Collects performance data for recent videos.
Optimization Tasks (10:00 PM)
cron . schedule ( '0 22 * * *' , async () => {
await this . optimizeExistingContent ();
await this . updateKeywordPerformance ();
await this . cleanupOldFiles ();
});
Improves content and maintains system health.
Customizing Your Workflow
Change Posting Frequency
Edit your .env file:
# Options: daily, every-2-days, 3-per-week, weekly
POSTING_FREQUENCY = daily
# Maintain content buffer (days ahead)
CONTENT_BUFFER_DAYS = 3
# Maximum videos per day
MAX_DAILY_POSTS = 1
Configure Content Preferences
# Target audience
CHANNEL_NAME = Your Channel Name
TARGET_AUDIENCE = Tech enthusiasts, developers
# Content settings
YOUTUBE_REGION = US
DEFAULT_PRIVACY_STATUS = public
Troubleshooting
Setup fails with 'YouTube API quota exceeded'
Solution : Check your Google Cloud Console quotas:
Go to Google Cloud Console
Navigate to “APIs & Services” → “Quotas”
YouTube Data API v3 should have 10,000 units/day by default
If exceeded, wait 24 hours or request quota increase
Check :# Verify API keys are set
cat .env | grep API_KEY
# Check logs
tail -f logs/application.log
# Verify credentials
npm run credentials:setup
Reset database :# Backup first
cp data/youtube_automation.db data/youtube_automation.backup.db
# Reinitialize
npm run db:init
Verify OAuth tokens :
Check config/credentials.json exists
Ensure YouTube OAuth consent screen is configured
Re-run authentication if needed
Next Steps
Installation Guide Deep dive into configuration and deployment options
API Reference Complete API documentation and examples
Success! Your YouTube channel is now fully automated. The system will generate, optimize, and publish content according to your schedule.