Proper Command line switch formatting

Can someone give me some guidance on the formatting of this command line switch? the commands work fine from the actual command line in HA, but not when I use the switch. The passwordless SSH login works fine as well from the command line.

- platform: command_line
    switches:
      mac_wakeup:
        command_on: "ssh [email protected] caffeinate -u -t 2"
        command_off: "ssh [email protected] pmset displaysleepnow"