← Back to Plugins
Channels

Plugin Kai Youtube Operator

wiliyam By wiliyam 👁 22 views ▲ 0 votes

OpenClaw plugin for safe YouTube channel, live broadcast, and live chat workflows for Kai.

GitHub

Install

npm install
npm

README

# Kai YouTube Operator

OpenClaw plugin for Kai, focused on safe YouTube Studio automation, live
production, uploads, comments, captions, analytics, and local short-video
editing.

The plugin uses official YouTube APIs where available and local media tools for
editing. It never asks for a Google password, never returns OAuth secrets, and
requires explicit approval before public, destructive, upload, publish, live, or
moderation actions.

## Status

This project is public and open for contributions. Issues, feature requests,
docs fixes, and pull requests are welcome.

## What It Can Do

- Connect YouTube with OAuth and auto-refresh saved tokens.
- Read channel overview, videos, playlists, comments, captions, members,
  subscriptions, live broadcasts, live streams, live chat, Super Chats, and
  analytics reports.
- Update channel branding, video metadata, playlists, comments, captions,
  broadcast settings, streams, chat moderators, and bans after approval.
- Upload videos privately or publicly after approval.
- Publish existing videos after approval.
- Generate thumbnails locally.
- Create Shorts from longer videos locally.
- Generate synthetic copyright-safe audio beds locally.
- Create voiceover audio with selectable voices when `espeak-ng` is installed.
- Mix/replace/duck audio in a video locally.
- Create a Short and upload it in one approved workflow.
- Call allowlisted YouTube Data API endpoints through a guarded generic tool.

Some YouTube Studio screens are not exposed by public APIs. Monetization setup,
some copyright workflows, account security settings, and some dashboard-only UI
actions may still require manual YouTube Studio use.

## Requirements

- OpenClaw `2026.5.17` or newer.
- Node.js compatible with OpenClaw.
- A Google Cloud OAuth client with YouTube API access.
- `ffmpeg` and `ffprobe` for local video/audio/thumbnail tools.
- `espeak-ng` for local voiceover generation.

On Ubuntu:

```sh
sudo apt-get update
sudo apt-get install -y ffmpeg espeak-ng
```

## Install

Install from GitHub:

```sh
openclaw plugins install git:wiliyam/openclaw-plugin-kai-youtube-operator@main --force
openclaw plugins enable kai-youtube-operator
openclaw gateway restart
```

If you install from a local checkout:

```sh
npm install
npm test
npm run plugin:validate
openclaw plugins install . --force
openclaw plugins enable kai-youtube-operator
openclaw gateway restart
```

## OAuth Setup

Create a Google Cloud OAuth client and configure the OpenClaw gateway
environment:

```sh
YOUTUBE_CLIENT_ID=...
YOUTUBE_CLIENT_SECRET=...
YOUTUBE_REDIRECT_URI=http://127.0.0.1:53682/oauth2callback
```

Do not commit these values. On a server, store them in a private environment
file such as:

```sh
/home/ubuntu/.openclaw/credentials/youtube.env
```

Recommended permissions:

```sh
chmod 600 /home/ubuntu/.openclaw/credentials/youtube.env
```

Then ask Kai to run `kai_youtube_oauth_url`, open the Google consent URL, approve
access, copy only the one-time `code` from the redirect URL, and give that code
to Kai privately. Kai should then run `kai_youtube_oauth_exchange`.

Use a separate Google account invited to the YouTube channel as `Editor` or
`Editor (limited)` when possible. Avoid owner credentials for automation.

## OAuth Capabilities

The OAuth URL tool supports these capability presets:

- `readonly`: YouTube read access.
- `upload`: upload videos.
- `live_control`: live broadcast and live chat control.
- `analytics`: YouTube Analytics read access.
- `monetary_analytics`: analytics plus monetary analytics read access.
- `full_channel`: broad channel, live, upload, and analytics access.

If you add new tools that need a new scope, update `YOUTUBE_SCOPES` in
`src/index.ts` and document the change here.

## Tool Catalog

### Setup and Discovery

- `kai_youtube_setup_status`: check OAuth environment and saved token status.
- `kai_youtube_oauth_url`: generate a Google OAuth consent URL.
- `kai_youtube_oauth_exchange`: exchange a user-approved OAuth code.
- `kai_youtube_channel_overview`: read the authorized channel summary.
- `kai_youtube_studio_capabilities`: list supported features and known gaps.
- `kai_youtube_data_api_request`: guarded generic Data API request.
- `kai_youtube_analytics_report`: run YouTube Analytics reports.
- `kai_youtube_search`: search videos, channels, and playlists.
- `kai_youtube_reference_list`: list categories, regions, languages, and abuse
  report reasons.

### Channel

- `kai_youtube_channel_update_branding`: update channel branding after approval.
- `kai_youtube_channel_sections`: list channel home sections.
- `kai_youtube_channel_section_create`: create a channel section after approval.
- `kai_youtube_channel_section_update`: update a channel section after approval.
- `kai_youtube_channel_section_delete`: delete a channel section after approval.

### Videos, Uploads, and Publishing

- `kai_youtube_videos_list`: list uploads or videos by id, chart, or rating.
- `kai_youtube_video_update_metadata`: update video metadata/status after approval.
- `kai_youtube_video_upload`: upload a local video after approval.
- `kai_youtube_video_upload_public`: upload and make a video public after approval.
- `kai_youtube_video_publish`: make an existing video public after approval.
- `kai_youtube_video_delete`: delete a video after approval.
- `kai_youtube_video_rate`: like, dislike, or clear a video rating after approval.
- `kai_youtube_video_report_abuse`: report a video after approval.
- `kai_youtube_thumbnail_set`: set a video's thumbnail after approval.

### Local Editing, Shorts, Thumbnails, Sound, and Voice

- `kai_youtube_video_edit_probe`: inspect a local video with `ffprobe`.
- `kai_youtube_short_create_from_video`: create one local short clip.
- `kai_youtube_short_batch_from_video`: create multiple local short clips.
- `kai_youtube_short_create_and_upload`: create a Short and upload it after approval.
- `kai_youtube_thumbnail_extract`: extract a thumbnail from a video frame.
- `kai_youtube_thumbnail_generate_card`: generate a thumbnail card with text.
- `kai_youtube_audio_generate_free_bed`: generate a synthetic audio bed.
- `kai_youtube_video_add_audio`: mix, duck, or replace video audio.
- `kai_youtube_voiceover_create`: create a voiceover file from text.
- `kai_youtube_video_add_voiceover`: create a voiceover and add it to a video.

Local editing output files are not overwritten unless `overwrite: true` is set.
Simple uploads are intentionally limited to 512 MB. Use YouTube Studio or a
resumable uploader for larger files.

### Playlists

- `kai_youtube_playlists_list`: list playlists.
- `kai_youtube_playlist_create`: create a playlist after approval.
- `kai_youtube_playlist_update`: update a playlist after approval.
- `kai_youtube_playlist_delete`: delete a playlist after approval.
- `kai_youtube_playlist_items`: list playlist items.
- `kai_youtube_playlist_item_add`: add a video to a playlist after approval.
- `kai_youtube_playlist_item_update`: move or update a playlist item after approval.
- `kai_youtube_playlist_item_delete`: remove a playlist item after approval.

### Comments and Captions

- `kai_youtube_comments_list`: list comment threads or replies.
- `kai_youtube_comment_create`: create a top-level comment after approval.
- `kai_youtube_comment_reply`: reply to a comment after approval.
- `kai_youtube_comment_update`: update a comment after approval.
- `kai_youtube_comment_moderate`: set moderation status after approval.
- `kai_youtube_comment_delete`: delete a comment after approval.
- `kai_youtube_captions_list`: list caption tracks.
- `kai_youtube_caption_upload`: upload or update a caption track after approval.
- `kai_youtube_caption_download`: download a caption track as text.
- `kai_youtube_caption_delete`: delete a caption track after approval.

### Memberships and Subscriptions

- `kai_youtube_members`: list channel members when available.
- `kai_youtube_membership_levels`: list channel membership levels when available.
- `kai_youtube_subscriptions`: list subscriptions or subscribers where the API
  allows.

### Live Production

- `kai_youtube_live_plan`: produce a safe live-stream management plan.
- `kai_youtube_live_broadcasts`: list broadcasts.
- `kai_youtube_live_create_broadcast`: create a broadcast after approval.
- `kai_youtube_live_update_broadcast`: update a broadcast after approval.
- `kai_youtube_live_delete_broadcast`: delete a broadcast after approval.
- `kai_youtube_live_bind_broadcast`: bind or unbind a broadcast and stream.
- `kai_youtube_live_cuepoint`: insert a live cuepoint after approval.
- `kai_youtube_live_transition`: transition testing/live/complete after approval.
- `kai_youtube_live_streams`: list live streams and stream health.
- `kai_youtube_live_stream_create`: create a live stream after approval.
- `kai_youtube_live_stream_update`: update a live stream after approval.
- `kai_youtube_live_stream_delete`: delete a live stream after approval.
- `kai_youtube_live_chat_messages`: read live chat messages.
- `kai_youtube_live_chat_send`: send a live chat message after approval.
- `kai_youtube_live_chat_delete`: delete a live chat message after approval.
- `kai_youtube_live_chat_ban`: ban a user from live chat after approval.
- `kai_youtube_live_chat_unban`: remove a live chat ban after approval.
- `kai_youtube_live_chat_moderators`: list live chat moderators.
- `kai_youtube_live_chat_moderator_add`: add a moderator after approval.
- `kai_youtube_live_chat_moderator_delete`: remove a moderator after approval.
- `kai_youtube_live_super_chats`: list Super Chat events.

## Agent Playbook

Agents using this plugin should follow this order:

1. Run `kai_youtube_setup_status`.
2. If OAuth is missing, run `kai_youtube_oauth_url` and wait for the user to
   provide the one-time OAuth code privately.
3. Run `kai_youtube_oauth_exchange`.
4. Confirm the channel with `kai_youtube_channel_overview`.
5. Use read-only tools first to inspect state.
6. For write actions, summari

... (truncated)
channels

Comments

Sign in to leave a comment

Loading comments...