To avoid that the clear text password appears in the CLI history, you can use the \password command in psql.
rootsu - postgrespsql\password satnms which prompts you for a new passwordexample output
postgres@satnms7-dev:~$ psql
psql (15.10 (Debian 15.10-0+deb12u1))
Type "help" for help.
postgres=# \password satnms
Enter new password for user "satnms":
Enter it again:
postgres=# \q