1 Command line
Robin edited this page 2026-11-22 07:25:09 +01:00

Command line

Everything the administration does is also available with WP-CLI, under wp lrob-pluginception. Useful to set up a catalogue on a server, script it, or move it from a site to another.

Sources

wp lrob-pluginception source add https://git.example.com/acme
wp lrob-pluginception source add https://github.com/acme --skip-archived
wp lrob-pluginception source list

source add asks the forge whether the organisation, account or repository exists, then adds it. Options: --forge=gitea|github (for an address other than github.com), --forks, --skip-archived. Tokens are set in the administration only (see Sources), so that they never end up in a shell history.

Reading now

wp lrob-pluginception sync
wp lrob-pluginception sync https://git.example.com/acme --all

Reads the lists of repositories, then every project to read, until none is left. --all reads every project again, even those that did not change. It stops when a forge's quota is reached (the reading then resumes by itself) or when a source answers an error.

Projects

wp lrob-pluginception project list
wp lrob-pluginception project set widget --page=/plugins/widget/ --category=tools
wp lrob-pluginception project set acme/widget --audience="bars, cafés"
wp lrob-pluginception project set acme/widget --featured=yes --tagline="All your menus." --highlights=$'Fast\nLight\nFree'
wp lrob-pluginception project set 12 --audience=auto

A project is named by its repository (widget), its owner and repository (acme/widget) when two sources have the same name, or its id (from project list).

Option Value
--name displayed name
--excerpt excerpt of the cards
--excerpt-reviewed yes or no
--image an image of the media library: its id or its address
--category a category's identifier (category list)
--order a number, smaller first
--page the presentation page: its id, its address, or its path (/plugins/widget/)
--visible yes or no
--audience who it is for
--featured yes or no
--tagline lead sentence of the featured card
--highlights points of the featured card, one per line (new lines, or \n)
--lang language of --audience, --tagline, --highlights (en_US…); default: the site's main language

An empty value, or auto, brings back the automatic value.

Categories

wp lrob-pluginception category list
wp lrob-pluginception category add "Online shop" --slug=shop
wp lrob-pluginception category order events legal shop

category order puts the categories given first, in that order, then the others.

Export and import

wp lrob-pluginception export catalogue.json
wp lrob-pluginception import catalogue.json --dry-run
wp lrob-pluginception import catalogue.json

The same file as Export and Import in Settings. See there what it holds.

Every change made from the command line is in the log, origin Command line.