mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2026-02-16 09:57:49 +00:00
Compare commits
No commits in common. "main" and "v0.24.7" have entirely different histories.
20
.github/dependabot.yml
vendored
20
.github/dependabot.yml
vendored
@ -1,20 +0,0 @@
|
|||||||
# To get started with Dependabot version updates, you'll need to specify which
|
|
||||||
# package ecosystems to update and where the package manifests are located.
|
|
||||||
# Please see the documentation for all configuration options:
|
|
||||||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
|
||||||
|
|
||||||
version: 2
|
|
||||||
updates:
|
|
||||||
- package-ecosystem: "github-actions" # See documentation for possible values
|
|
||||||
directory: "/" # Location of package manifests
|
|
||||||
schedule:
|
|
||||||
interval: "weekly"
|
|
||||||
day: "monday"
|
|
||||||
time: "09:00"
|
|
||||||
|
|
||||||
- package-ecosystem: "pip"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "weekly"
|
|
||||||
day: "monday"
|
|
||||||
time: "09:00"
|
|
||||||
4
.github/workflows/publish.yml
vendored
4
.github/workflows/publish.yml
vendored
@ -19,10 +19,10 @@ jobs:
|
|||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v6
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.11'
|
||||||
cache: 'pip'
|
cache: 'pip'
|
||||||
|
|||||||
2
.github/workflows/ruff.yml
vendored
2
.github/workflows/ruff.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
|||||||
ruff:
|
ruff:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v4
|
||||||
- uses: astral-sh/ruff-action@v3
|
- uses: astral-sh/ruff-action@v3
|
||||||
with:
|
with:
|
||||||
args: 'format --check --diff'
|
args: 'format --check --diff'
|
||||||
|
|||||||
10
CHANGELOG.md
10
CHANGELOG.md
@ -5,16 +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/),
|
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).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
# [0.24.8] - 2026-02-07
|
|
||||||
|
|
||||||
### Changed
|
|
||||||
|
|
||||||
- --debug flag removed and replaced with --loglevel. See [Flags](https://github.com/onyx-and-iris/obsws-cli/tree/main?tab=readme-ov-file#flags). This gives the user more control over the level of logging. The default level has been set to WARNING.
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
|
|
||||||
- shell completion now works, see [Shell Completion](https://github.com/onyx-and-iris/obsws-cli/tree/main?tab=readme-ov-file#shell-completion). Unfortunately, command aliases in the help output are no longer present as it was breaking shell completion. However, the aliases do still work. See [issue #3](https://github.com/onyx-and-iris/obsws-cli/issues/3)
|
|
||||||
|
|
||||||
# [0.24.6] - 2026-01-26
|
# [0.24.6] - 2026-01-26
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@ -49,8 +49,6 @@ The CLI should now be discoverable as `obsws-cli`
|
|||||||
- --password/-p: Websocket password
|
- --password/-p: Websocket password
|
||||||
- --timeout/-T: Websocket timeout
|
- --timeout/-T: Websocket timeout
|
||||||
- --version/-v: Print the obsws-cli version
|
- --version/-v: Print the obsws-cli version
|
||||||
- --loglevel/-l: Set the application's logging level
|
|
||||||
- One of *NOTSET, DEBUG, INFO, WARN, WARNING, ERROR, CRITICAL, FATAL*
|
|
||||||
|
|
||||||
Pass `--host`, `--port` and `--password` as flags on the root command, for example:
|
Pass `--host`, `--port` and `--password` as flags on the root command, for example:
|
||||||
|
|
||||||
@ -68,7 +66,6 @@ Store and load environment variables from:
|
|||||||
OBSWS_CLI_HOST=localhost
|
OBSWS_CLI_HOST=localhost
|
||||||
OBSWS_CLI_PORT=4455
|
OBSWS_CLI_PORT=4455
|
||||||
OBSWS_CLI_PASSWORD=<websocket password>
|
OBSWS_CLI_PASSWORD=<websocket password>
|
||||||
OBSWS_CLI_LOGLEVEL=DEBUG
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Flags can be used to override environment variables.
|
Flags can be used to override environment variables.
|
||||||
@ -824,8 +821,6 @@ obsws-cli media restart "Media"
|
|||||||
obsws-cli --install-completion
|
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.8'
|
__version__ = '0.24.7'
|
||||||
|
|||||||
@ -28,21 +28,11 @@ def version_callback(value: bool):
|
|||||||
raise typer.Exit()
|
raise typer.Exit()
|
||||||
|
|
||||||
|
|
||||||
def setup_logging(loglevel: str):
|
def setup_logging(debug: bool):
|
||||||
"""Set up logging for the application."""
|
"""Set up logging for the application."""
|
||||||
level_map = logging.getLevelNamesMapping()
|
log_level = logging.DEBUG if debug else logging.CRITICAL
|
||||||
try:
|
|
||||||
level_int = level_map[loglevel.upper()]
|
|
||||||
except KeyError:
|
|
||||||
possible_levels = ', '.join(
|
|
||||||
sorted(level_map.keys(), key=lambda k: level_map[k])
|
|
||||||
)
|
|
||||||
raise typer.BadParameter(
|
|
||||||
f'Invalid log level: {loglevel}. Valid options are: {possible_levels}'
|
|
||||||
) from None
|
|
||||||
|
|
||||||
logging.basicConfig(
|
logging.basicConfig(
|
||||||
level=level_int,
|
level=log_level,
|
||||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -131,18 +121,19 @@ def main(
|
|||||||
callback=version_callback,
|
callback=version_callback,
|
||||||
),
|
),
|
||||||
] = False,
|
] = False,
|
||||||
loglevel: Annotated[
|
debug: Annotated[
|
||||||
str,
|
bool,
|
||||||
typer.Option(
|
typer.Option(
|
||||||
'--loglevel',
|
'--debug',
|
||||||
'-l',
|
'-d',
|
||||||
envvar='OBSWS_CLI_LOGLEVEL',
|
envvar='OBSWS_CLI_DEBUG',
|
||||||
is_eager=True,
|
is_eager=True,
|
||||||
help='Set the logging level',
|
help='Enable debug logging',
|
||||||
show_default=False,
|
show_default=False,
|
||||||
callback=setup_logging,
|
callback=setup_logging,
|
||||||
|
hidden=True,
|
||||||
),
|
),
|
||||||
] = envconfig.get('loglevel'),
|
] = envconfig.get('debug'),
|
||||||
):
|
):
|
||||||
"""obsws_cli is a command line interface for the OBS WebSocket API."""
|
"""obsws_cli is a command line interface for the OBS WebSocket API."""
|
||||||
ctx.ensure_object(dict)
|
ctx.ensure_object(dict)
|
||||||
|
|||||||
@ -124,7 +124,7 @@ _envconfig = EnvConfig(
|
|||||||
OBSWS_CLI_PORT=4455,
|
OBSWS_CLI_PORT=4455,
|
||||||
OBSWS_CLI_PASSWORD='',
|
OBSWS_CLI_PASSWORD='',
|
||||||
OBSWS_CLI_TIMEOUT=5,
|
OBSWS_CLI_TIMEOUT=5,
|
||||||
OBSWS_CLI_LOGLEVEL='WARNING',
|
OBSWS_CLI_DEBUG=False,
|
||||||
OBSWS_CLI_STYLE='disabled',
|
OBSWS_CLI_STYLE='disabled',
|
||||||
OBSWS_CLI_STYLE_NO_BORDER=False,
|
OBSWS_CLI_STYLE_NO_BORDER=False,
|
||||||
)
|
)
|
||||||
|
|||||||
@ -35,9 +35,6 @@ obsws-cli = "obsws_cli:app"
|
|||||||
[tool.hatch.version]
|
[tool.hatch.version]
|
||||||
path = "obsws_cli/__about__.py"
|
path = "obsws_cli/__about__.py"
|
||||||
|
|
||||||
[tool.hatch.env]
|
|
||||||
requires = ["hatch-dotenv"]
|
|
||||||
|
|
||||||
[tool.hatch.envs.default]
|
[tool.hatch.envs.default]
|
||||||
dependencies = ["click-man>=0.5.1"]
|
dependencies = ["click-man>=0.5.1"]
|
||||||
|
|
||||||
@ -48,10 +45,6 @@ man = "python man/generate.py --output=./man"
|
|||||||
[tool.hatch.envs.hatch-test]
|
[tool.hatch.envs.hatch-test]
|
||||||
randomize = true
|
randomize = true
|
||||||
|
|
||||||
[tool.hatch.env.collectors.dotenv.hatch-test]
|
|
||||||
env-files = [".env", ".test.env"]
|
|
||||||
fail-on-missing = true
|
|
||||||
|
|
||||||
[tool.hatch.envs.types]
|
[tool.hatch.envs.types]
|
||||||
extra-dependencies = ["mypy>=1.0.0"]
|
extra-dependencies = ["mypy>=1.0.0"]
|
||||||
[tool.hatch.envs.types.scripts]
|
[tool.hatch.envs.types.scripts]
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import os
|
|||||||
import time
|
import time
|
||||||
|
|
||||||
import obsws_python as obsws
|
import obsws_python as obsws
|
||||||
|
from dotenv import find_dotenv, load_dotenv
|
||||||
|
|
||||||
|
|
||||||
def pytest_configure(config):
|
def pytest_configure(config):
|
||||||
@ -33,12 +34,14 @@ def pytest_sessionstart(session):
|
|||||||
)
|
)
|
||||||
print(' '.join(out))
|
print(' '.join(out))
|
||||||
|
|
||||||
|
load_dotenv(find_dotenv('.test.env'))
|
||||||
|
|
||||||
session.obsws.set_stream_service_settings(
|
session.obsws.set_stream_service_settings(
|
||||||
'rtmp_common',
|
'rtmp_common',
|
||||||
{
|
{
|
||||||
'service': 'Twitch',
|
'service': 'Twitch',
|
||||||
'server': 'auto',
|
'server': 'auto',
|
||||||
'key': os.environ['OBSWS_CLI_TESTS_STREAM_KEY'],
|
'key': os.environ['OBS_STREAM_KEY'],
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -60,7 +63,7 @@ def pytest_sessionstart(session):
|
|||||||
'linux': 'pulse_output_capture',
|
'linux': 'pulse_output_capture',
|
||||||
'darwin': 'coreaudio_output_capture',
|
'darwin': 'coreaudio_output_capture',
|
||||||
}
|
}
|
||||||
platform = os.environ['OBSWS_CLI_TESTS_PLATFORM']
|
platform = os.environ.get('OBS_TESTS_PLATFORM', os.uname().sysname.lower())
|
||||||
try:
|
try:
|
||||||
session.obsws.create_input(
|
session.obsws.create_input(
|
||||||
sceneName='pytest_scene',
|
sceneName='pytest_scene',
|
||||||
|
|||||||
@ -9,7 +9,7 @@ from obsws_cli.app import app
|
|||||||
|
|
||||||
runner = CliRunner()
|
runner = CliRunner()
|
||||||
|
|
||||||
if os.environ.get('OBSWS_CLI_TESTS_SKIP_GROUP_TESTS'):
|
if os.environ.get('OBS_TESTS_SKIP_GROUP_TESTS'):
|
||||||
pytest.skip(
|
pytest.skip(
|
||||||
'Skipping group tests as per environment variable', allow_module_level=True
|
'Skipping group tests as per environment variable', allow_module_level=True
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user