wp-cli –ssh runs against a remote site with no tunnel

Running a command against production usually means an SSH session, a directory change and remembering which site is which — and the flag removes all three.

$ wp @production plugin list --status=active
$ wp @staging db export - | gzip > staging.sql.gz

# wp-cli.yml
# @production:
#   ssh: [email protected]/var/www/app/current
# @staging:
#   ssh: [email protected]/var/www/app/current

The alias file lives in the repository, so the set of environments is version controlled and reviewable rather than living in somebody’s shell history. The path after the host is the working directory, which is the part people leave out and then wonder why the command reports no WordPress installation. Piping output back through the local shell means a database export lands on your machine without a second copy on the server.