List all keys added to keychain using `security add-generic-password`

Solution 1:

As of 2021-11-25, there is no flag in security to output only the keys so you have to get the whole list and then look for the relevant value:

security dump-keychain | awk -F'=' '/0x00000007/ { print $2 }'

Learn more about awk pattern matching.