You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe your use case and the problem you are facing
I would like a "multi" option that would allow me to run multiple CLI commands in one process, speeding up overall execution time.
Describe the solution you'd like
The option would use STDIN or possibly a data file that lists the commands we want to run all at once.
A draft idea might be something like this.
echo'set options blogname "my title"'> commands.txt
echo'set options blogdescription "my description"'>> commands.txt
echo'core update'>> commands.txt
wp-cli --json runcommands <<commands.txt
I'd also be open to some complex command line only option like this. The only problem with this is that CLI would have to convert the args into individual commands, splitting on space.
wp-cli --json multi 'set options blogname "my title"''set options blogdescription "my description"''core update'
This command would come with a caveat emptor warning that each command may have unexpected side effects on the later commands and anyone using it needs to be certain that it won't affect them to run it all in one process without flush or refresh.
In my above example, I would be required to know that messing with blogname/description will not have side effects on each other and that the update would be fine following the first 2.
If we wanted to get fancy, maybe we'd add a flush option that would invalidate caches if needed as you go?
The JSON result might provide an array of responses from each command.
The text was updated successfully, but these errors were encountered:
I think this would be best implemented as a standalone package first. It could be considered for including in WP-CLI proper once the real-world idiosyncrasies have been worked out.
Feature Request
Describe your use case and the problem you are facing
I would like a "multi" option that would allow me to run multiple CLI commands in one process, speeding up overall execution time.
Describe the solution you'd like
The option would use STDIN or possibly a data file that lists the commands we want to run all at once.
A draft idea might be something like this.
I'd also be open to some complex command line only option like this. The only problem with this is that CLI would have to convert the args into individual commands, splitting on space.
This command would come with a caveat emptor warning that each command may have unexpected side effects on the later commands and anyone using it needs to be certain that it won't affect them to run it all in one process without flush or refresh.
In my above example, I would be required to know that messing with blogname/description will not have side effects on each other and that the update would be fine following the first 2.
If we wanted to get fancy, maybe we'd add a
flush
option that would invalidate caches if needed as you go?The JSON result might provide an array of responses from each command.
The text was updated successfully, but these errors were encountered: