Skip to main content

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.
Prerequisites: Node.js 18+ installed. If you don’t have it, download Node.js here.

Quick Setup

1

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
2

Run Setup Wizard

The interactive setup wizard will guide you through configuration:
npm run setup
The setup wizard will:
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
Interactive prompts for:
  • YouTube API credentials (OAuth 2.0)
  • AI provider selection (OpenAI or Gemini)
  • API keys for chosen provider
  • Channel preferences and settings
# 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
3

Configure API Keys

You’ll need two sets of credentials:

YouTube Data API (Required - FREE)

1

Create Google Cloud Project

  1. Go to Google Cloud Console
  2. Click “Create Project” (name it “YouTube Automation”)
  3. Wait for project creation to complete
2

Enable YouTube API

  1. Navigate to “APIs & Services”“Library”
  2. Search for “YouTube Data API v3”
  3. Click “Enable”
3

Create OAuth Credentials

  1. Go to “Credentials”“Create Credentials”“OAuth client ID”
  2. Choose “Desktop app” as application type
  3. Download the JSON file
  4. Save as config/credentials.json

AI Provider (Choose One)

# 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
4

Start the System

Launch the automation agent:
npm start
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:

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:
1

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.
2

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.
3

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.
4

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

Solution: Check your Google Cloud Console quotas:
  1. Go to Google Cloud Console
  2. Navigate to “APIs & Services”“Quotas”
  3. YouTube Data API v3 should have 10,000 units/day by default
  4. 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:
  1. Check config/credentials.json exists
  2. Ensure YouTube OAuth consent screen is configured
  3. Re-run authentication if needed
node authenticate.js

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.