Logging in to a server just to run one wp command gets old quickly. WP-CLI can do the ssh part for you, and an alias gives the site a short name.
Put this in wp-cli.yml in your project, or in ~/.wp-cli/config.yml for all projects:
@prod:
ssh: [email protected]~/webapps/production
@staging:
ssh: [email protected]/var/www/staging
The part after the host is the WordPress path on the remote machine. Then put the alias right after wp:
wp @prod core check-update
wp @staging plugin list --update=available
You can also skip the file and pass the host directly with wp --ssh=example.com:2222 option get home. A group alias is a list of other aliases, so one command can hit several sites.
Caveats from the handbook: WP-CLI has to be installed on the remote server and be reachable as wp. Ssh does not load your ~/.bashrc or ~/.zshrc for these commands, so if the remote shell cannot find wp, you may have to fix the $PATH for non-interactive logins. Some hosts also block this kind of access.
Because the command runs on the live site, be careful with anything that writes. Run the read-only version first.
Further reading: Running commands remotely (WP-CLI handbook)