psql -U postgres -- connect as superuser
psql -U postgres -d mydb -- connect to specific DB
\l -- list databases
\c mydb -- switch database
\dt -- list tables
\q -- quitYou can also connect with a connection string:
psql "postgresql://user:pass@localhost:5432/mydb"