obs-cmd is a lightweight, command-line interface for controlling OBS Studio via the obs-websocket v5 protocol. It provides a simple and efficient way to automate your streaming and recording workflows.
- Scene Management: Switch between scenes and scene collections.
- Recording & Streaming: Start, stop, and toggle recording and streaming.
- Source Control: Toggle filters, mute audio sources, and manage scene items.
- Camera Control: Start and stop the virtual camera.
- Replay Buffer: Manage the replay buffer, including saving replays.
- Hotkeys: Trigger OBS hotkeys by name.
- Projectors: Open fullscreen and source projectors.
- Media Inputs: Control media playback, including play, pause, and restart.
You can download the latest pre-compiled binaries for your operating system from the Releases page.
Linux/macOS:
# Download the appropriate binary for your system
curl -L https://github.com/grigio/obs-cmd/releases/latest/download/obs-cmd-linux-amd64 -o obs-cmd
chmod +x obs-cmd
sudo mv obs-cmd /usr/local/bin/
Ensure you have Rust installed, then run the following commands:
git clone https://github.com/grigio/obs-cmd.git
cd obs-cmd
cargo install --path .
obs-cmd
is available on the Arch User Repository (AUR). You can install it using an AUR helper like yay
:
yay -S obs-cmd
media-video/obs-cmd
is available on Project:GURU.
sudo emerge -av media-video/obs-cmd
obs-cmd
connects to the OBS WebSocket server. By default, it attempts to connect to obsws://localhost:4455
with the password secret
. You can configure the WebSocket settings in OBS under Tools → WebSocket Server Settings.
To override the default connection settings, you can use the --websocket
flag or set the OBS_WEBSOCKET_URL
environment variable:
# Using the --websocket flag
obs-cmd --websocket obsws://<hostname>:<port>/<password> <command>
# Using an environment variable
export OBS_WEBSOCKET_URL=obsws://<hostname>:<port>/<password>
obs-cmd <command>
# Switch to a scene named "Live"
obs-cmd scene switch Live
# Start recording
obs-cmd recording start
# Toggle the mute state of an audio source
obs-cmd audio toggle "Mic/Aux"
# Save a screenshot of a source
obs-cmd save-screenshot "Webcam" "png" "/path/to/screenshot.png"
For a full list of commands and options, run:
obs-cmd --help
On Linux/GNOME you can map obs-cmd
commands as global shortcuts.
If you find this project helpful, please consider making a donation to support its development.
- Monero:
88LyqYXn4LdCVDtPWKuton9hJwbo8ZduNEGuARHGdeSJ79BBYWGpMQR8VGWxGDKtTLLM6E9MJm8RvW9VMUgCcSXu19L9FSv
- Bitcoin:
bc1q6mh77hfv8x8pa0clzskw6ndysujmr78j6se025