Update Multiple Keychain entries
The CLI for keychains is security.

It lets you do many things such as setting passwords:

security add-generic-password [-a account] [-s service] [-w password] [options...] [-A|-T appPath] [keychain]


Read the man page for more info or do security help.