module
Obsctl::CLI::Completions
Overview
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.
Extended Modules
Defined in:
obsctl/cli/completions.crConstant Summary
-
CANDIDATE_KINDS =
["scenes", "profiles", "collections", "audio"] -
Kinds of live name
obsctl completions candidatescan 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 Method Summary
-
#candidates(kind : String, snapshot : JSON::Any | Nil) : Array(String)
Lists live names for one kind, one per line.
-
#commands : Array(String)
Every word that can appear in the command position.
-
#dynamic_argument_commands : Hash(String, Array(String))
Commands whose first argument names a live OBS resource, grouped by the
obsctlquery that lists those names. -
#render(shell : String) : String
Renders the completion script for one shell.
-
#static_argument_commands : Hash(String, Array(String))
Commands whose first argument is a fixed word list.
Instance Method Detail
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.
Commands whose first argument names a live OBS resource, grouped by the
obsctl query that lists those names.
Commands whose first argument is a fixed word list.