git-credential-keepassxc icon indicating copy to clipboard operation
git-credential-keepassxc copied to clipboard

Allow `get` to optionally receive one argument, and print only that field

Open stdedos opened this issue 3 years ago • 2 comments

$ git-credential-keepassxc --unlock 20 get password
passw0rd
$ git-credential-keepassxc --unlock 20 get username
root

Use case:

  • I'd want to apply "separation of concerns" to a program that I am running. I want to pass one command, and tell to the program "if you run this, you will get the password".
  • I'd like to allow users to be able to plug their own credential-solution, and
  • "myself" internalizing per-credential-manager solution seems infeasible

Workarounds considered: ... I think for now I'll write a shell script that does that, I guess. I'd prefer wouldn't have to do that, though.

stdedos avatar Nov 30 '22 11:11 stdedos

This is much too niche imo, and really it can't be easier with some basic bash:

printf 'url=xxx' | git-credential-keepassxc get --json | jq -r '.username'
printf 'url=xxx' | git-credential-keepassxc get --json | jq -r '.password'

I see little value embedding it in git-credential-keepassxc I'm afraid.

Frederick888 avatar Nov 30 '22 11:11 Frederick888

Thought so. I just thought I'd leave it here if "this gets enough attention".

stdedos avatar Nov 30 '22 11:11 stdedos