Coming from the Drupal world as a sysadmin I am used to being able to generate a one-time logon url while on the command line which I can then use to login to the site. I'm not aware of a similar feature, and have scanned through the community commands but haven't found anything that provides this, possibly because it may only be possible as a plugin as it would require a hook into init. But does anyone know if such a thing is possible?
# The drush way: https://drushcommands.com/drush-7x/user/user-login/
drush --root=$(pwd)/htdocs --uri=example.com uli
Any way to duplicate this functionality by extending wpcli? I'd be happy to spend some time working on it and submitting a pull request if it possible, but would appreciate some advice.
There is a plugin that does this. Not sure if it belongs in wp-cli core.
possibly because it may only be possible as a plugin as it would require a hook into init.
Yes, it requires a plugin because the callback code needs to execute during a web request, which WP-CLI isn't present for.
This is what you want:
wp plugin install one-time-login --activate && wp user one-time-login <user>
Thanks Aaron and Daniel, that's exactly what I needed.
Most helpful comment
Yes, it requires a plugin because the callback code needs to execute during a web request, which WP-CLI isn't present for.
This is what you want: