CLI Decorator
Foundry\Cli\Command is a decorator which makes your models manageable from the terminal via WP-CLI. It scaffolds create, get, update, delete, and list subcommands driven by your model’s schema.
To use it, extend the class and implement the abstract methods:
get_command()— the command name (e.g.example events, givingwp example events list)get_model()— the model class the command operates onget_item_schema()— a schema describing your model’s output fieldsprepare_changes_for_database()— map command arguments onto your modelprepare_model_for_output()— map your model to output fields
Full documentation is still being written. In the meantime, see the source in inc/cli/, and the example project for a walkthrough.