Skip to main content

OBS CLI

Project description

🎬🎥 OBS CLI

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:

⚠️ Only the new OBS WebSocket API (v5) is supported!

💻 Installation

# uv (recommended)
uv tool install obs-cli

# pip
pip install --user obs-cli

🛠️ Usage

obs-cli --help

Global flags (-H, -P, -p, -j, -q, -D) can be placed before or after the subcommand name. Subcommands also accept plural forms (scenes, items, groups, etc.) and default to list (or status for stateful commands) when no action is given.

obs-cli scenes               # same as: obs-cli scene list
obs-cli items --json         # JSON output
obs-cli --json scene list    # equivalent

🌟 Features

🎞️ Scene Management

obs-cli scene --help
# List all scenes (INDEX / NAME / CURRENT columns)
obs-cli scene list
obs-cli scenes               # plural alias

# Switch to a scene
obs-cli scene switch "Scene2"

# Print the current scene name
obs-cli scene current

# Screenshot — current scene or a named one
obs-cli scene screenshot -o scene.png
obs-cli scene screenshot "Scene2" -o scene2.png
obs-cli scene screenshot --raw > scene.png   # raw bytes to stdout
obs-cli scene screenshot --json              # base64-encoded JSON

📦 Item Management

obs-cli item --help
# List all items in the current (or a named) scene
obs-cli item list
obs-cli item list --scene "Scene2"
obs-cli items                # plural alias

# Show / hide / toggle a source
obs-cli item show --scene "Scene2" "Item1"
obs-cli item hide --scene "Scene2" "Item1"
obs-cli item toggle "Item1"

# Screenshot a source
obs-cli item screenshot "Webcam" -o webcam.png
obs-cli item screenshot "Webcam" --raw > webcam.png
obs-cli item screenshot "Webcam" --json
obs-cli item screenshot "Webcam" -f jpg -o webcam.jpg

📂 Group Management

obs-cli group --help
# List all groups in a scene
obs-cli group list
obs-cli group list --scene "Scene2"
obs-cli groups               # plural alias

# Show / hide / toggle a group
obs-cli group show --scene "Scene2" "group1"
obs-cli group hide --scene "Scene2" "group1"
obs-cli group toggle "group1"

🎤 Input Management

obs-cli input --help
# List all inputs
obs-cli input list
obs-cli inputs               # plural alias

# Show all settings for an input
obs-cli input get "Mic/Aux"

# Get a single property
obs-cli input get "Webcam" device_id

# Set a property
obs-cli input set "Webcam" device_id /dev/v4l/by-id/usb-Elgato_Elgato_Facecam_FW52K1A04919-video-index0

# Mute / unmute / toggle
obs-cli input mute "Mic/Aux"
obs-cli input unmute "Mic/Aux"
obs-cli input toggle-mute "Mic/Aux"
obs-cli input is-muted "Mic/Aux"

🎨 Filter Management

obs-cli filter --help
# List filters on a source
obs-cli filter list "Mic/Aux"
obs-cli filters              # plural alias (current scene)

# Enable / disable / toggle
obs-cli filter enable  "Mic/Aux" "Filter1"
obs-cli filter disable "Mic/Aux" "Filter1"
obs-cli filter toggle  "Mic/Aux" "Filter1"

# Check status (exits 0 if enabled, 1 if disabled)
obs-cli filter status "Mic/Aux" "Filter1"
obs-cli -q filter status "Mic/Aux" "Filter1"

⌨️ Hotkey Management

obs-cli hotkey --help
# List all hotkeys
obs-cli hotkey list
obs-cli hotkeys              # plural alias

# Trigger a hotkey
obs-cli hotkey trigger "OBSBasic.StartStreaming"

🎥 Virtual Camera

obs-cli virtualcam status
obs-cli virtualcam start
obs-cli virtualcam stop
obs-cli virtualcam toggle

📡 Stream Management

obs-cli stream status
obs-cli stream start
obs-cli stream stop
obs-cli stream toggle

📹 Recording

obs-cli record status
obs-cli record start
obs-cli record stop
obs-cli record toggle

🔁 Replay Buffer

obs-cli replay status
obs-cli replay start
obs-cli replay stop
obs-cli replay toggle
obs-cli replay save

📄 License

This project is licensed under the GPL-3.0 License.

See LICENSE for more information.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

obs_cli-0.9.1.tar.gz (49.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

obs_cli-0.9.1-py3-none-any.whl (33.4 kB view details)

Uploaded Python 3

File details

Details for the file obs_cli-0.9.1.tar.gz.

File metadata

  • Download URL: obs_cli-0.9.1.tar.gz
  • Upload date:
  • Size: 49.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for obs_cli-0.9.1.tar.gz
Algorithm Hash digest
SHA256 9dbc9969d414490f86e163e9d8b4472dcd055f8c7a803508ad297d0320ad6394
MD5 fed79fb01ebbf1f888434c419d3403b5
BLAKE2b-256 51363fb5101fc7adbbf808e69dba918e4bcbc4f683e708b176e4de2fd0f252ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for obs_cli-0.9.1.tar.gz:

Publisher: pypi.yaml on pschmitt/obs-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file obs_cli-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: obs_cli-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 33.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for obs_cli-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b2758c91b11450c717049e32bd5ab50c172f444ff55bd377b3afd214dcfcb5e5
MD5 b288bc82cc14c6f1eb3fa0a5a755f33b
BLAKE2b-256 50839e07a13b52daee62e46c175c853bfa5f209b7d60cb636ae8cc41628e0215

See more details on using hashes here.

Provenance

The following attestation bundles were made for obs_cli-0.9.1-py3-none-any.whl:

Publisher: pypi.yaml on pschmitt/obs-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page