mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2025-08-06 20:01:45 +00:00
Compare commits
No commits in common. "0c72a10fb7ebd3f749b93496e418df7d150a51ab" and "4632260961660db0a29b1ba6310fa78682923455" have entirely different histories.
0c72a10fb7
...
4632260961
@ -5,13 +5,6 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
# [0.19.0] - 2025-06-23
|
||||
|
||||
### Added
|
||||
|
||||
- record split and record chapter commands, see [Record](https://github.com/onyx-and-iris/obsws-cli?tab=readme-ov-file#record)
|
||||
- As of OBS 30.2.0, the only file format supporting *record chapter* is Hybrid MP4.
|
||||
|
||||
# [0.18.0] - 2025-06-21
|
||||
|
||||
### Added
|
||||
|
75
README.md
75
README.md
@ -14,7 +14,6 @@ For an outline of past/future changes refer to: [CHANGELOG](CHANGELOG.md)
|
||||
|
||||
- [Installation](#installation)
|
||||
- [Configuration](#configuration)
|
||||
- [Style](#style)
|
||||
- [Commands](#root-typer)
|
||||
- [License](#license)
|
||||
|
||||
@ -69,37 +68,6 @@ OBS_PASSWORD=<websocket password>
|
||||
|
||||
Flags can be used to override environment variables.
|
||||
|
||||
## Style
|
||||
|
||||
Styling is opt-in, by default you will get a colourless output:
|
||||
|
||||

|
||||
|
||||
You may enable styling with the --style/-s flag:
|
||||
|
||||
```console
|
||||
obsws-cli --style="cyan" sceneitem list
|
||||
```
|
||||
|
||||
Available styles: _red, magenta, purple, blue, cyan, green, yellow, orange, white, grey, navy, black_
|
||||
|
||||

|
||||
|
||||
Optionally you may disable border colouring with the --no-border flag:
|
||||
|
||||

|
||||
|
||||
```console
|
||||
obsws-cli --style="cyan" --no-border sceneitem list
|
||||
```
|
||||
|
||||
Or with environment variables:
|
||||
|
||||
```env
|
||||
OBS_STYLE=cyan
|
||||
OBS_STYLE_NO_BORDER=true
|
||||
```
|
||||
|
||||
## Root Typer
|
||||
|
||||
- obs-version: Get the OBS Client and WebSocket versions.
|
||||
@ -386,21 +354,6 @@ obsws-cli record directory "/home/me/obs-vids/"
|
||||
obsws-cli record directory "C:/Users/me/Videos"
|
||||
```
|
||||
|
||||
- split: Split the current recording.
|
||||
|
||||
```console
|
||||
obsws-cli record split
|
||||
```
|
||||
|
||||
- chapter: Create a chapter in the current recording.
|
||||
|
||||
*optional*
|
||||
- args: <chapter_name>
|
||||
|
||||
```console
|
||||
obsws-cli record chapter "Chapter Name"
|
||||
```
|
||||
|
||||
#### Stream
|
||||
|
||||
- start: Start streaming.
|
||||
@ -660,6 +613,34 @@ obsws-cli projector open --monitor-index=1 "test_group"
|
||||
obsws-cli screenshot save --width=2560 --height=1440 "Scene" "C:\Users\me\Videos\screenshot.png"
|
||||
```
|
||||
|
||||
## Style
|
||||
|
||||
By default styling is disabled but you may enable it with:
|
||||
|
||||
- --style/-s: Style used in output.
|
||||
- OBS_STYLE
|
||||
- --no-border/-b: Disable table border styling in output.
|
||||
- OBS_STYLE_NO_BORDER
|
||||
|
||||
Available styles:
|
||||
|
||||
- red
|
||||
- magenta
|
||||
- purple
|
||||
- blue
|
||||
- cyan
|
||||
- green
|
||||
- yellow
|
||||
- orange
|
||||
- white
|
||||
- grey
|
||||
- navy
|
||||
- black
|
||||
|
||||
```console
|
||||
obsws-cli --style=cyan --no-border scene list
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
`obsws-cli` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 6.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.4 KiB |
@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
__version__ = "0.19.1"
|
||||
__version__ = "0.18.4"
|
||||
|
@ -62,8 +62,8 @@ def list_(
|
||||
(Text('Enabled', justify='center'), 'center', None),
|
||||
(Text('Settings', justify='center'), 'center', ctx.obj['style'].column),
|
||||
]
|
||||
for heading, justify, style in columns:
|
||||
table.add_column(heading, justify=justify, style=style)
|
||||
for name, justify, style in columns:
|
||||
table.add_column(name, justify=justify, style=style)
|
||||
|
||||
for filter in resp.filters:
|
||||
resp = ctx.obj['obsws'].get_source_filter_default_settings(filter['filterKind'])
|
||||
|
@ -61,8 +61,8 @@ def list_(
|
||||
(Text('Group Name', justify='center'), 'left', ctx.obj['style'].column),
|
||||
(Text('Enabled', justify='center'), 'center', None),
|
||||
]
|
||||
for heading, justify, style in columns:
|
||||
table.add_column(heading, justify=justify, style=style)
|
||||
for column, justify, style in columns:
|
||||
table.add_column(column, justify=justify, style=style)
|
||||
|
||||
for item_id, group_name, is_enabled in groups:
|
||||
table.add_row(
|
||||
|
@ -74,8 +74,8 @@ def list_(
|
||||
(Text('Kind', justify='center'), 'center', ctx.obj['style'].column),
|
||||
(Text('Muted', justify='center'), 'center', None),
|
||||
]
|
||||
for heading, justify, style in columns:
|
||||
table.add_column(heading, justify=justify, style=style)
|
||||
for column, justify, style in columns:
|
||||
table.add_column(column, justify=justify, style=style)
|
||||
|
||||
for input_name, input_kind, input_uuid in inputs:
|
||||
input_mark = ''
|
||||
|
@ -29,8 +29,8 @@ def list_(ctx: typer.Context):
|
||||
(Text('Profile Name', justify='center'), 'left', ctx.obj['style'].column),
|
||||
(Text('Current', justify='center'), 'center', None),
|
||||
]
|
||||
for heading, justify, style in columns:
|
||||
table.add_column(heading, justify=justify, style=style)
|
||||
for column, justify, style in columns:
|
||||
table.add_column(column, justify=justify, style=style)
|
||||
|
||||
for profile in resp.profiles:
|
||||
table.add_row(
|
||||
|
@ -130,43 +130,3 @@ def directory(
|
||||
console.out.print(
|
||||
f'Recording directory: {console.highlight(ctx, resp.record_directory)}'
|
||||
)
|
||||
|
||||
|
||||
@app.command('split | sp')
|
||||
def split(ctx: typer.Context):
|
||||
"""Split the current recording."""
|
||||
active, paused = _get_recording_status(ctx)
|
||||
if not active:
|
||||
console.err.print('Recording is not in progress, cannot split.')
|
||||
raise typer.Exit(1)
|
||||
if paused:
|
||||
console.err.print('Recording is paused, cannot split.')
|
||||
raise typer.Exit(1)
|
||||
|
||||
ctx.obj['obsws'].split_record_file()
|
||||
console.out.print('Recording split successfully.')
|
||||
|
||||
|
||||
@app.command('chapter | ch')
|
||||
def chapter(
|
||||
ctx: typer.Context,
|
||||
chapter_name: Annotated[
|
||||
Optional[str],
|
||||
typer.Argument(
|
||||
help='Name of the chapter to create.',
|
||||
),
|
||||
] = None,
|
||||
):
|
||||
"""Create a chapter in the current recording."""
|
||||
active, paused = _get_recording_status(ctx)
|
||||
if not active:
|
||||
console.err.print('Recording is not in progress, cannot create chapter.')
|
||||
raise typer.Exit(1)
|
||||
if paused:
|
||||
console.err.print('Recording is paused, cannot create chapter.')
|
||||
raise typer.Exit(1)
|
||||
|
||||
ctx.obj['obsws'].create_record_chapter(chapter_name)
|
||||
console.out.print(
|
||||
f'Chapter {console.highlight(ctx, chapter_name or "unnamed")} created successfully.'
|
||||
)
|
||||
|
@ -43,8 +43,8 @@ def list_(
|
||||
(Text('Scene Name', justify='center'), 'left', ctx.obj['style'].column),
|
||||
(Text('Active', justify='center'), 'center', None),
|
||||
]
|
||||
for heading, justify, style in columns:
|
||||
table.add_column(heading, justify=justify, style=style)
|
||||
for column, justify, style in columns:
|
||||
table.add_column(column, justify=justify, style=style)
|
||||
|
||||
for scene_name, scene_uuid in scenes:
|
||||
if uuid:
|
||||
@ -108,11 +108,7 @@ def switch(
|
||||
|
||||
if preview:
|
||||
ctx.obj['obsws'].set_current_preview_scene(scene_name)
|
||||
console.out.print(
|
||||
f'Switched to preview scene: {console.highlight(ctx, scene_name)}'
|
||||
)
|
||||
console.out.print(f'Switched to preview scene: [green]{scene_name}[/green]')
|
||||
else:
|
||||
ctx.obj['obsws'].set_current_program_scene(scene_name)
|
||||
console.out.print(
|
||||
f'Switched to program scene: {console.highlight(ctx, scene_name)}'
|
||||
)
|
||||
console.out.print(f'Switched to program scene: [green]{scene_name}[/green]')
|
||||
|
@ -78,8 +78,8 @@ def list_(
|
||||
('Enabled', 'center', None),
|
||||
]
|
||||
# Add columns to the table
|
||||
for heading, justify, style in columns:
|
||||
table.add_column(heading, justify=justify, style=style)
|
||||
for column, justify, style in columns:
|
||||
table.add_column(column, justify=justify, style=style)
|
||||
|
||||
for item_id, item_name, is_group, is_enabled, source_uuid in items:
|
||||
if is_group:
|
||||
|
@ -42,6 +42,11 @@ class Disabled(Style):
|
||||
column: str = 'none'
|
||||
highlight: str = 'none'
|
||||
|
||||
def __post_init__(self):
|
||||
"""Post-initialization to set default values."""
|
||||
super().__post_init__()
|
||||
os.environ['NO_COLOR'] = '1'
|
||||
|
||||
|
||||
@register_style
|
||||
@dataclass
|
||||
@ -177,7 +182,4 @@ class Black(Style):
|
||||
|
||||
def request_style_obj(style_name: str, no_border: bool) -> Style:
|
||||
"""Entry point for style objects. Returns a Style object based on the style name."""
|
||||
if style_name == 'disabled':
|
||||
os.environ['NO_COLOR'] = '1'
|
||||
|
||||
return registry[style_name.lower()](no_border=no_border)
|
||||
|
@ -21,7 +21,7 @@ classifiers = [
|
||||
"Programming Language :: Python :: Implementation :: CPython",
|
||||
"Programming Language :: Python :: Implementation :: PyPy",
|
||||
]
|
||||
dependencies = ["typer>=0.16.0", "obsws-python>=1.8.0", "python-dotenv>=1.1.0"]
|
||||
dependencies = ["typer>=0.16.0", "obsws-python>=1.7.2", "python-dotenv>=1.1.0"]
|
||||
|
||||
|
||||
[project.urls]
|
||||
|
Loading…
x
Reference in New Issue
Block a user