generateCompletion
Generated reference page for the generateCompletion function export.
- Import:
@kjanat/dreamcli - Export kind: function
- Declared in:
src/core/completion/index.ts - Source link:
packages/dreamcli/src/core/completion/index.ts:65
Signatures
ts
function generateCompletion(schema: CLISchema, shell: Shell, options?: CompletionOptions): string;| Parameter | Type | Description |
|---|---|---|
schema | CLISchema | The CLI schema describing commands, flags, and args. |
shell | Shell | Target shell. |
options | CompletionOptions | undefined | Optional generator configuration such as function naming and root default-command completion behavior. |
Members
Members
generateCompletion
Generate a completion script for the given shell.
This is the primary completion entrypoint for most consumers. Pass a CLI schema and target shell, then write the returned script to a file or source it directly from the command line.
ts
(schema: CLISchema, shell: Shell, options?: CompletionOptions): string;Examples
ts
const script = generateCompletion(app.schema, 'bash');
// e.g. source <(mycli completions bash)