"A Rust-Based Alternative to obs-cli Compatible with obs-websocket 5"
This tool serves as a Rust-based replacement for obs-cli, offering compatibility with the latest obs-websocket version 5. Unlike obs-cli, which lacks support for this version, this Rust implementation ensures seamless integration and enhanced functionality with obs-websocket 5, providing a more robust and up-to-date solution for users seeking advanced OBS control and automation features.
Get Your OBS Info
$ obs-cmd --websocket obsws://localhost:4455/secret info
Version: Version { obs_version: Version { major: 29, minor: 1, patch: 1 }, obs_web_socket_version: Version { major: 5, minor: 2, patch: 2 }, rpc_version: 1, available_requests: ..
Switch the Scene
$ obs-cmd --websocket obsws://localhost:4455/secret scene switch my-scene
Switched to scene: my-scene
Result: Ok(())
Start the Virtual Camera
$ obs-cmd --websocket obsws://localhost:4455/secret virtual-camera start
Recording started
Result: Ok(())
obs-cmd [options] [command] [options] [arguments]
Command | Options | Arguments |
---|---|---|
info | - | |
scene | switch | [scene-name] |
list | ||
scene-collection | switch | [collection-name] |
scene-item | toggle | [scene-name] [scene-item-name] |
toggle-mute | switch | [device-name] |
recording | start | |
stop | ||
toggle | ||
streaming | start | |
stop | ||
toggle | ||
virtual-camera | start | |
stop | ||
toggle | ||
replay | start | |
stop | ||
toggle | ||
save |
Command | Arguments | Notes |
---|---|---|
--websocket | [url] | Default is 'obsws://localhost:4455/secret' |
--help | - |
Enable OBS WebSocket:
- Go to OBS Studio, navigate to Tools -> WebSocket Server Settings.
- Check [ X ] Enable WebSocket server.
Default Settings:
For convenience, use the default settings:
Server Port: 4455
Server Password: secret
With these settings, there's no need to specify the --websocket
option in obs-cmd.
Custom Settings:
To use custom settings, pass them to obs-cmd using the --websocket
option. You can view your current configuration in OBS Studio by clicking 'Show Connect Info'.
Visit the latest release page of obs-cmd
and download the appropriate binary for your operating system, e.g., obs-cmd-linux-amd64.
Make the downloaded binary executable and move it to a directory in your PATH:
chmod +x obs-cmd-linux-amd64 && sudo mv obs-cmd-linux-amd64 /usr/local/bin/obs-cmd
Run the command to install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Clone obs-cmd to your local system:
git clone https://github.com/grigio/obs-cmd.git
Navigate to the cloned directory and build the application:
cd obs-cmd
cargo build --release
After a successful build, move the binary to a system-wide location:
sudo cp target/release/obs-cmd /usr/local/bin/obs-cmd
To install the obs-cmd package on Arch Linux, available on the Arch User Repository (AUR), follow these steps. Ensure you have rust installed, as it provides cargo, necessary for the installation.
If you prefer an AUR helper, tools like yay or aurman can simplify the process.
- Download the PKGBUILD file:
wget https://aur.archlinux.org/cgit/aur.git/snapshot/obs-cmd.tar.gz
- Extract the downloaded .tar.gz file:
tar xvzf obs-cmd.tar.gz
- Change directory to obs-cmd:
cd obs-cmd
- Build the package using makepkg:
makepkg -s
- Install the package with pacman (note: version number may vary):
sudo pacman -U obs-cmd-0.15.3-1-x86_64.pkg.tar.zst
Donations are welcome and will go towards further development of this project
monero:88LyqYXn4LdCVDtPWKuton9hJwbo8ZduNEGuARHGdeSJ79BBYWGpMQR8VGWxGDKtTLLM6E9MJm8RvW9VMUgCcSXu19L9FSv
bitcoin:bc1q6mh77hfv8x8pa0clzskw6ndysujmr78j6se025
lightning:techonsapevole@getalby.com