I’m using v15. I think I got something with the show database command.
asterisk -rx 'database show' | egrep "accountcode|cidname"
this outputs
/AMPUSER/1001/cidname : John Doe
/AMPUSER/1001/accountcode : Site-Room 1