Due to security reasons, postgres (in contrast to mysql) does not allow a user to specify the password on the command line. However, there is a quick and hacky workaround which allow a psql command to be run without the password prompt.
From the command line, simply type:
export PGPASSWORD=yourpassword
From there you can now run:
psql -U username database