Skip to content

CompletionRegistrationOptions ​

Options for CLIBuilder.completions: the generator options plus where the built-in completion is exposed.

Signatures ​

ts
interface CompletionRegistrationOptions extends CompletionOptions {}

Members ​

Properties ​

as ​

Where the built-in shell completion is exposed.

  • 'command' registers a completions subcommand (the default).
  • 'flag' exposes an eager --completions <shell> flag on the CLI root instead, keeping the root free of a completions subcommand.
ts
as?: "flag" | "command";

functionPrefix ​

Override the generated shell function name prefix.

Defaults to the CLI name from the schema. This is mainly useful when embedding multiple generated scripts in the same environment and you want deterministic, collision-free helper names.

ts
functionPrefix?: string;

rootMode ​

Controls which root-level surface shell completion exposes when a default command exists.

  • 'subcommands' keeps hybrid CLIs command-centric at the root while still exposing default-command flags for a single visible default command.
  • 'surface' exposes the default command's root-usable flags at the root whenever a visible default command exists.
ts
rootMode?: "surface" | "subcommands";

See Also ​

Released under the MIT License.