mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2026-03-03 16:59:17 +00:00
Compare commits
No commits in common. "45479563a044dd91160bf947a0ed55f490849b97" and "34067ca61d4da480442d2a6cdeb8ac1c03891d21" have entirely different histories.
45479563a0
...
34067ca61d
@ -16,7 +16,6 @@ For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
|
|||||||
- [Configuration](#configuration)
|
- [Configuration](#configuration)
|
||||||
- [Style](#style)
|
- [Style](#style)
|
||||||
- [Commands](#root-typer)
|
- [Commands](#root-typer)
|
||||||
- [Shell Completion](#shell-completion)
|
|
||||||
- [License](#license)
|
- [License](#license)
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
@ -815,14 +814,6 @@ obsws-cli media stop "Media"
|
|||||||
obsws-cli media restart "Media"
|
obsws-cli media restart "Media"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Shell Completion
|
|
||||||
|
|
||||||
```console
|
|
||||||
obsws-cli --install-completion
|
|
||||||
```
|
|
||||||
|
|
||||||
Currently supported shells: *bash* *zsh* *fish* *powershell*
|
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: MIT
|
# SPDX-License-Identifier: MIT
|
||||||
__version__ = '0.24.7'
|
__version__ = '0.24.6'
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
"""module defining a custom group class for handling command name aliases."""
|
"""module defining a custom group class for handling command name aliases."""
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
import typer
|
import typer
|
||||||
|
|
||||||
|
|
||||||
@ -51,3 +53,25 @@ class RootTyperAliasGroup(typer.core.TyperGroup):
|
|||||||
case 'vc':
|
case 'vc':
|
||||||
cmd_name = 'virtualcam'
|
cmd_name = 'virtualcam'
|
||||||
return super().get_command(ctx, cmd_name)
|
return super().get_command(ctx, cmd_name)
|
||||||
|
|
||||||
|
|
||||||
|
class SubTyperAliasGroup(typer.core.TyperGroup):
|
||||||
|
"""A custom group class to handle command name aliases for sub typers."""
|
||||||
|
|
||||||
|
_CMD_SPLIT_P = re.compile(r' ?[,|] ?')
|
||||||
|
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
"""Initialize the AliasGroup."""
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
self.no_args_is_help = True
|
||||||
|
|
||||||
|
def get_command(self, ctx, cmd_name):
|
||||||
|
"""Get a command by name."""
|
||||||
|
cmd_name = self._group_cmd_name(cmd_name)
|
||||||
|
return super().get_command(ctx, cmd_name)
|
||||||
|
|
||||||
|
def _group_cmd_name(self, default_name):
|
||||||
|
for cmd in self.commands.values():
|
||||||
|
if cmd.name and default_name in self._CMD_SPLIT_P.split(cmd.name):
|
||||||
|
return cmd.name
|
||||||
|
return default_name
|
||||||
|
|||||||
@ -8,8 +8,9 @@ from rich.table import Table
|
|||||||
from rich.text import Text
|
from rich.text import Text
|
||||||
|
|
||||||
from obsws_cli import console, util
|
from obsws_cli import console, util
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -17,8 +18,7 @@ def main():
|
|||||||
"""Control filters in OBS scenes."""
|
"""Control filters in OBS scenes."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('list')
|
@app.command('list | ls')
|
||||||
@app.command('ls', hidden=True)
|
|
||||||
def list_(
|
def list_(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
source_name: Annotated[
|
source_name: Annotated[
|
||||||
@ -90,8 +90,7 @@ def _get_filter_enabled(ctx: typer.Context, source_name: str, filter_name: str):
|
|||||||
return resp.filter_enabled
|
return resp.filter_enabled
|
||||||
|
|
||||||
|
|
||||||
@app.command('enable')
|
@app.command('enable | on')
|
||||||
@app.command('on', hidden=True)
|
|
||||||
def enable(
|
def enable(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
source_name: Annotated[
|
source_name: Annotated[
|
||||||
@ -120,8 +119,7 @@ def enable(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('disable')
|
@app.command('disable | off')
|
||||||
@app.command('off', hidden=True)
|
|
||||||
def disable(
|
def disable(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
source_name: Annotated[
|
source_name: Annotated[
|
||||||
@ -150,8 +148,7 @@ def disable(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('toggle')
|
@app.command('toggle | tg')
|
||||||
@app.command('tg', hidden=True)
|
|
||||||
def toggle(
|
def toggle(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
source_name: Annotated[
|
source_name: Annotated[
|
||||||
@ -184,8 +181,7 @@ def toggle(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('status')
|
@app.command('status | ss')
|
||||||
@app.command('ss', hidden=True)
|
|
||||||
def status(
|
def status(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
source_name: Annotated[
|
source_name: Annotated[
|
||||||
|
|||||||
@ -7,9 +7,10 @@ from rich.table import Table
|
|||||||
from rich.text import Text
|
from rich.text import Text
|
||||||
|
|
||||||
from obsws_cli import console, util, validate
|
from obsws_cli import console, util, validate
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
from obsws_cli.protocols import DataclassProtocol
|
from obsws_cli.protocols import DataclassProtocol
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -17,8 +18,7 @@ def main():
|
|||||||
"""Control groups in OBS scenes."""
|
"""Control groups in OBS scenes."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('list')
|
@app.command('list | ls')
|
||||||
@app.command('ls', hidden=True)
|
|
||||||
def list_(
|
def list_(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_name: Annotated[
|
scene_name: Annotated[
|
||||||
@ -84,8 +84,7 @@ def _get_group(group_name: str, resp: DataclassProtocol) -> dict | None:
|
|||||||
return group
|
return group
|
||||||
|
|
||||||
|
|
||||||
@app.command('show')
|
@app.command('show | sh')
|
||||||
@app.command('sh', hidden=True)
|
|
||||||
def show(
|
def show(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_name: Annotated[
|
scene_name: Annotated[
|
||||||
@ -118,8 +117,7 @@ def show(
|
|||||||
console.out.print(f'Group {console.highlight(ctx, group_name)} is now visible.')
|
console.out.print(f'Group {console.highlight(ctx, group_name)} is now visible.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('hide')
|
@app.command('hide | h')
|
||||||
@app.command('h', hidden=True)
|
|
||||||
def hide(
|
def hide(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_name: Annotated[
|
scene_name: Annotated[
|
||||||
@ -152,8 +150,7 @@ def hide(
|
|||||||
console.out.print(f'Group {console.highlight(ctx, group_name)} is now hidden.')
|
console.out.print(f'Group {console.highlight(ctx, group_name)} is now hidden.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('toggle')
|
@app.command('toggle | tg')
|
||||||
@app.command('tg', hidden=True)
|
|
||||||
def toggle(
|
def toggle(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_name: Annotated[
|
scene_name: Annotated[
|
||||||
@ -190,8 +187,7 @@ def toggle(
|
|||||||
console.out.print(f'Group {console.highlight(ctx, group_name)} is now hidden.')
|
console.out.print(f'Group {console.highlight(ctx, group_name)} is now hidden.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('status')
|
@app.command('status | ss')
|
||||||
@app.command('ss', hidden=True)
|
|
||||||
def status(
|
def status(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_name: Annotated[
|
scene_name: Annotated[
|
||||||
|
|||||||
@ -7,8 +7,9 @@ from rich.table import Table
|
|||||||
from rich.text import Text
|
from rich.text import Text
|
||||||
|
|
||||||
from obsws_cli import console
|
from obsws_cli import console
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -16,8 +17,7 @@ def main():
|
|||||||
"""Control hotkeys in OBS."""
|
"""Control hotkeys in OBS."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('list')
|
@app.command('list | ls')
|
||||||
@app.command('ls', hidden=True)
|
|
||||||
def list_(
|
def list_(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
):
|
):
|
||||||
@ -45,8 +45,7 @@ def list_(
|
|||||||
console.out.print(table)
|
console.out.print(table)
|
||||||
|
|
||||||
|
|
||||||
@app.command('trigger')
|
@app.command('trigger | tr')
|
||||||
@app.command('tr', hidden=True)
|
|
||||||
def trigger(
|
def trigger(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
hotkey: Annotated[
|
hotkey: Annotated[
|
||||||
@ -57,8 +56,7 @@ def trigger(
|
|||||||
ctx.obj['obsws'].trigger_hotkey_by_name(hotkey)
|
ctx.obj['obsws'].trigger_hotkey_by_name(hotkey)
|
||||||
|
|
||||||
|
|
||||||
@app.command('trigger-sequence')
|
@app.command('trigger-sequence | trs')
|
||||||
@app.command('trs', hidden=True)
|
|
||||||
def trigger_sequence(
|
def trigger_sequence(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
key_id: Annotated[
|
key_id: Annotated[
|
||||||
|
|||||||
@ -8,8 +8,9 @@ from rich.table import Table
|
|||||||
from rich.text import Text
|
from rich.text import Text
|
||||||
|
|
||||||
from obsws_cli import console, util, validate
|
from obsws_cli import console, util, validate
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -17,8 +18,7 @@ def main():
|
|||||||
"""Control inputs in OBS."""
|
"""Control inputs in OBS."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('create')
|
@app.command('create | add')
|
||||||
@app.command('cr', hidden=True)
|
|
||||||
def create(
|
def create(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
@ -62,8 +62,7 @@ def create(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('remove')
|
@app.command('remove | rm')
|
||||||
@app.command('rm', hidden=True)
|
|
||||||
def remove(
|
def remove(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
@ -82,8 +81,7 @@ def remove(
|
|||||||
console.out.print(f'Input {console.highlight(ctx, input_name)} removed.')
|
console.out.print(f'Input {console.highlight(ctx, input_name)} removed.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('list')
|
@app.command('list | ls')
|
||||||
@app.command('ls', hidden=True)
|
|
||||||
def list_(
|
def list_(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input: Annotated[bool, typer.Option(help='Filter by input type.')] = False,
|
input: Annotated[bool, typer.Option(help='Filter by input type.')] = False,
|
||||||
@ -170,8 +168,7 @@ def list_(
|
|||||||
console.out.print(table)
|
console.out.print(table)
|
||||||
|
|
||||||
|
|
||||||
@app.command('list-kinds')
|
@app.command('list-kinds | ls-k')
|
||||||
@app.command('ls-k', hidden=True)
|
|
||||||
def list_kinds(
|
def list_kinds(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
):
|
):
|
||||||
@ -198,8 +195,7 @@ def list_kinds(
|
|||||||
console.out.print(table)
|
console.out.print(table)
|
||||||
|
|
||||||
|
|
||||||
@app.command('mute')
|
@app.command('mute | m')
|
||||||
@app.command('m', hidden=True)
|
|
||||||
def mute(
|
def mute(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
@ -221,8 +217,7 @@ def mute(
|
|||||||
console.out.print(f'Input {console.highlight(ctx, input_name)} muted.')
|
console.out.print(f'Input {console.highlight(ctx, input_name)} muted.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('unmute')
|
@app.command('unmute | um')
|
||||||
@app.command('um', hidden=True)
|
|
||||||
def unmute(
|
def unmute(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
@ -244,8 +239,7 @@ def unmute(
|
|||||||
console.out.print(f'Input {console.highlight(ctx, input_name)} unmuted.')
|
console.out.print(f'Input {console.highlight(ctx, input_name)} unmuted.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('toggle')
|
@app.command('toggle | tg')
|
||||||
@app.command('tg', hidden=True)
|
|
||||||
def toggle(
|
def toggle(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
@ -277,8 +271,7 @@ def toggle(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('volume')
|
@app.command('volume | vol')
|
||||||
@app.command('vol', hidden=True)
|
|
||||||
def volume(
|
def volume(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
@ -312,8 +305,7 @@ def volume(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('show')
|
@app.command('show | s')
|
||||||
@app.command('s', hidden=True)
|
|
||||||
def show(
|
def show(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
@ -406,8 +398,7 @@ def show(
|
|||||||
console.out.print(table)
|
console.out.print(table)
|
||||||
|
|
||||||
|
|
||||||
@app.command('update')
|
@app.command('update | upd')
|
||||||
@app.command('upd', hidden=True)
|
|
||||||
def update(
|
def update(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
|
|||||||
@ -5,8 +5,9 @@ from typing import Annotated, Optional
|
|||||||
import typer
|
import typer
|
||||||
|
|
||||||
from obsws_cli import console, util, validate
|
from obsws_cli import console, util, validate
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -14,8 +15,7 @@ def main():
|
|||||||
"""Commands for media inputs."""
|
"""Commands for media inputs."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('cursor')
|
@app.command('cursor | c')
|
||||||
@app.command('cur', hidden=True)
|
|
||||||
def cursor(
|
def cursor(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
@ -45,8 +45,7 @@ def cursor(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('play')
|
@app.command('play | p')
|
||||||
@app.command('p', hidden=True)
|
|
||||||
def play(
|
def play(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
@ -60,8 +59,7 @@ def play(
|
|||||||
console.out.print(f'Playing media input {console.highlight(ctx, input_name)}.')
|
console.out.print(f'Playing media input {console.highlight(ctx, input_name)}.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('pause')
|
@app.command('pause | pa')
|
||||||
@app.command('pa', hidden=True)
|
|
||||||
def pause(
|
def pause(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
@ -75,8 +73,7 @@ def pause(
|
|||||||
console.out.print(f'Paused media input {console.highlight(ctx, input_name)}.')
|
console.out.print(f'Paused media input {console.highlight(ctx, input_name)}.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('stop')
|
@app.command('stop | s')
|
||||||
@app.command('s', hidden=True)
|
|
||||||
def stop(
|
def stop(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
@ -90,8 +87,7 @@ def stop(
|
|||||||
console.out.print(f'Stopped media input {console.highlight(ctx, input_name)}.')
|
console.out.print(f'Stopped media input {console.highlight(ctx, input_name)}.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('restart')
|
@app.command('restart | r')
|
||||||
@app.command('r', hidden=True)
|
|
||||||
def restart(
|
def restart(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
|
|||||||
@ -7,8 +7,9 @@ from rich.table import Table
|
|||||||
from rich.text import Text
|
from rich.text import Text
|
||||||
|
|
||||||
from obsws_cli import console, util, validate
|
from obsws_cli import console, util, validate
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -16,8 +17,7 @@ def main():
|
|||||||
"""Control profiles in OBS."""
|
"""Control profiles in OBS."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('list')
|
@app.command('list | ls')
|
||||||
@app.command('ls', hidden=True)
|
|
||||||
def list_(ctx: typer.Context):
|
def list_(ctx: typer.Context):
|
||||||
"""List profiles."""
|
"""List profiles."""
|
||||||
resp = ctx.obj['obsws'].get_profile_list()
|
resp = ctx.obj['obsws'].get_profile_list()
|
||||||
@ -47,8 +47,7 @@ def list_(ctx: typer.Context):
|
|||||||
console.out.print(table)
|
console.out.print(table)
|
||||||
|
|
||||||
|
|
||||||
@app.command('current')
|
@app.command('current | get')
|
||||||
@app.command('get', hidden=True)
|
|
||||||
def current(ctx: typer.Context):
|
def current(ctx: typer.Context):
|
||||||
"""Get the current profile."""
|
"""Get the current profile."""
|
||||||
resp = ctx.obj['obsws'].get_profile_list()
|
resp = ctx.obj['obsws'].get_profile_list()
|
||||||
@ -57,8 +56,7 @@ def current(ctx: typer.Context):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('switch')
|
@app.command('switch | set')
|
||||||
@app.command('set', hidden=True)
|
|
||||||
def switch(
|
def switch(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
profile_name: Annotated[
|
profile_name: Annotated[
|
||||||
@ -83,8 +81,7 @@ def switch(
|
|||||||
console.out.print(f'Switched to profile {console.highlight(ctx, profile_name)}.')
|
console.out.print(f'Switched to profile {console.highlight(ctx, profile_name)}.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('create')
|
@app.command('create | new')
|
||||||
@app.command('new', hidden=True)
|
|
||||||
def create(
|
def create(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
profile_name: Annotated[
|
profile_name: Annotated[
|
||||||
@ -102,8 +99,7 @@ def create(
|
|||||||
console.out.print(f'Created profile {console.highlight(ctx, profile_name)}.')
|
console.out.print(f'Created profile {console.highlight(ctx, profile_name)}.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('remove')
|
@app.command('remove | rm')
|
||||||
@app.command('rm', hidden=True)
|
|
||||||
def remove(
|
def remove(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
profile_name: Annotated[
|
profile_name: Annotated[
|
||||||
|
|||||||
@ -7,8 +7,9 @@ from rich.table import Table
|
|||||||
from rich.text import Text
|
from rich.text import Text
|
||||||
|
|
||||||
from obsws_cli import console
|
from obsws_cli import console
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -16,8 +17,7 @@ def main():
|
|||||||
"""Control projectors in OBS."""
|
"""Control projectors in OBS."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('list-monitors')
|
@app.command('list-monitors | ls-m')
|
||||||
@app.command('ls-m', hidden=True)
|
|
||||||
def list_monitors(ctx: typer.Context):
|
def list_monitors(ctx: typer.Context):
|
||||||
"""List available monitors."""
|
"""List available monitors."""
|
||||||
resp = ctx.obj['obsws'].get_monitor_list()
|
resp = ctx.obj['obsws'].get_monitor_list()
|
||||||
@ -48,8 +48,7 @@ def list_monitors(ctx: typer.Context):
|
|||||||
console.out.print(table)
|
console.out.print(table)
|
||||||
|
|
||||||
|
|
||||||
@app.command('open')
|
@app.command('open | o')
|
||||||
@app.command('o', hidden=True)
|
|
||||||
def open(
|
def open(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
monitor_index: Annotated[
|
monitor_index: Annotated[
|
||||||
|
|||||||
@ -6,8 +6,9 @@ from typing import Annotated, Optional
|
|||||||
import typer
|
import typer
|
||||||
|
|
||||||
from obsws_cli import console
|
from obsws_cli import console
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -21,8 +22,7 @@ def _get_recording_status(ctx: typer.Context) -> tuple:
|
|||||||
return resp.output_active, resp.output_paused
|
return resp.output_active, resp.output_paused
|
||||||
|
|
||||||
|
|
||||||
@app.command('start')
|
@app.command('start | s')
|
||||||
@app.command('s', hidden=True)
|
|
||||||
def start(ctx: typer.Context):
|
def start(ctx: typer.Context):
|
||||||
"""Start recording."""
|
"""Start recording."""
|
||||||
active, paused = _get_recording_status(ctx)
|
active, paused = _get_recording_status(ctx)
|
||||||
@ -38,8 +38,7 @@ def start(ctx: typer.Context):
|
|||||||
console.out.print('Recording started successfully.')
|
console.out.print('Recording started successfully.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('stop')
|
@app.command('stop | st')
|
||||||
@app.command('st', hidden=True)
|
|
||||||
def stop(ctx: typer.Context):
|
def stop(ctx: typer.Context):
|
||||||
"""Stop recording."""
|
"""Stop recording."""
|
||||||
active, _ = _get_recording_status(ctx)
|
active, _ = _get_recording_status(ctx)
|
||||||
@ -53,8 +52,7 @@ def stop(ctx: typer.Context):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('toggle')
|
@app.command('toggle | tg')
|
||||||
@app.command('tg', hidden=True)
|
|
||||||
def toggle(ctx: typer.Context):
|
def toggle(ctx: typer.Context):
|
||||||
"""Toggle recording."""
|
"""Toggle recording."""
|
||||||
resp = ctx.obj['obsws'].toggle_record()
|
resp = ctx.obj['obsws'].toggle_record()
|
||||||
@ -64,8 +62,7 @@ def toggle(ctx: typer.Context):
|
|||||||
console.out.print('Recording stopped successfully.')
|
console.out.print('Recording stopped successfully.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('status')
|
@app.command('status | ss')
|
||||||
@app.command('ss', hidden=True)
|
|
||||||
def status(ctx: typer.Context):
|
def status(ctx: typer.Context):
|
||||||
"""Get recording status."""
|
"""Get recording status."""
|
||||||
active, paused = _get_recording_status(ctx)
|
active, paused = _get_recording_status(ctx)
|
||||||
@ -78,8 +75,7 @@ def status(ctx: typer.Context):
|
|||||||
console.out.print('Recording is not in progress.')
|
console.out.print('Recording is not in progress.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('resume')
|
@app.command('resume | r')
|
||||||
@app.command('r', hidden=True)
|
|
||||||
def resume(ctx: typer.Context):
|
def resume(ctx: typer.Context):
|
||||||
"""Resume recording."""
|
"""Resume recording."""
|
||||||
active, paused = _get_recording_status(ctx)
|
active, paused = _get_recording_status(ctx)
|
||||||
@ -94,8 +90,7 @@ def resume(ctx: typer.Context):
|
|||||||
console.out.print('Recording resumed successfully.')
|
console.out.print('Recording resumed successfully.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('pause')
|
@app.command('pause | p')
|
||||||
@app.command('p', hidden=True)
|
|
||||||
def pause(ctx: typer.Context):
|
def pause(ctx: typer.Context):
|
||||||
"""Pause recording."""
|
"""Pause recording."""
|
||||||
active, paused = _get_recording_status(ctx)
|
active, paused = _get_recording_status(ctx)
|
||||||
@ -110,8 +105,7 @@ def pause(ctx: typer.Context):
|
|||||||
console.out.print('Recording paused successfully.')
|
console.out.print('Recording paused successfully.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('directory')
|
@app.command('directory | d')
|
||||||
@app.command('d', hidden=True)
|
|
||||||
def directory(
|
def directory(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
record_directory: Annotated[
|
record_directory: Annotated[
|
||||||
@ -138,8 +132,7 @@ def directory(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('split')
|
@app.command('split | sp')
|
||||||
@app.command('sp', hidden=True)
|
|
||||||
def split(ctx: typer.Context):
|
def split(ctx: typer.Context):
|
||||||
"""Split the current recording."""
|
"""Split the current recording."""
|
||||||
active, paused = _get_recording_status(ctx)
|
active, paused = _get_recording_status(ctx)
|
||||||
@ -154,8 +147,7 @@ def split(ctx: typer.Context):
|
|||||||
console.out.print('Recording split successfully.')
|
console.out.print('Recording split successfully.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('chapter')
|
@app.command('chapter | ch')
|
||||||
@app.command('ch', hidden=True)
|
|
||||||
def chapter(
|
def chapter(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
chapter_name: Annotated[
|
chapter_name: Annotated[
|
||||||
|
|||||||
@ -3,8 +3,9 @@
|
|||||||
import typer
|
import typer
|
||||||
|
|
||||||
from obsws_cli import console
|
from obsws_cli import console
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -12,8 +13,7 @@ def main():
|
|||||||
"""Control profiles in OBS."""
|
"""Control profiles in OBS."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('start')
|
@app.command('start | s')
|
||||||
@app.command('s', hidden=True)
|
|
||||||
def start(ctx: typer.Context):
|
def start(ctx: typer.Context):
|
||||||
"""Start the replay buffer."""
|
"""Start the replay buffer."""
|
||||||
resp = ctx.obj['obsws'].get_replay_buffer_status()
|
resp = ctx.obj['obsws'].get_replay_buffer_status()
|
||||||
@ -25,8 +25,7 @@ def start(ctx: typer.Context):
|
|||||||
console.out.print('Replay buffer started.')
|
console.out.print('Replay buffer started.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('stop')
|
@app.command('stop | st')
|
||||||
@app.command('st', hidden=True)
|
|
||||||
def stop(ctx: typer.Context):
|
def stop(ctx: typer.Context):
|
||||||
"""Stop the replay buffer."""
|
"""Stop the replay buffer."""
|
||||||
resp = ctx.obj['obsws'].get_replay_buffer_status()
|
resp = ctx.obj['obsws'].get_replay_buffer_status()
|
||||||
@ -38,8 +37,7 @@ def stop(ctx: typer.Context):
|
|||||||
console.out.print('Replay buffer stopped.')
|
console.out.print('Replay buffer stopped.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('toggle')
|
@app.command('toggle | tg')
|
||||||
@app.command('tg', hidden=True)
|
|
||||||
def toggle(ctx: typer.Context):
|
def toggle(ctx: typer.Context):
|
||||||
"""Toggle the replay buffer."""
|
"""Toggle the replay buffer."""
|
||||||
resp = ctx.obj['obsws'].toggle_replay_buffer()
|
resp = ctx.obj['obsws'].toggle_replay_buffer()
|
||||||
@ -49,8 +47,7 @@ def toggle(ctx: typer.Context):
|
|||||||
console.out.print('Replay buffer is not active.')
|
console.out.print('Replay buffer is not active.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('status')
|
@app.command('status | ss')
|
||||||
@app.command('ss', hidden=True)
|
|
||||||
def status(ctx: typer.Context):
|
def status(ctx: typer.Context):
|
||||||
"""Get the status of the replay buffer."""
|
"""Get the status of the replay buffer."""
|
||||||
resp = ctx.obj['obsws'].get_replay_buffer_status()
|
resp = ctx.obj['obsws'].get_replay_buffer_status()
|
||||||
@ -60,8 +57,7 @@ def status(ctx: typer.Context):
|
|||||||
console.out.print('Replay buffer is not active.')
|
console.out.print('Replay buffer is not active.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('save')
|
@app.command('save | sv')
|
||||||
@app.command('sv', hidden=True)
|
|
||||||
def save(ctx: typer.Context):
|
def save(ctx: typer.Context):
|
||||||
"""Save the replay buffer."""
|
"""Save the replay buffer."""
|
||||||
ctx.obj['obsws'].save_replay_buffer()
|
ctx.obj['obsws'].save_replay_buffer()
|
||||||
|
|||||||
@ -7,8 +7,9 @@ from rich.table import Table
|
|||||||
from rich.text import Text
|
from rich.text import Text
|
||||||
|
|
||||||
from obsws_cli import console, util, validate
|
from obsws_cli import console, util, validate
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -16,8 +17,7 @@ def main():
|
|||||||
"""Control OBS scenes."""
|
"""Control OBS scenes."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('list')
|
@app.command('list | ls')
|
||||||
@app.command('ls', hidden=True)
|
|
||||||
def list_(
|
def list_(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
uuid: Annotated[bool, typer.Option(help='Show UUIDs of scenes')] = False,
|
uuid: Annotated[bool, typer.Option(help='Show UUIDs of scenes')] = False,
|
||||||
@ -66,8 +66,7 @@ def list_(
|
|||||||
console.out.print(table)
|
console.out.print(table)
|
||||||
|
|
||||||
|
|
||||||
@app.command('current')
|
@app.command('current | get')
|
||||||
@app.command('get', hidden=True)
|
|
||||||
def current(
|
def current(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
preview: Annotated[
|
preview: Annotated[
|
||||||
@ -91,8 +90,7 @@ def current(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('switch')
|
@app.command('switch | set')
|
||||||
@app.command('set', hidden=True)
|
|
||||||
def switch(
|
def switch(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_name: Annotated[
|
scene_name: Annotated[
|
||||||
|
|||||||
@ -6,8 +6,9 @@ import typer
|
|||||||
from rich.table import Table
|
from rich.table import Table
|
||||||
|
|
||||||
from obsws_cli import console, validate
|
from obsws_cli import console, validate
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -15,8 +16,7 @@ def main():
|
|||||||
"""Control scene collections in OBS."""
|
"""Control scene collections in OBS."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('list')
|
@app.command('list | ls')
|
||||||
@app.command('ls', hidden=True)
|
|
||||||
def list_(ctx: typer.Context):
|
def list_(ctx: typer.Context):
|
||||||
"""List all scene collections."""
|
"""List all scene collections."""
|
||||||
resp = ctx.obj['obsws'].get_scene_collection_list()
|
resp = ctx.obj['obsws'].get_scene_collection_list()
|
||||||
@ -40,8 +40,7 @@ def list_(ctx: typer.Context):
|
|||||||
console.out.print(table)
|
console.out.print(table)
|
||||||
|
|
||||||
|
|
||||||
@app.command('current')
|
@app.command('current | get')
|
||||||
@app.command('get', hidden=True)
|
|
||||||
def current(ctx: typer.Context):
|
def current(ctx: typer.Context):
|
||||||
"""Get the current scene collection."""
|
"""Get the current scene collection."""
|
||||||
resp = ctx.obj['obsws'].get_scene_collection_list()
|
resp = ctx.obj['obsws'].get_scene_collection_list()
|
||||||
@ -50,8 +49,7 @@ def current(ctx: typer.Context):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('switch')
|
@app.command('switch | set')
|
||||||
@app.command('set', hidden=True)
|
|
||||||
def switch(
|
def switch(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_collection_name: Annotated[
|
scene_collection_name: Annotated[
|
||||||
@ -79,8 +77,7 @@ def switch(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('create')
|
@app.command('create | new')
|
||||||
@app.command('new', hidden=True)
|
|
||||||
def create(
|
def create(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_collection_name: Annotated[
|
scene_collection_name: Annotated[
|
||||||
|
|||||||
@ -6,8 +6,9 @@ import typer
|
|||||||
from rich.table import Table
|
from rich.table import Table
|
||||||
|
|
||||||
from obsws_cli import console, util, validate
|
from obsws_cli import console, util, validate
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -15,8 +16,7 @@ def main():
|
|||||||
"""Control items in OBS scenes."""
|
"""Control items in OBS scenes."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('list')
|
@app.command('list | ls')
|
||||||
@app.command('ls', hidden=True)
|
|
||||||
def list_(
|
def list_(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_name: Annotated[
|
scene_name: Annotated[
|
||||||
@ -186,8 +186,7 @@ def _get_scene_name_and_item_id(
|
|||||||
return scene_name, scene_item_id
|
return scene_name, scene_item_id
|
||||||
|
|
||||||
|
|
||||||
@app.command('show')
|
@app.command('show | sh')
|
||||||
@app.command('sh', hidden=True)
|
|
||||||
def show(
|
def show(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_name: Annotated[
|
scene_name: Annotated[
|
||||||
@ -229,8 +228,7 @@ def show(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('hide')
|
@app.command('hide | h')
|
||||||
@app.command('h', hidden=True)
|
|
||||||
def hide(
|
def hide(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_name: Annotated[
|
scene_name: Annotated[
|
||||||
@ -271,8 +269,7 @@ def hide(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('toggle')
|
@app.command('toggle | tg')
|
||||||
@app.command('tg', hidden=True)
|
|
||||||
def toggle(
|
def toggle(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_name: Annotated[
|
scene_name: Annotated[
|
||||||
@ -333,8 +330,7 @@ def toggle(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('visible')
|
@app.command('visible | v')
|
||||||
@app.command('v', hidden=True)
|
|
||||||
def visible(
|
def visible(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_name: Annotated[
|
scene_name: Annotated[
|
||||||
@ -378,8 +374,7 @@ def visible(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('transform')
|
@app.command('transform | t')
|
||||||
@app.command('t', hidden=True)
|
|
||||||
def transform(
|
def transform(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
scene_name: Annotated[
|
scene_name: Annotated[
|
||||||
|
|||||||
@ -7,8 +7,9 @@ import obsws_python as obsws
|
|||||||
import typer
|
import typer
|
||||||
|
|
||||||
from obsws_cli import console
|
from obsws_cli import console
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -16,8 +17,7 @@ def main():
|
|||||||
"""Take screenshots using OBS."""
|
"""Take screenshots using OBS."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('save')
|
@app.command('save | sv')
|
||||||
@app.command('s', hidden=True)
|
|
||||||
def save(
|
def save(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
source_name: Annotated[
|
source_name: Annotated[
|
||||||
|
|||||||
@ -7,8 +7,9 @@ from rich.table import Table
|
|||||||
from rich.text import Text
|
from rich.text import Text
|
||||||
|
|
||||||
from obsws_cli import console, util
|
from obsws_cli import console, util
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -16,8 +17,7 @@ def main():
|
|||||||
"""Manage OBS settings."""
|
"""Manage OBS settings."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('show')
|
@app.command('show | sh')
|
||||||
@app.command('sh', hidden=True)
|
|
||||||
def show(
|
def show(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
video: Annotated[
|
video: Annotated[
|
||||||
@ -136,8 +136,7 @@ def show(
|
|||||||
console.out.print(profile_table)
|
console.out.print(profile_table)
|
||||||
|
|
||||||
|
|
||||||
@app.command('profile')
|
@app.command('profile | pr')
|
||||||
@app.command('pr', hidden=True)
|
|
||||||
def profile(
|
def profile(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
category: Annotated[
|
category: Annotated[
|
||||||
@ -183,8 +182,7 @@ def profile(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('stream-service')
|
@app.command('stream-service | ss')
|
||||||
@app.command('ss', hidden=True)
|
|
||||||
def stream_service(
|
def stream_service(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
type_: Annotated[
|
type_: Annotated[
|
||||||
@ -251,8 +249,7 @@ def stream_service(
|
|||||||
console.out.print('Stream service settings updated.')
|
console.out.print('Stream service settings updated.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('video')
|
@app.command('video | vi')
|
||||||
@app.command('vi', hidden=True)
|
|
||||||
def video(
|
def video(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
base_width: Annotated[
|
base_width: Annotated[
|
||||||
|
|||||||
@ -3,8 +3,9 @@
|
|||||||
import typer
|
import typer
|
||||||
|
|
||||||
from obsws_cli import console
|
from obsws_cli import console
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -18,8 +19,7 @@ def _get_streaming_status(ctx: typer.Context) -> tuple:
|
|||||||
return resp.output_active, resp.output_duration
|
return resp.output_active, resp.output_duration
|
||||||
|
|
||||||
|
|
||||||
@app.command('start')
|
@app.command('start | s')
|
||||||
@app.command('s', hidden=True)
|
|
||||||
def start(ctx: typer.Context):
|
def start(ctx: typer.Context):
|
||||||
"""Start streaming."""
|
"""Start streaming."""
|
||||||
active, _ = _get_streaming_status(ctx)
|
active, _ = _get_streaming_status(ctx)
|
||||||
@ -31,8 +31,7 @@ def start(ctx: typer.Context):
|
|||||||
console.out.print('Streaming started successfully.')
|
console.out.print('Streaming started successfully.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('stop')
|
@app.command('stop | st')
|
||||||
@app.command('st', hidden=True)
|
|
||||||
def stop(ctx: typer.Context):
|
def stop(ctx: typer.Context):
|
||||||
"""Stop streaming."""
|
"""Stop streaming."""
|
||||||
active, _ = _get_streaming_status(ctx)
|
active, _ = _get_streaming_status(ctx)
|
||||||
@ -44,8 +43,7 @@ def stop(ctx: typer.Context):
|
|||||||
console.out.print('Streaming stopped successfully.')
|
console.out.print('Streaming stopped successfully.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('toggle')
|
@app.command('toggle | tg')
|
||||||
@app.command('tg', hidden=True)
|
|
||||||
def toggle(ctx: typer.Context):
|
def toggle(ctx: typer.Context):
|
||||||
"""Toggle streaming."""
|
"""Toggle streaming."""
|
||||||
resp = ctx.obj['obsws'].toggle_stream()
|
resp = ctx.obj['obsws'].toggle_stream()
|
||||||
@ -55,8 +53,7 @@ def toggle(ctx: typer.Context):
|
|||||||
console.out.print('Streaming stopped successfully.')
|
console.out.print('Streaming stopped successfully.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('status')
|
@app.command('status | ss')
|
||||||
@app.command('ss', hidden=True)
|
|
||||||
def status(ctx: typer.Context):
|
def status(ctx: typer.Context):
|
||||||
"""Get streaming status."""
|
"""Get streaming status."""
|
||||||
active, duration = _get_streaming_status(ctx)
|
active, duration = _get_streaming_status(ctx)
|
||||||
|
|||||||
@ -3,8 +3,9 @@
|
|||||||
import typer
|
import typer
|
||||||
|
|
||||||
from obsws_cli import console
|
from obsws_cli import console
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -12,24 +13,21 @@ def main():
|
|||||||
"""Control studio mode in OBS."""
|
"""Control studio mode in OBS."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('enable')
|
@app.command('enable | on')
|
||||||
@app.command('on', hidden=True)
|
|
||||||
def enable(ctx: typer.Context):
|
def enable(ctx: typer.Context):
|
||||||
"""Enable studio mode."""
|
"""Enable studio mode."""
|
||||||
ctx.obj['obsws'].set_studio_mode_enabled(True)
|
ctx.obj['obsws'].set_studio_mode_enabled(True)
|
||||||
console.out.print('Studio mode has been enabled.')
|
console.out.print('Studio mode has been enabled.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('disable')
|
@app.command('disable | off')
|
||||||
@app.command('off', hidden=True)
|
|
||||||
def disable(ctx: typer.Context):
|
def disable(ctx: typer.Context):
|
||||||
"""Disable studio mode."""
|
"""Disable studio mode."""
|
||||||
ctx.obj['obsws'].set_studio_mode_enabled(False)
|
ctx.obj['obsws'].set_studio_mode_enabled(False)
|
||||||
console.out.print('Studio mode has been disabled.')
|
console.out.print('Studio mode has been disabled.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('toggle')
|
@app.command('toggle | tg')
|
||||||
@app.command('tg', hidden=True)
|
|
||||||
def toggle(ctx: typer.Context):
|
def toggle(ctx: typer.Context):
|
||||||
"""Toggle studio mode."""
|
"""Toggle studio mode."""
|
||||||
resp = ctx.obj['obsws'].get_studio_mode_enabled()
|
resp = ctx.obj['obsws'].get_studio_mode_enabled()
|
||||||
@ -41,8 +39,7 @@ def toggle(ctx: typer.Context):
|
|||||||
console.out.print('Studio mode is now enabled.')
|
console.out.print('Studio mode is now enabled.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('status')
|
@app.command('status | ss')
|
||||||
@app.command('ss', hidden=True)
|
|
||||||
def status(ctx: typer.Context):
|
def status(ctx: typer.Context):
|
||||||
"""Get the status of studio mode."""
|
"""Get the status of studio mode."""
|
||||||
resp = ctx.obj['obsws'].get_studio_mode_enabled()
|
resp = ctx.obj['obsws'].get_studio_mode_enabled()
|
||||||
|
|||||||
@ -5,8 +5,9 @@ from typing import Annotated, Optional
|
|||||||
import typer
|
import typer
|
||||||
|
|
||||||
from obsws_cli import console, validate
|
from obsws_cli import console, validate
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -14,8 +15,7 @@ def main():
|
|||||||
"""Control text inputs in OBS."""
|
"""Control text inputs in OBS."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('current')
|
@app.command('current | get')
|
||||||
@app.command('get', hidden=True)
|
|
||||||
def current(
|
def current(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
@ -41,8 +41,7 @@ def current(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.command('update')
|
@app.command('update | set')
|
||||||
@app.command('set', hidden=True)
|
|
||||||
def update(
|
def update(
|
||||||
ctx: typer.Context,
|
ctx: typer.Context,
|
||||||
input_name: Annotated[
|
input_name: Annotated[
|
||||||
|
|||||||
@ -3,8 +3,9 @@
|
|||||||
import typer
|
import typer
|
||||||
|
|
||||||
from obsws_cli import console
|
from obsws_cli import console
|
||||||
|
from obsws_cli.alias import SubTyperAliasGroup
|
||||||
|
|
||||||
app = typer.Typer()
|
app = typer.Typer(cls=SubTyperAliasGroup)
|
||||||
|
|
||||||
|
|
||||||
@app.callback()
|
@app.callback()
|
||||||
@ -12,24 +13,21 @@ def main():
|
|||||||
"""Control virtual camera in OBS."""
|
"""Control virtual camera in OBS."""
|
||||||
|
|
||||||
|
|
||||||
@app.command('start')
|
@app.command('start | s')
|
||||||
@app.command('s', hidden=True)
|
|
||||||
def start(ctx: typer.Context):
|
def start(ctx: typer.Context):
|
||||||
"""Start the virtual camera."""
|
"""Start the virtual camera."""
|
||||||
ctx.obj['obsws'].start_virtual_cam()
|
ctx.obj['obsws'].start_virtual_cam()
|
||||||
console.out.print('Virtual camera started.')
|
console.out.print('Virtual camera started.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('stop')
|
@app.command('stop | p')
|
||||||
@app.command('p', hidden=True)
|
|
||||||
def stop(ctx: typer.Context):
|
def stop(ctx: typer.Context):
|
||||||
"""Stop the virtual camera."""
|
"""Stop the virtual camera."""
|
||||||
ctx.obj['obsws'].stop_virtual_cam()
|
ctx.obj['obsws'].stop_virtual_cam()
|
||||||
console.out.print('Virtual camera stopped.')
|
console.out.print('Virtual camera stopped.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('toggle')
|
@app.command('toggle | tg')
|
||||||
@app.command('tg', hidden=True)
|
|
||||||
def toggle(ctx: typer.Context):
|
def toggle(ctx: typer.Context):
|
||||||
"""Toggle the virtual camera."""
|
"""Toggle the virtual camera."""
|
||||||
resp = ctx.obj['obsws'].toggle_virtual_cam()
|
resp = ctx.obj['obsws'].toggle_virtual_cam()
|
||||||
@ -39,8 +37,7 @@ def toggle(ctx: typer.Context):
|
|||||||
console.out.print('Virtual camera is disabled.')
|
console.out.print('Virtual camera is disabled.')
|
||||||
|
|
||||||
|
|
||||||
@app.command('status')
|
@app.command('status | ss')
|
||||||
@app.command('ss', hidden=True)
|
|
||||||
def status(ctx: typer.Context):
|
def status(ctx: typer.Context):
|
||||||
"""Get the status of the virtual camera."""
|
"""Get the status of the virtual camera."""
|
||||||
resp = ctx.obj['obsws'].get_virtual_cam_status()
|
resp = ctx.obj['obsws'].get_virtual_cam_status()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user