WP+CLI Dashboard is an interactive PHP console application that modernises the WP-CLI experience. It provides a keyboard-driven menu to explore every available WP-CLI command, highlights useful shortcuts, and formats common list commands as readable tables.
- Interactive terminal UI powered by PhpSchool\CliMenu
- Auto-generated navigation for the entire WP-CLI command tree
- Configurable shortcuts (up to five) for your most-used commands
- Clean, human-friendly table rendering for commands like
wp plugin listorwp post list - Built-in helpers for plugin/theme summaries and bulk operations
- Interactive toggle lists when a command exposes compatible
interactivemetadata - Graceful degradation when JSON output is unavailable
- PHP 8.0 or higher with the CLI SAPI enabled
- Composer
- A working WP-CLI installation available on your
$PATH - A WordPress installation initialised for the current working directory (so
wpcommands succeed)
git clone https://github.com/lrtrln/wplus.git
cd wplus
composer installThe repository already includes a
vendor/directory (as required by the CLI menu library). Runcomposer installto make sure dependencies are up to date.
Execute the dashboard from the project root:
php wpplus.phpNavigation hints:
- Use the arrow keys /
jkto move andEnterto select. - Press
Escapeto go back or close informational screens. - When prompted for a command, the base
wp …syntax is pre-filled—edit it and pressEnter, or hitEscto cancel.
When a WP-CLI command ships an interactive subcommand with a JSON config, WP+ surfaces it as an extra ⚙️ menu item. The dashboard currently understands configs of type toggle-list and renders them as pageable checkbox lists that you can flip with Enter or Space.
wp <command> interactive --configmust return a structure containing:type: must betoggle-listtitle: optional label displayed in the submenu headerdefaults.per_page: optional page size hint (falls back to an internal default)actions.list: the command used to fetch a page; WP+ appends--pageand--per-pageactions.toggle: a command template executed with%splaceholders for the item key and target boolean; if missing, WP+ falls back towp <command> interactive --toggle=... --value=...
- The list/toggle commands should output JSON containing
items(each withkey,label, optionaldescription, andchecked), pluspage,total_pages,total_items, and an optionalmessagethat is flashed after toggles. - Pagination controls (
← Previous page,Next page →) appear automatically when the command reports multiple pages.
Five configurable shortcuts appear at the top of the menu. Edit shortcuts.txt to customise them:
Label|wp subcommand arguments
List plugins|plugin list
List themes|theme list
- Lines starting with
#are ignored. - Only the portion after
wpis required (it will be normalised automatically). - Leave the file alone to keep the default shortcuts.
- Terminal handling is restored before running WP-CLI commands, then switched back to raw mode afterwards so the menu stays responsive.
- List-style commands are executed with
--format=jsonwhen possible, then rendered as ASCII tables with column truncation at 60 characters. - WP-CLI deprecation notices are silenced by passing
-d display_errors=Offand downgradingerror_reporting.
- If tables display incorrectly, ensure your terminal supports ANSI escape sequences and uses a monospaced font.
- Some commands may require additional context (e.g., multisite, remote database). You can always force the classic behaviour by adding
--format=tableor similar options manually. - When WP-CLI prompts for credentials or opens an editor, the menu hands control back to the terminal—follow the WP-CLI instructions, then press
Escto return.
© lrtrln. GPL-3.0+ license.
