How to access continuity through applescript or command line
You can probably avoid all the hassle by just using one nice service - http://xip.io

Instead of browsing to http://localhost - look up your IP and browse to http://192.168.12.13.xip.io/

Of course, your actual IP address for the local host is needed unless your router was set up to assign your test Mac 192.168.12.13 - even though you aren't asking how to get your IP, that's the key to making this easy for safari to hand off the session from macOS to iOS.




  Does xip.io cost anything?
  
  Nope! xip.io is a free service from Basecamp, the
  creators of Pow. We were tired of jumping through hoops
  to test our apps on other devices and decided to solve
  the problem once and for all.