Jump: Quick start | Site management | List plugins / themes / updates | Update / restore | Install/delete/(de)activate | Version control | WordPress core | Maintenance mode | Debugging | Hacking
N.B. When a site and/or plugin/theme is specified, the command-line format is always in this order:
wordshell
>
Quick Start – Setting Up / Install
Install:
chmod +x wordshell
mv wordshell /usr/local/sbin
wordshell --checkrequirements
Start using, by adding a new site:
wordshell --addsite
Site management
These commands manage WordShell’s list of sites to work with (they do not do anything to the WordPress site itself.
wordshell --addsite
wordshell mysite --delsite
wordshell mysite --disablesite
wordshell mysite --enablesite
wordshell --listsites
wordshell --listsites --showpass
List plugins/themes/core and updates
wordshell mysite --list
wordshell mysite --listupdates
wordshell mysite --listonlythirdparty
wordshell mysite --list --everything
In the above, you can, replace mysite with a comma-separated list of sites, or with all to operate on all configured sites. e.g.
wordshell site1,site2 akismet --listupdates
wordshell all akismet --listupdates
wordshell --listupdates
Or add –theme to work with themes, not plugins, or –core to work with core
wordshell mysite,site2 --listupdates --theme
Or add –everything to work with plugins, themes and WordPress core all at once:
wordshell mysite --listupdates --everything
Update/restore plugins and themes
In the below, replace mysite with all to operate on all configured sites. You can also use all as a plugin name.
Also, note that –update is optional and can be omitted; it is shown below only for clarity.
wordshell mysite akismet --update --latest
wordshell mysite all --update --latest
More advanced:
# Use a zip you have downloaded yourself
wordshell mysite mytheme --new=/home/me/mytheme-1.0.0.zip --update --theme
# Specify a particular version
wordshell mysite akismet --new=2.5.4 --donotrequirenew
# Roll back to a previous version
wordshell mysite contact-form-7 --rollback='2 days ago'
# restores from present backup:
wordshell mysite contact-form-7 --restore
# Only update active plugins:
wordshell mysite all --active --update --latest
Install / activate / de-install / de-activate plugins/themes
wordshell mysite akismet --install
wordshell mysite akismet --activate
wordshell mysite akismet --install --activate
wordshell mysite akismet --delete
wordshell mysite mytheme --theme --activate
More advanced:
# Install and activate a zip you have downloaded yourself
wordshell mysite myplugin --new=/home/me/myplugin-1.0.0.zip --install --activate
# Delete all inactive themes
wordshell mysite all --inactive --delete --theme
# Delete akismet from every site where it is unused
wordshell all akismet --inactive --delete
You do not need to specify –deactivate when you –delete ; that is automatically assumed. You can add –skipdeactivate to skip that step.
Version and Change Control
# Roll back to a previously installed version of a plugin:
wordshell mysite contact-form-7 --rollback='2 days ago'
# List all available roll-back versions
wordshell mysite --listrollbacks
wordshell mysite contact-form-7 --listrollbacks
# Show and confirm what changes will happen before I update
wordshell mysite akismet --showchanges --confirm/
# Show which themes are modified
wordshell mysite all --checkmod --theme
# View modifications to a plugin
wordshell mysite akismet --checkmod=view
Working with WordPress core
# Find version of WordPress on a site
wordshell mysite --list --core
# Find all sites which need updating
wordshell all --listupdates --core
# Upgrade core
wordshell mysite --core --latest
# Downgrade to a specific old version
wordshell mysite --core --new=3.2.1
Working with the WordPress database
# Dump out the database
wordshell mysite --remotecli=dbdump
# Search and replace
wordshell mysite --database --searchandreplace=http://localhost/test^http://live.example.com
Maintenance mode
When successful, commands to change maintenance state give no output.
wordshell mysite --maintenancestate
wordshell all --maintenancestate
wordshell mysite --entermaintenance
wordshell mysite --exitmaintenance
Debugging the remote site
# Get a shell or FTP login
wordshell mysite --login
# Show the remote site’s PHP info
wordshell mysite --phpversion
wordshell mysite --phpinfo
# Use WordShell’s internal interface to poke around
wordshell mysite --remotecli
Hacking inside WordShell
cd ~/.wordshell ; ls
wordshell
wordshell
wordshell --help
Leave a Reply
You must be logged in to post a comment.