Spaces WP-CLI Command Reference

This document outlines the WP-CLI command set for the Spaces plugin. These commands allow granular imports of asset content, pricing, floor plans, units, and unit inventory for a single asset or in batches.

📘

This is only available in Spaces 2.11 or later


Spaces includes commands to import data on the backend — each command requires an engrain_asset_id to know which asset to import. To get the engrain_asset_id for an asset, use the --field=id parameter with the wp spaces engrain_asset_ids command. For more information on available parameters and usage, see the WP-CLI documentation.


1. Display Spaces Help Documentation

Displays the Spaces help page in the terminal.

wp help spaces

Press q to exit and return to the command prompt.


2. Return the Spaces Version Currently Installed

wp spaces version

Output:

SPACES x.y.z

3. Return All Engrain Asset IDs

Returns a table containing all Engrain asset IDs and the last imported datetime.

Only assets connected in the CMS to the SightMap API will be returned.

wp spaces engrain_asset_ids

4. Return the First Batch of Asset IDs

Returns the first <x> Engrain asset IDs.

<x> represents the number of assets per batch.

wp spaces engrain_asset_ids <x>

Example (return the first batch of 3 assets):

wp spaces engrain_asset_ids 3

5. Return a Specific Batch of Asset IDs

Returns the <n>th batch of <x> Engrain asset IDs.

  • <x> = number of assets per batch
  • <n> = optional zero-indexed batch offset (defaults to 0)
wp spaces engrain_asset_ids <x> <n>

Example (return the second batch of 3 assets):

wp spaces engrain_asset_ids 3 1

6. Import Pricing Data for a Specific Asset

Imports pricing data for the specified Engrain asset.

<id> represents the Engrain Asset ID.

wp spaces import_pricing <id>

Example output:

Beginning pricing data import for asset_id: <id>, pricing_process_id: <pricing_process_id>
Completed pricing data import for asset_id: <id>, pricing_process_id: <pricing_process_id>

After running, confirm the last import time has been updated in the CMS.


7. Import Pricing Data for the First 3 Assets

Runs the pricing import for the first 3 assets returned by the asset ID command.

wp spaces engrain_asset_ids 3 --field=id | xargs -I {} -t wp spaces import_pricing {}

8. Import Content for a Specific Asset

Imports CMS content for the specified asset.

wp spaces import_content <id>

Example output:

Beginning content import for asset_id: <id>
Completed content import for asset_id: <id>

After running, confirm the CMS is displaying restored content for the asset.


9. Import Content for the First 3 Assets

wp spaces engrain_asset_ids 3 --field=id | xargs -I {} -t wp spaces import_content {}

10. Import Floor Plans for a Specific Asset

Imports floor plans for the specified asset.

wp spaces import_floor_plans <id>

Example output:

Beginning floor plans import for asset_id: <id>
Completed floor plans import for asset_id: <id>

11. Import Floor Plans for the First 3 Assets

wp spaces engrain_asset_ids 3 --field=id | xargs -I {} -t wp spaces import_floor_plans {}

12. Import Units for a Specific Asset

Imports units for the specified asset.

wp spaces import_units <id>

Example output:

Beginning units import for asset_id: <id>
Completed units import for asset_id: <id>

13. Import Units for the First 3 Assets

wp spaces engrain_asset_ids 3 --field=id | xargs -I {} -t wp spaces import_units {}

14. Update Unit Inventory for a Specific Asset

Updates unit inventory for the specified asset.

wp spaces update_unit_inventory <id>

Example output:

Beginning unit inventory update for asset_id: <id>, pricing_process_id: <pricing_process_id>
Completed unit inventory update for asset_id: <id>, pricing_process_id: <pricing_process_id>

15. Update Unit Inventory for the First 3 Assets

wp spaces engrain_asset_ids 3 --field=id | xargs -I {} -t wp spaces update_unit_inventory {}