#3468·gopass

Bash command completion gets in the way

Author: whelephCreated Jun 12, 2026Updated Jun 13, 2026

macOS version: 15.7.7 (24G720) gopass version: gopass 1.17.0-git+ae9e8e2e go1.26.4 darwin amd64 bash version: GNU bash, version 5.3.12(1)-release (x86_64-apple-darwin23.6.0)

I've installed the latest RC version in the following way:

  • go install github.com/gopasspw/[email protected]
  • made sure that gopass binary is on $PATH:
bash
~$ type -a gopass
gopass is /Users/wheleph/go/bin/gopass
  • installed bash completion for gopass:
bash
~$ gopass --version
gopass 1.17.0-git+ae9e8e2e go1.26.4 darwin amd64
~$ gopass completion bash > gopass-completion.bash
~$ cat gopass-completion.bash
_gopass_bash_autocomplete() {
     local cur opts base
     COMPREPLY=()
     cur="${COMP_WORDS[COMP_CWORD]}"
     # Use error handling to prevent crashes from invalid flags
     opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-shell-completion 2>/dev/null ) || opts=""
     local IFS=$'\n'
     COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
     return 0
 }

complete -F _gopass_bash_autocomplete gopass
~$ source gopass-completion.bash
~$ gopass sho<tab>
  • if I hit Tab key after typing gopass sho in Bash prompt then I get this: gopass show:Display the content of a secret

The completion does work but it gets in the way a bit because I need to manually erase the description ("Display the content of a secret").