[pass] [feature] dir command, for changing $PASSWORD_STORE_DIR

Kevin Lyda kevin at ie.suberic.net
Tue Oct 21 12:10:10 CEST 2014


On Fri, Oct 17, 2014 at 4:31 PM, George Angelopoulos <george at usermod.net> wrote:
> This could also be implemented in pass itself, as a command, like "pass
> dir $dirname". Is there any interest for this? Is it feature creep? I'm
> ok sticking with my shell function but I thought I'd mention it.

Actually it can't.  Unlike your shell function, the pass command can't
export out the PASSWORD_STORE_DIR environment var. A child process
can't change the environment of its parent.

However pass could be changed to have a $HOME/.password-storerc file
that could persist state like this. If it exists, pass could source it
on each run and then a "pass repo <password repository>" command could
update the PASSWORD_STORE_DIR var in $HOME/.password-storerc.

You could also do a "pass cd <dir>" command to enable relative access
within an individual repo.  So say you had a
project-x/environment-y/component-z/ssl dir for the keys used by the
webservers.  You could "pass cd project-x/environment-y/component-z;
pass ls" and then the listing would be relative to that dir - as would
all subsequent commands.

Not really sure how useful that would be, but that's what you'd need
to do to save state.

Kevin

-- 
Kevin Lyda
Galway, Ireland


More information about the Password-Store mailing list