Wp-cli: WPCLI one-time login url

Created on 22 Jun 2016  路  3Comments  路  Source: wp-cli/wp-cli

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.

question

Most helpful comment

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>

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jacklenox picture jacklenox  路  3Comments

killown picture killown  路  3Comments

AndrewCloss picture AndrewCloss  路  3Comments

sir-gon picture sir-gon  路  4Comments

mirzazeyrek picture mirzazeyrek  路  3Comments