Is it possible to view passwords through Terminal?
Check out the security command.  You can get detailed information about its use by reading its man entry man security

An in-depth article on the securitycommand is here.