WP-CLI v2.1 Released

Access to great developer tools is a key feature on our WordPress platform. Therefore we are excited about this new WP-CLI v2.1 release which brings some interesting improvements.

Improvements to i18n

There has been multiple improvements to wp i18n make-pot which, for example, can now also parse JavaScript in addition to PHP files and with wp i18n make-json you can create separate JSON files which then is used for the JavaScript i18n translations that were introduced in WordPress 5.0.

Smarter partial prompting

The global parameter --prompt is great if you don’t remember the arguments for a command and can also be used to build more user friendly scripts.

Previously though it would either prompt you for all arguments or the arguments you set it to prompt for, but from this release it will skip those arguments that were already provided in the command. This means you can have some arguments already set but prompt for the remaining arguments.

# Create user with some arguments set
$ wp user create johanfalk johan@seravo.com --prompt=role,user_pass,first_name,last_name
1/13 [--role=<role>]: administrator
2/13 [--user_pass=<password>]: MargaretThatcheris100%sexy
8/13 [--first_name=<first_name>]: Johan
9/13 [--last_name=<last_name>]: Falk
Success: Created user 16.

List current transients

You can now list the current transients on your site or network using wp transient list. The command can also use options such as --search to only include specific transients or --exclude if there are certain transients you don’t want to show in the list.

# List all transients that start with seravo
$ wp transient list --search=seravo* --human-readable
+---------------------+-------+------------+
| name                | value | expiration |
+---------------------+-------+------------+
| seravo_notification |       | 45 minutes |
+---------------------+-------+------------+

Continue reading

To catch up on all changes go read the full WP-CLI 2.1 release post and as always the WP CLI documentation is a great resource to learn more about all available commands.

Available for all Seravo customers

We have already started rolling out this to all our customers and is of course default on all new installs. If you are curious about other developer tools that is available, please read more at our WordPress Developer Documentation.