Would you have a look at kpfpwd, it is a utility that I have written. 
It is similar to password store (pass) to query entries from KeePass 
databases:
https://gitlab.com/aelmahmoudy/kpfpwd

There is a CLI utility to edit KeePass files called kpcli:
http://sourceforge.net/projects/kpcli/

