Skip to content
Sign in Get the free theme
Menu
Developer docs menu

WP-CLI

Applies to Companion 0.1.1 Updated 8 October 2026 View as Markdown

LanternWP Companion adds two WP-CLI commands, part of the public API. The options of both are in the WP-CLI reference.

wp lanternwp demo import

Imports a demo into this store, or brings an earlier import of it up to date. Everything the import creates carries the demo's own ids, so a rerun updates what is there instead of duplicating it and deletes what the demo no longer has. The LanternWP theme (or a child theme of it) and WooCommerce must be active.

The demo comes from the demo store of lanternwp.com: the files of the version, the latest unless one is named, are downloaded into the uploads folder, each checked against its checksum, and removed after the import; images the store already has from an earlier import are not downloaded again. An interrupted download keeps its files, and running the command again continues it.

wp lanternwp demo import <demo> [--dir=<directory>] [--server=<url>]
Option What it does
<demo> The demo's id, such as base, or the id and a version, such as base@2
--dir=<directory> Import from this directory instead: the demo's built manifest.json beside its images. A directory holds one version, so name the demo without a version
--server=<url> The demo store to download from; https://lanternwp.com by default

The demos' ids are base (Common Goods), voltline and kilowatt.

wp lanternwp demo import base
wp lanternwp demo import voltline@2
wp lanternwp demo import base --dir=./base

On a client's site this is the quickest way to deliver a store: install the theme, WooCommerce and Companion, then run the command.

wp lanternwp demo look

Makes a demo's look the store's starting look and changes nothing else: the demo's colours, fonts, shape and spacing, laid over the theme's own, so Reset styles in the Site Editor's Styles comes back to them. Products, pages, menus, templates and settings stay. Only the version's manifest.json is read, and nothing is saved in the uploads folder. Base's look is the theme's own, so base puts it back.

wp lanternwp demo look <demo> [--dir=<directory>] [--server=<url>] [--keep-styles]

The changes in Styles and the LanternWP panel are emptied, and Styles' revisions keep them; --keep-styles keeps them over the new look. Appearance → Demos does the same with Use the look only.

wp lanternwp demo look kilowatt
wp lanternwp demo look base --keep-styles

The look is a theme mod of the active theme, which the theme reads (an import writes it too), so it stays when Companion is deactivated. A child theme activated later has theme mods of its own and starts from the theme's own look: run the command again there.

Was this page helpful?
Something wrong on this page? Report it. Something missing? Suggest it.