|
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. |
||
|---|---|---|
| src/tube | Use sigil-oauth for YouTube and Twitch token management | |
| test | Update imports for renamed (youtube) and (twitch) namespaces | |
| .gitignore | Add .mcp.json to .gitignore | |
| dev-redirects.sgl | Use sigil-oauth for YouTube and Twitch token management | |
| package.sgl | Remove static?: #t from release config | |
| README.md | Use sigil-oauth for YouTube and Twitch token management | |
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
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:
| 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
- sigil-youtube — YouTube Data API v3 client
- sigil-twitch — Twitch Helix API client
- sigil-mcp — MCP server framework
License
BSD-3-Clause