Skip to content
/ wplus Public

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.

Notifications You must be signed in to change notification settings

lrtrln/wplus

Repository files navigation

WP+CLI Dashboard

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.

Screenshot

Features

  • 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 list or wp post list
  • Built-in helpers for plugin/theme summaries and bulk operations
  • Interactive toggle lists when a command exposes compatible interactive metadata
  • Graceful degradation when JSON output is unavailable

Prerequisites

  • 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 wp commands succeed)

Installation

git clone https://github.com/lrtrln/wplus.git
cd wplus
composer install

The repository already includes a vendor/ directory (as required by the CLI menu library). Run composer install to make sure dependencies are up to date.

Usage

Execute the dashboard from the project root:

php wpplus.php

Navigation hints:

  • Use the arrow keys / j k to move and Enter to select.
  • Press Escape to go back or close informational screens.
  • When prompted for a command, the base wp … syntax is pre-filled—edit it and press Enter, or hit Esc to cancel.

Interactive Lists

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 --config must return a structure containing:
    • type: must be toggle-list
    • title: optional label displayed in the submenu header
    • defaults.per_page: optional page size hint (falls back to an internal default)
    • actions.list: the command used to fetch a page; WP+ appends --page and --per-page
    • actions.toggle: a command template executed with %s placeholders for the item key and target boolean; if missing, WP+ falls back to wp <command> interactive --toggle=... --value=...
  • The list/toggle commands should output JSON containing items (each with key, label, optional description, and checked), plus page, total_pages, total_items, and an optional message that is flashed after toggles.
  • Pagination controls (← Previous page, Next page →) appear automatically when the command reports multiple pages.

Shortcuts

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 wp is required (it will be normalised automatically).
  • Leave the file alone to keep the default shortcuts.

Configuration Notes

  • 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=json when possible, then rendered as ASCII tables with column truncation at 60 characters.
  • WP-CLI deprecation notices are silenced by passing -d display_errors=Off and downgrading error_reporting.

Troubleshooting

  • 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=table or 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 Esc to return.

License

© lrtrln. GPL-3.0+ license.

About

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.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages