Package Exports
- ttls-controller
- ttls-controller/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ttls-controller) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
TTLS Controller CLI
Control TikTok Live Studio (TTLS) directly from your terminal! 🎬✨
This is a modern Node.js Command Line Interface (CLI) built on top of a reverse-engineered local Socket.IO API that TTLS uses to communicate with its official Elgato Stream Deck plugin.
Features
- 🕵️ Port Scanning: Automatically finds and connects to the active TTLS local server.
- 🔄 State Sync: Retrieve the current scenes and settings from TTLS.
- 🎬 Scene Switcher: Switch to any of your scenes with a single command.
- 🎛️ Quick Toggles: Toggle your Microphone, System Audio, Recording, and Live status instantly.
Installation
You can install ttls-cli globally via npm to make it available anywhere on your system.
npm install -g @2null/ttls-controller(Note: If you are running from the source repository, you can use npm link instead to install the CLI locally.)
Usage
Once installed, you can use the ttls-cli command anywhere in your terminal.
1. Get Current Info
Connects to TTLS, fetches current settings (like active and available scenes), and prints the data:
ttls-cli info2. Switch Scenes
Switch your TTLS layout to a specific scene by name:
ttls-cli scene "Just Chatting"3. Toggles
Quickly toggle specific stream states. The <target> can be mic, audio, record, or live:
# Toggle the Microphone
ttls-cli toggle mic
# Toggle Desktop/System Audio
ttls-cli toggle audio
# Toggle Local Recording
ttls-cli toggle record
# Start / End the LIVE broadcast
ttls-cli toggle liveHow It Works 🛠️
TikTok Live Studio hosts a local Socket.IO server designed to communicate with the official Elgato Stream Deck plugin. Here is how ttls-cli interacts with it:
- Port Scanning: TTLS runs its Socket.IO server on one of several known ports (e.g.,
28189,39728,34246,42205,38534,40825,40622). The CLI attempts to connect to these until it finds the active one. - The Handshake: The connection requires a specific subprotocol (
protocols: ["streamdeck_ttls_v1"]). Once connected, the client emitsstream_deck/join_roomfollowed bystream_deck/sync_settingsto initialize state. - Triggering Actions: To execute a command (like switching scenes), the CLI sends an event
stream_deck/action_emitcontaining a stringified JSON payload with specific Action UUIDs (e.g.,com.tiktok.livestudio.scenefor scenes,com.tiktok.livestudio.micfor mic toggle, etc.).
Contributing
Contributions are always welcome! If you find new Action UUIDs, or want to add features like macro support, feel free to submit a Pull Request.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE for more information.