1
0
Fork
You've already forked tube
0
Video platform management CLI and MCP server — YouTube + Twitch
Find a file
David Wilson 5c68f67823 Remove static?: #t from release config
Static linking should use a dedicated config, not be the default for
release builds. This avoids glibc static linking failures on most
Linux systems.
2026年04月01日 19:53:50 +03:00
src/tube Use sigil-oauth for YouTube and Twitch token management 2026年03月25日 20:53:32 +02:00
test Update imports for renamed (youtube) and (twitch) namespaces 2026年03月25日 15:23:00 +02:00
.gitignore Add .mcp.json to .gitignore 2026年03月25日 14:46:05 +02:00
dev-redirects.sgl Use sigil-oauth for YouTube and Twitch token management 2026年03月25日 20:53:32 +02:00
package.sgl Remove static?: #t from release config 2026年04月01日 19:53:50 +03:00
README.md Use sigil-oauth for YouTube and Twitch token management 2026年03月25日 20:53:32 +02:00

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:

Tool Description
tube/upload Upload video to YouTube
tube/videos List recent videos with stats
tube/analytics Cross-platform analytics summary
tube/schedule View stream schedule (YouTube + Twitch)
tube/go-live Start broadcast on one or both platforms
tube/chat Send message to live chat
tube/status Platform overview (subs, followers, live status)

Configuration

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:

Variable Required Description
YOUTUBE_ACCESS_TOKEN For YouTube write ops YouTube OAuth2 access token
YOUTUBE_API_KEY For YouTube read ops YouTube Data API key
TWITCH_CLIENT_ID For Twitch Twitch application client ID
TWITCH_ACCESS_TOKEN For Twitch Twitch OAuth2 access token
TUBE_DEFAULT_PLATFORM No Default platform: youtube, twitch, or both (default: both)

OAuth Environment Variables

Variable Description
YOUTUBE_CLIENT_ID Google Cloud OAuth2 client ID
YOUTUBE_CLIENT_SECRET Google Cloud OAuth2 client secret
TWITCH_CLIENT_ID Twitch application client ID
TWITCH_CLIENT_SECRET Twitch 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