ttls-controller
v1.0.3
Published
CLI tool to control TikTok Live Studio (TTLS) via its local Socket.IO API
Maintainers
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.
- 🖼️ Source Toggling: Show or hide sources within your scene.
- 🎛️ Extensive Triggers: Over 20+ supported actions, from Mutli-Guest and Co-Host panels to Audio Filters and Treasure Boxes.
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.)
Command Reference
ttls-cli info
Connects to TTLS, fetches current settings (like active and available scenes), and prints the data.
ttls-cli infottls-cli scene <scene_name>
Switch your TTLS layout to a specific scene by name.
ttls-cli scene "Just Chatting"ttls-cli source <source_name>
Show or hide a specific source by name.
ttls-cli source "Webcam"ttls-cli trigger <action>
Trigger any simple action, panel, or effect. See the full list of available actions below.
# Example: Toggle the Microphone
ttls-cli trigger mic
# Example: Open the Co-Host panel
ttls-cli trigger co-hostFull List of Supported Triggers
You can use any of the following actions with the ttls-cli trigger <action> command:
mic: Mute / unmute microphoneaudio: Mute / unmute audio outputrecord: Start / stop local recordinglive: Go / end LIVElive-pause: Pause / resume LIVEhighlight: Highlight this momentvibe: Dynamic effectssay-hi: Say hi to viewerssound-effect: Play sound effectaudio-filter: Turn on / off audio effectcamera-effect: Turn on / off camera effectco-host: Open "Co-host"treasure-box: Open "Treasure Box"guess-game: Open "Guessing game"play-together: Open "Play Together"goody-bag: Open "Goody Bag"vote: Open "Poll & Gift vote"live-goal: Open "LIVE goal"multi-guest: Open "Multi-guest"team: Open "Team"game-rewards: Open "Game Rewards"promote: Open "Promote"mic-control: Open "MicControl"audio-control: Open "AudioControl"
How 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.
