module

Obsctl::CLI::Completions

Generates shell completion scripts from the command registry.

Nothing here hardcodes a command name: the word lists come from Domain::CommandRegistry, so a command added there completes everywhere without a second edit. Argument values that only the daemon knows — scene, profile, collection, and audio-input names — are completed by shelling back out to obsctl, which keeps the suggestions live.

Constants

CANDIDATE_KINDS = ["scenes", "profiles", "collections", "audio"]

Kinds of live name obsctl completions candidates can list.

GLOBAL_FLAGS = ["--config", "--log-level", "--color", "--timeout", "--force", "--json", "--quiet", "--version", "--help"]
LOCAL_COMMANDS = ["init", "doctor", "config", "watch", "completions", "server", "service", "tui", "version", "help"]
LOCAL_SUBCOMMANDS = {"config" => ["explain", "diff", "migrate"], "service" => ["install", "uninstall", "start", "stop", "restart", "status"]}

Subcommands the CLI serves locally, with their own fixed arguments.

SHELLS = ["bash", "zsh", "fish"]

Instance methods

candidates(kind : String, snapshot : JSON::Any | Nil) : Array(String)

Lists live names for one kind, one per line.

Completion runs on every Tab press, so an unreachable daemon or a malformed reply yields no candidates instead of an error: a shell completion that prints a diagnostic into the command line is worse than one that suggests nothing.

Source
commands

Every word that can appear in the command position.

Source
dynamic_argument_commands

Commands whose first argument names a live OBS resource, grouped by the obsctl query that lists those names.

Source
render(shell : String) : String

Renders the completion script for one shell.

Source
static_argument_commands

Commands whose first argument is a fixed word list.

Source