lcyt-cli
v1.4.0
Published
CLI for sending live captions to YouTube Live streams
Maintainers
Readme
LCYT CLI - Live Captions for YouTube
Command-line tool for sending live captions to YouTube Live streams.
Looking for the library? See
lcyt.
Installation
npm install -g lcyt-cliOr run directly with npx:
npx lcyt-cliGetting Started
1. Set up your YouTube stream key
lcyt --stream-key "YOUR_STREAM_KEY"To get your stream key:
- Go to YouTube Studio
- Click Create > Go Live
- In stream settings, find Closed captions
- Enable POST captions to URL
- Copy the stream key (cid value)
2. Verify connection (optional)
lcyt --heartbeat3. Send captions
lcyt "Hello, world!" # Send a single caption
lcyt -i # Start interactive mode
lcyt -f # Start full-screen interactive modeWhen running via npx lcyt-cli without arguments, it defaults to full-screen mode.
Options
| Option | Alias | Description |
|--------|-------|-------------|
| --stream-key <key> | -k | YouTube stream key (cid value) |
| --base-url <url> | -u | Base ingestion URL (default: http://upload.youtube.com/closedcaption) |
| --region <reg> | -r | Region identifier (default: reg1) |
| --cue <cue> | | Cue identifier (default: cue1) |
| --use-region | | Include region/cue in caption body (optional) |
| --interactive | -i | Interactive mode (read from stdin) |
| --fullscreen | -f | Full-screen interactive mode with file loading |
| --show-config | | Show current configuration |
| --heartbeat | | Send heartbeat to verify connection |
| --test | | Send test payload from Google docs |
| --timestamp <iso> | -t | Manual ISO timestamp override |
| --reset | | Reset sequence counter to 0 |
| --config <path> | -c | Config file path |
| --verbose | -v | Enable verbose output |
| --help | -h | Show help |
| --version | | Show version number |
| --log-stderr | | Write human logs to stderr instead of stdout (env: LCYT_LOG_STDERR=1) |
Interactive Mode (-i)
A simple line-by-line mode that reads from stdin.
lcyt -iCommands:
<text>- Send single captiontimestamp|text- Send with custom timestamp/batch [seconds]- Start auto-batch mode (default: 5s)/send- Send collected batch immediately<empty line>- Send batch (if any captions queued)/heartbeat- Send heartbeat/status- Show current statusCtrl+C- Exit
Batch example
lcyt -i
/batch 10 # Start batch mode with 10 second timeout
Caption 1 # Timer starts here
Caption 2 # Added to batch
Caption 3 # Added to batch
# ... after 10 seconds from first caption, batch auto-sendsFull-Screen Mode (-f)
A rich terminal UI with file loading, navigation, and sent history.
lcyt -fKeyboard shortcuts
| Key | Action |
|-----|--------|
| Enter | Send current file line and advance |
| Up / k | Move to previous line |
| Down / j | Move to next line |
| PageUp / PageDown | Move up/down 10 lines |
| Tab | Switch focus between input and preview |
| h | Show help |
| q / Ctrl+C | Quit |
Commands (type in input field)
| Command | Description |
|---------|-------------|
| /load <file> [line] | Load a text file, optionally jump to line number |
| /reload | Reload the current file |
| /goto <N> | Jump to line number N |
| /batch [seconds] | Toggle batch mode (auto-send after N seconds) |
| /send | Send batch immediately |
| /status | Show current status |
| /heartbeat | Send heartbeat to server |
| /quit or /exit | Quit the application |
| +N or -N | Shift pointer forward/backward N lines |
Text typed without a / prefix is sent as a custom caption (does not move the file pointer).
Example workflow
lcyt -f
# In the UI:
/load script.txt # Load a file
/goto 10 # Jump to line 10
# Press Enter to send the current line and advance
# Use arrow keys to navigate
# Type custom text and press Enter to send ad-hoc captions
/batch 3 # Enable batch mode (3s auto-send)
# Press Enter multiple times to queue lines rapidly
/send # Or send the batch immediatelySequence
YouTube requires an incrementing sequence counter for each stream. The counter is saved to your config file automatically.
Reset when restarting a stream:
lcyt --resetConfiguration
Config is stored in ~/.lcyt-config.json:
{
"baseUrl": "http://upload.youtube.com/closedcaption",
"streamKey": "YOUR_STREAM_KEY",
"region": "reg1",
"cue": "cue1",
"sequence": 42
}View current config:
lcyt --show-configUse a custom config file:
lcyt --config /path/to/config.jsonDocker / MCP notes
If you run the MCP host or a relay in Docker, rebuild the image after pulling changes so the container picks up the updated CLI behavior (logger stderr option):
# from repo root
docker build -t lcyt-mcp ./packages/lcyt-mcp
# restart your container using the new image
docker rm -f lcyt-mcp-container || true
docker run -d --name lcyt-mcp-container lcyt-mcpAdjust image name and container commands to match your deployment.
License
MIT
