[pass] Multiple password contexts

Héctor Rivas Gándara keymon at gmail.com
Wed Nov 16 19:59:37 CET 2016


That's exactly what the repo I posted does in the script .load.bash

On 16 Nov 2016 18:36, "Andrew Dunn" <andrew.g.dunn at gmail.com> wrote:

> 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
>
> _passred(){
>     PASSWORD_STORE_DIR=~/.pass/red/ _pass
> }
>
> complete -o filenames -o nospace -F _passred passred
>
> _passblue(){
>     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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20161116/383ac259/attachment-0001.html>


More information about the Password-Store mailing list