obs-cli is a command-line interface for OBS Studio.
It allows you to control OBS Studio from the command line, making it easier to automate scene switching, source toggling, and more.
This implementation of obs-cli is:
- written in Python 3
- powered by rich and obsws-python.
You can install obs-cli using pip(x):
# pipx
pipx install obs-cli
# pip
pip install --user obs-cliHere's the general usage of obs-cli:
obs-cli --helpThis will show you the available commands and options.
You can manage scenes using the scene command:
obs-cli scene --helpFor example, to switch to a scene named "Scene2":
obs-cli scene switch "Scene2"To list all scenes:
obs-cli scene listYou can manage scene items using the item command:
obs-cli item --helpFor example, to hide an item named "Item1" in a scene named "Scene2":
obs-cli item hide --scene "Scene2" "Item1"And to show it:
obs-cli item show --scene "Scene2" "Item1"To list all items in a scene:
obs-cli item list --scene "Scene2"You can manage scene item groups using the group command:
obs-cli group --helpFor example, to hide an group named "group1" in a scene named "Scene2":
obs-cli group hide --scene "Scene2" "group1"And to show it:
obs-cli group show --scene "Scene2" "group1"To list all groups in a scene:
obs-cli group list --scene "Scene2"You can manage inputs using the input command:
obs-cli input --helpFor example, to get the settings of an input named "Mic/Aux":
obs-cli input get "Mic/Aux"To set the device_id of a webcam input named "Webcam":
obs-cli input set "Webcam" device_id /dev/v4l/by-id/usb-Elgato_Elgato_Facecam_FW52K1A04919-video-index0To list all inputs:
obs-cli input listMute/unmute or toggle the mute state of an input:
obs-cli input mute "Mic/Aux"
obs-cli input unmute "Mic/Aux"
obs-cli input toggle-mute "Mic/Aux"You can manage filters using the filter command:
obs-cli filter --helpFor example, to enable a filter named "Filter1" on an input named "Mic/Aux":
obs-cli filter enable "Mic/Aux" "Filter1"And to disable it:
obs-cli filter disable "Mic/Aux" "Filter1"To list all filters on an input:
obs-cli filter list "Mic/Aux"You can manage hotkeys using the hotkey command:
obs-cli hotkey --helpFor example, to trigger a hotkey named "Hotkey1":
obs-cli hotkey trigger "Hotkey1"To list all hotkeys:
obs-cli hotkey listYou can manage the virtual camera using the virtualcam command:
obs-cli virtualcam --helpFor example, to start the virtual camera:
obs-cli virtualcam startTo stop the virtual camera:
obs-cli virtualcam stopTo toggle the virtual camera:
obs-cli virtualcam toggleTo get the status of the virtual camera:
obs-cli virtualcam statusYou can manage the stream using the stream command:
obs-cli stream --helpFor example, to start streaming:
obs-cli stream startTo stop streaming:
obs-cli stream stopTo toggle streaming:
obs-cli stream toggleTo get the status of the stream:
obs-cli stream statusYou can manage recording using the record command:
obs-cli record --helpFor example, to start recording:
obs-cli record startTo stop recording:
obs-cli record stopTo toggle recording:
obs-cli record toggleTo get the status of the recording:
obs-cli record statusThis project is licensed under the GPL-3.0 License.
See LICENSE for more information.