[pass] Multiple password contexts

Andrew Dunn andrew.g.dunn at gmail.com
Wed Nov 16 19:36:27 CET 2016

I was able to get Adam's suggestions to work, albeit it required a bit
of mucking about.

You'd need to set an alias for each pass<team> or whatever convention
you'd prefer to use:

vim ~/.bashrc
alias passered="PASSWORD_STORE_DIR=~/.pass/red
PASSWORD_STORE_GIT=~/.pass/red pass"
alias passblue="PASSWORD_STORE_DIR=~/.pass/blue
PASSWORD_STORE_GIT=~/.pass/blue pass"

The key here is that you set both the variables, otherwise git won't
have any context when you use it.

You then need to set your bash completion up, I'm on arch so the
completion path may be different for you:

vim ~/.bash_completion
source /usr/share/bash-completion/completions/pass

    PASSWORD_STORE_DIR=~/.pass/red/ _pass

complete -o filenames -o nospace -F _passred passred

    PASSWORD_STORE_DIR=~/.pass/blue/ _pass

complete -o filenames -o nospace -F _passblue passblue


You need to have the trailing `/` on the PASSWORD_STORE_DIR path,
otherwise your completion will look like `//` instead of actual
folders within the directory.

On Wed, Nov 16, 2016 at 10:47 AM, Héctor Rivas Gándara <keymon at gmail.com> wrote:
>> Adam:
>> Interesting suggestion! However, it appears that it might break the
>> git completion when you do that... or maybe I set something up wrong?
> I use this template git repo with some bash aliases:
> https://github.com/keymon/password-store-for-teams
> I have multiple password stores for multiple teams.
> Contributions are welcome, specially a equivalent for ksh and other shells.

More information about the Password-Store mailing list