3 Commits

Author SHA1 Message Date
c660778698 if completion flag return early to avoid unnecessary VBAN connections
patch bump
2026-02-28 13:34:46 +00:00
5460965945 add to further notes 2026-02-27 23:06:00 +00:00
d03049e713 enable shell completion scripts 2026-02-27 22:59:20 +00:00
4 changed files with 12 additions and 8 deletions

View File

@@ -74,13 +74,16 @@ For every command and subcommand there exists a `--help` flag for further usage
2. Packet structure with [ident:1][ident-1] is emitted by the VBAN server only on pdirty events. This means we do not receive the initial state of those parameters on initial subscription. Therefore any commands which are intended to fetch the value of parameters defined in packet [ident:1][ident-1] will not work in this CLI. 2. Packet structure with [ident:1][ident-1] is emitted by the VBAN server only on pdirty events. This means we do not receive the initial state of those parameters on initial subscription. Therefore any commands which are intended to fetch the value of parameters defined in packet [ident:1][ident-1] will not work in this CLI.
3. Packet structure with [ident:1][ident-1] defines parameteric EQ data only for the [first channel][ident-1-peq]. 3. Packet structure with [ident:1][ident-1] defines parameteric EQ data only for the [first channel][ident-1-peq].
--- ---
## Further Notes ## Further Notes
I've made the effort to set up the basic skeletal structure of the CLI as well as demonstrate how to combine subcommand groups with subcommand groups so more can be implemented, it just needs doing. There may be restrictions on some things however, for example, retrieving values is only possible for parameters [defined in the protocol](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/3be2c1c36563afbd6df3da8436406c77d2cc1f10/VoicemeeterRemote.h#L787). Setting parameters can be done for anything possible by a string request. I've made the effort to set up the basic skeletal structure of the CLI as well as demonstrate how to combine subcommand groups with subcommand groups so more can be implemented, it just needs doing. There may be restrictions on some things however, for example, retrieving values is only possible for parameters [defined in the protocol](https://github.com/onyx-and-iris/Voicemeeter-SDK/blob/3be2c1c36563afbd6df3da8436406c77d2cc1f10/VoicemeeterRemote.h#L787). Setting parameters can be done for anything possible by a string request.
Shell completion scripts are available (for zsh, bash and fish) but I haven't tested them
Some of the help output needs improving for commands that branch off positional arguments.
If there's something missing that you would like to see added the best bet is to submit a PR. You may raise an issue and if it's quick and simple to do I may (or may not) do it. If there's something missing that you would like to see added the best bet is to submit a PR. You may raise an issue and if it's quick and simple to do I may (or may not) do it.
--- ---

View File

@@ -1,6 +1,6 @@
[project] [project]
name = "vban-cli" name = "vban-cli"
version = "0.4.0" version = "0.4.1"
description = "A command-line interface for Voicemeeter leveraging VBAN." description = "A command-line interface for Voicemeeter leveraging VBAN."
readme = "README.md" readme = "README.md"
license = { text = "LICENSE" } license = { text = "LICENSE" }

View File

@@ -16,6 +16,7 @@ app = App(
) )
app.command(strip.app.meta, name='strip') app.command(strip.app.meta, name='strip')
app.command(bus.app.meta, name='bus') app.command(bus.app.meta, name='bus')
app.register_install_completion_command()
@Parameter(name='*') @Parameter(name='*')
@@ -32,17 +33,17 @@ def launcher(
*tokens: Annotated[str, Parameter(show=False, allow_leading_hyphen=True)], *tokens: Annotated[str, Parameter(show=False, allow_leading_hyphen=True)],
vban_config: Annotated[VBANConfig, Parameter()] = VBANConfig(), vban_config: Annotated[VBANConfig, Parameter()] = VBANConfig(),
): ):
command, bound, _ = app.parse_args(tokens)
if tokens[0] == '--install-completion':
return command(*bound.args, **bound.kwargs)
with vban_cmd.api( with vban_cmd.api(
vban_config.kind, vban_config.kind,
ip=vban_config.host, ip=vban_config.host,
port=vban_config.port, port=vban_config.port,
streamname=vban_config.streamname, streamname=vban_config.streamname,
) as client: ) as client:
additional_kwargs = {} return command(*bound.args, **bound.kwargs, ctx=Context(client=client))
command, bound, _ = app.parse_args(tokens)
additional_kwargs['ctx'] = Context(client=client)
return command(*bound.args, **bound.kwargs, **additional_kwargs)
def run(): def run():

2
uv.lock generated
View File

@@ -124,7 +124,7 @@ wheels = [
[[package]] [[package]]
name = "vban-cli" name = "vban-cli"
version = "0.4.0" version = "0.4.1"
source = { editable = "." } source = { editable = "." }
dependencies = [ dependencies = [
{ name = "cyclopts" }, { name = "cyclopts" },