How to enter password automatically in .command
You could store ssh keys or store your password in the ~/.ssh/config file (see man ssh_config for details) but that would be kind of cheating since it's not really in your .command file.

You could of course script the addition (and optionally removal) of the entries needed to modify ssh keys or config file changes.

I would make a simple expect script - to wait for the password prompt and then enter your password.

#!/usr/bin/expect -f
set bad_idea cleartext_passwords_are_insecure
set timeout -1
# now connect using ssh
spawn ssh user@example.com
expect "*?assword:*"
send -- "$bad_idea\r"
send -- "\r"
expect elf


You don't have use a $bad_idea variable and could just send the password before the \r