Console commands

Four commands. The one that matters operationally is refresh.

List every table

php craft legs/tables

Handle, size and name, one per line — handy for checking what a deployment actually has.

Rebuild query tables

php craft legs/tables/refresh
php craft legs/tables/refresh --handle=team

Rebuilds every element-query table from its query, or just one. A site that would rather not rebuild on every element save can turn refreshOnElementSave off and run this from cron instead:

*/15 * * * * cd /var/www && php craft legs/tables/refresh >> /dev/null 2>&1

Exits non-zero if any table failed, so a scheduler notices.

Export

php craft legs/tables/export price-list
php craft legs/tables/export price-list --format=json > prices.json
php craft legs/tables/export price-list --format=html

Prints to standard output, so it pipes. csv is the default; json is the round-trip format.

Import

php craft legs/tables/import price-list ./prices.csv

Replaces the named table's grid from a file — CSV, TSV, JSON, HTML, or XLSX if PhpSpreadsheet is installed. The format is taken from the extension. Deployment scripts that regenerate a table from a build artifact usually want this.