completion CLI command reference

Detailed information on the completion CLI command

Description

Generates shell completion scripts

Usage

  1. dapr completion [flags]
  2. dapr completion [command]

Flags

NameEnvironment VariableDefaultDescription
—help, -hPrints this help message

Examples

Installing bash completion on macOS using Homebrew

If running Bash 3.2 included with macOS:

  1. brew install bash-completion

Or, if running Bash 4.1+:

  1. brew install bash-completion@2

Add the completion to your completion directory:

  1. dapr completion bash > $(brew --prefix)/etc/bash_completion.d/dapr
  2. source ~/.bash_profile

Installing bash completion on Linux

If bash-completion is not installed on Linux, please install the bash-completion’ package via your distribution’s package manager.

Load the dapr completion code for bash into the current shell:

  1. source <(dapr completion bash)

Write bash completion code to a file and source if from .bash_profile:

  1. dapr completion bash > ~/.dapr/completion.bash.inc
  2. printf "source '$HOME/.dapr/completion.bash.inc'" >> $HOME/.bash_profile
  3. source $HOME/.bash_profile

Installing zsh completion on macOS using homebrew

If zsh-completion is not installed on macOS, please install the ‘zsh-completion’ package:

  1. brew install zsh-completions

Set the dapr completion code for zsh[1] to autoload on startup:

  1. dapr completion zsh > "${fpath[1]}/_dapr"
  2. source ~/.zshrc

Installing zsh completion on Linux

If zsh-completion is not installed on Linux, please install the ‘zsh-completion’ package via your distribution’s package manager.

Load the dapr completion code for zsh into the current shell:

  1. source <(dapr completion zsh)

Set the dapr completion code for zsh[1] to autoload on startup:

  1. dapr completion zsh > "${fpath[1]}/_dapr"

Installing Powershell completion on Windows

Create $PROFILE if it not exists:

  1. if (!(Test-Path -Path $PROFILE )){ New-Item -Type File -Path $PROFILE -Force }

Add the completion to your profile:

  1. dapr completion powershell >> $PROFILE

Available Commands

  1. bash Generates bash completion scripts
  2. powershell Generates powershell completion scripts
  3. zsh Generates zsh completion scripts

Last modified August 2, 2021 : Fix Java SDK link (#1695) (2c67fd1)