Aspirerelease/17.0

aspire completions script command

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

aspire completions script - Write a shell completion script to standard output.

Aspire CLI
aspire completions script [<shell>] [options]

The aspire completions script command writes a completion script for the specified shell to standard output. Source the script in your current session, or add it to your shell profile, to get Tab completion for aspire commands, subcommands, options, and values that have a completion source, such as enum values.

The command writes only the script, with no banner, colors, or markup, so it’s safe to redirect to a file or pipe to another command.

If you omit the shell argument, the CLI infers the shell from the SHELL environment variable. On Windows, when SHELL doesn’t name a supported shell, the CLI uses pwsh. If the shell can’t be inferred, the command fails and asks you to specify one.

For step-by-step setup, removal, and troubleshooting, see Shell completion.

  • <shell>

    The shell to generate a script for. Possible values are bash, fish, pwsh, and zsh. pwsh requires PowerShell 7 or later. cmd.exe and Windows PowerShell aren’t supported. Defaults to the shell named by SHELL, or pwsh on Windows.

The following options are available:

  • -?, -h, --help

    Prints help and usage documentation for the available commands and options.

  • -l, --log-level <Critical|Debug|Error|Information|None|Trace|Warning>

    Set the minimum log level for console output. Use this option to increase diagnostics while troubleshooting or reduce output in scripted runs.

  • --non-interactive

    Run the command in non-interactive mode, disabling all interactive prompts and spinners.

  • --nologo

    Suppress the startup banner and telemetry notice.

  • --banner

    Display the animated Aspire CLI welcome banner.

  • --wait-for-debugger

    Wait for a debugger to attach before running a command.

  • Enable completion in the current Bash shell:

    Bash
    source <(aspire completions script bash)
  • Enable completion in the current Zsh shell:

    Zsh
    source <(aspire completions script zsh)
  • Enable completion in the current Fish shell:

    Fish
    aspire completions script fish | source
  • Enable completion in the current PowerShell 7+ session:

    PowerShell
    aspire completions script pwsh | Out-String | Invoke-Expression
  • Save a Bash completion script to a file:

    Aspire CLI
    aspire completions script bash > aspire.bash