Skip to content

generateZshCompletion

Generated reference page for the generateZshCompletion function export.

Signatures

ts
function generateZshCompletion(schema: CLISchema, options?: CompletionOptions): string;
ParameterTypeDescription
schemaCLISchemaThe CLI schema.
optionsCompletionOptions | undefinedOptional generator configuration.

Members

Members

generateZshCompletion

Generate a zsh completion script for the CLI.

Use this when you want a zsh-specific script directly rather than routing through generateCompletion. The generated script is compatible with zsh's normal #compdef / fpath loading flow.

ts
(schema: CLISchema, options?: CompletionOptions): string;

Examples

ts
const script = generateZshCompletion(app.schema);
// install with: mycli completions zsh > "${fpath[1]}/_mycli"

See Also

Released under the MIT License.