Version0.1.0Verifiednot yet verifiedLicenseBSD-3-Clause

tube

Video platform management CLI and MCP server

Report a bug or suggest a feature
Readme

tube

Video platform management CLI and MCP server — YouTube + Twitch unified in one interface.

Upload videos, edit metadata, check analytics, schedule streams, manage chat, and get a cross-platform overview of your content channels.

Installation

Requires a C toolchain. On Guix:

guix shell -m ../sigil/manifest.scm

Build:

sigil build --redirects dev-redirects.sgl

Run tests:

sigil test

Usage

CLI Mode

# Platform overview (subscribers, followers, live status)
tube status

# List recent YouTube videos with stats
tube videos --limit 20

# Upload a video to YouTube
tube upload video.mp4 --title "My Video" --description "About this video" --privacy unlisted

# Analytics summary (YouTube + Twitch combined)
tube analytics --days 30

# View stream schedule across platforms
tube stream-schedule --platform both

# Start a broadcast
tube go-live --title "Weekly Livestream" --platform both

# Send a chat message
tube chat "Hello everyone!" --platform twitch

MCP Server Mode

tube serve

This starts an MCP server exposing the following tools:

ToolDescription
tube/uploadUpload video to YouTube
tube/videosList recent videos with stats
tube/analyticsCross-platform analytics summary
tube/scheduleView stream schedule (YouTube + Twitch)
tube/go-liveStart broadcast on one or both platforms
tube/chatSend message to live chat
tube/statusPlatform overview (subs, followers, live status)
Read the rest

Configuration

OAuth Mode (Recommended)

Set client credentials and use tube auth to authorize:

export YOUTUBE_CLIENT_ID="your-google-client-id"
export YOUTUBE_CLIENT_SECRET="your-google-client-secret"
export TWITCH_CLIENT_ID="your-twitch-client-id"
export TWITCH_CLIENT_SECRET="your-twitch-client-secret"

# Authorize each platform (opens browser, stores tokens)
tube auth youtube
tube auth twitch

Tokens are stored in ~/.config/sigil/<service>/tokens.json and automatically refreshed when expired.

Direct Token Mode (Legacy)

For manual token management, set access tokens directly:

VariableRequiredDescription
YOUTUBE_ACCESS_TOKENFor YouTube write opsYouTube OAuth2 access token
YOUTUBE_API_KEYFor YouTube read opsYouTube Data API key
TWITCH_CLIENT_IDFor TwitchTwitch application client ID
TWITCH_ACCESS_TOKENFor TwitchTwitch OAuth2 access token
TUBE_DEFAULT_PLATFORMNoDefault platform: youtube, twitch, or both (default: both)

OAuth Environment Variables

VariableDescription
YOUTUBE_CLIENT_IDGoogle Cloud OAuth2 client ID
YOUTUBE_CLIENT_SECRETGoogle Cloud OAuth2 client secret
TWITCH_CLIENT_IDTwitch application client ID
TWITCH_CLIENT_SECRETTwitch application client secret

You only need credentials for the platforms you want to use. If you only have YouTube credentials, Twitch operations will gracefully report that credentials are missing, and vice versa.

Architecture

src/tube/
  config.sgl   — Environment-based configuration
  youtube.sgl  — YouTube operations (wraps sigil-youtube)
  twitch.sgl   — Twitch operations (wraps sigil-twitch)
  tools.sgl    — MCP tool definitions + shared helpers
  main.sgl     — Dual CLI/MCP entry point

tube follows the dual CLI/MCP server pattern used by fjo and tally. The same business logic serves both the command-line interface and MCP tool handlers.

Dependencies

License

BSD-3-Clause

Clone

$ git clone https://codeberg.org/sigil/tube

Source

Browse the latest source

One page per file, and every line has a permalink.

Recent commitsAtom

The last 20 commits keep a page here. Everything older lives in the clone.