[pass] Feature request – combined insert/generate/edit for new entries

Marcos Alano marcoshalano at gmail.com
Sat Jul 16 02:27:15 CEST 2016


Maybe implement a parameter '-p' in 'generate' subcommand which generates a
password and fill the first line with it?
Something like:
pass generate -p something_completely_different
:)

Em sex, 15 de jul de 2016 às 21:21, Lucas Hoffmann <l-m-h at web.de> escreveu:

> Quoting Kenny Evitt (2016-07-15 21:49:26)
> > I often want to add an entry but also generate a new random password and
> > add additional info ('edit') and, given that I'm tracking the history of
> > my entries with Git, it'd be nice (or nicest) to do all of that as a
> > single commit. Besides the Git history, it'd also be nice to do all of
> > that as a single `pass ...` command too.
> > The closest I can come to this is to run `pass edit ...`. In my editor
> > (Vim) I can insert the output of running `pwgen` easily enough (by
> running
> > the Vim command `:r !pwgen -s -y 32` or similar), but it'd be nice for
> > `pass edit ...` to insert a password for me (if no existing entry matches
> > the path I provide) or for another command to do so instead of `edit`.
>
> Does this solve your use case?
>
> pass generate -n somenew 20
> pass edit somenew
> GIT_SEQUENCE_EDITOR='sed -i "2 s/^pick/f/"' pass git rebase -i HEAD~2
> pass show -c somenew
>
> I got the idea with GIT_SEQUENCE_EDITOR from
> http://stackoverflow.com/questions/12394166 .
>
> You can wrap that in a function or script:
>
> pass-gen-edit () {
>   # $1 name
>   # $2 length
>   pass generate -n "$1" "$2"
>   pass edit "$1"
>   GIT_SEQUENCE_EDITOR='sed -i "2 s/^pick/fixup/"' pass git rebase -i HEAD~2
>   pass show -c "$1"
> }
>
> You can easily test this and remove the entry from your git history
> again with `pass git reset --hard HEAD~1`.
>
> Have fun and don't delete your important passwords with to much
> `pass git`-magic :)
>
> Lucas
> _______________________________________________
> Password-Store mailing list
> Password-Store at lists.zx2c4.com
> http://lists.zx2c4.com/mailman/listinfo/password-store
>
-- 

Marcos H. Alano

Sent from my Android
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20160716/8130e27a/attachment.html>


More information about the Password-Store mailing list