Skip to content
Nick Hamze edited this page Apr 13, 2026 · 1 revision

WP-CLI Reference

Bazaar ships with a full WP-CLI command suite. Everything you can do in the admin UI, you can do from the terminal — and automate.

wp bazaar <command> [options]

Table of Contents


Lifecycle

wp bazaar list-wares

List all installed wares.

wp bazaar list-wares [--status=<status>] [--format=<format>] [--fields=<fields>]
Option Default Accepts
--status all all · enabled · disabled
--format table table · json · csv · yaml · count
--fields slug,name,version,author,status Any comma-separated field names
# Show all wares
wp bazaar list-wares

# Enabled wares as JSON — great for scripting
wp bazaar list-wares --status=enabled --format=json

# Count disabled wares
wp bazaar list-wares --status=disabled --format=count

# Slugs and versions only, as CSV
wp bazaar list-wares --fields=slug,version --format=csv

wp bazaar install

Install a ware from a .wp file.

wp bazaar install <file> [--force]
Argument / Option Description
<file> Path to the .wp file (relative or absolute)
--force Re-install even if the slug exists — deletes the old version first
wp bazaar install ledger.wp
wp bazaar install ledger-v2.wp --force
wp bazaar install ~/Downloads/project-tracker.wp

Tip

--force is your local upgrade path. For remote registry updates use wp bazaar update.


wp bazaar enable

Enable a disabled ware so its menu page reappears.

wp bazaar enable <slug>

wp bazaar disable

Disable a ware — its menu page disappears without deleting files.

wp bazaar disable <slug>

wp bazaar delete

Delete a ware and permanently remove all its files.

wp bazaar delete <slug> [--yes]

--yes skips the confirmation prompt (required in non-interactive scripts).

Warning

Irreversible. Files in wp-content/bazaar/{slug}/ are deleted immediately.


wp bazaar info

Show all stored metadata for a single ware.

wp bazaar info <slug> [--format=<format>]
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| slug        | ledger                |
| name        | Ledger                |
| version     | 1.0.0                            |
| author      | Nick                             |
| description | Generate invoices from wp-admin. |
| status      | enabled                          |
| entry       | index.html                       |
| menu_title  | Invoices                         |
| capability  | manage_options                   |
| installed   | 2026-04-10T12:00:00Z             |
+-------------+----------------------------------+

Registry & Updates

wp bazaar search

Search the remote Bazaar registry for available wares.

wp bazaar search <query> [--format=<format>]
wp bazaar search crm
wp bazaar search invoice --format=json

wp bazaar outdated

List installed wares that have a newer version available in the registry. Pass a slug to check just one ware.

wp bazaar outdated [<slug>] [--refresh] [--format=<format>]
Option Description
--refresh Force a live registry check instead of using the cached result
wp bazaar outdated
wp bazaar outdated ledger --refresh

wp bazaar update

Download and install the latest version of a ware from the registry.

wp bazaar update <slug>
wp bazaar update --all

--all updates every ware that has an available upgrade.


Operations

wp bazaar dev

Manage dev mode for a ware. In dev mode Bazaar proxies the ware's iframe to a local Vite (or any) dev server, giving you instant hot-reload without packaging.

wp bazaar dev start <slug> <url> [--verbose]
wp bazaar dev stop  <slug>
Argument Description
<slug> Ware slug
<url> Dev server URL — required (e.g. http://localhost:5173)
--verbose Log additional status output
# Start dev mode pointing at Vite's default port
wp bazaar dev start ledger http://localhost:5173

# Use a custom port
wp bazaar dev start ledger http://localhost:4000

# Stop dev mode (ware reverts to the installed build)
wp bazaar dev stop ledger

wp bazaar license

Manage license keys for paid wares.

wp bazaar license set    <slug> <key>
wp bazaar license check  <slug> [--porcelain]
wp bazaar license remove <slug>
Sub-command Description
set <slug> <key> Store a key and run remote validation if a license.url is configured
check <slug> Show validation status. --porcelain returns just valid or invalid for scripting.
remove <slug> Delete the stored key
wp bazaar license set   ledger XXXX-YYYY-ZZZZ
wp bazaar license check ledger
wp bazaar license check ledger --porcelain
wp bazaar license remove ledger

wp bazaar analytics

View page-view and engagement stats for a ware.

wp bazaar analytics [<slug>] [--days=<days>] [--format=<format>]

Omit <slug> for aggregate stats across all wares.

wp bazaar analytics ledger --days=7
wp bazaar analytics --days=30 --format=json

wp bazaar doctor

Run health checks for one ware or all wares. Reports on manifest validity, file integrity, license status, and external dependency reachability.

wp bazaar doctor [--slug=<slug>] [--format=<format>]
wp bazaar doctor
wp bazaar doctor --slug=ledger
wp bazaar doctor --format=json

wp bazaar logs

Display the client-side error log reported by wares.

wp bazaar logs [<slug>] [--count=<count>] [--format=<format>]
wp bazaar logs
wp bazaar logs ledger
wp bazaar logs ledger --count=100 --format=json

wp bazaar audit

Display the audit trail of ware lifecycle events.

wp bazaar audit [<slug>] [--event=<event>] [--count=<count>] [--format=<format>]
wp bazaar audit
wp bazaar audit ledger
wp bazaar audit --event=install --format=json

wp bazaar csp

View and manage the Content Security Policy for a ware.

wp bazaar csp <slug> [--set=<json>] [--reset]
Option Description
(none) Display the current CSP directives as text
--set=<json> Update directives. Value must be a JSON object mapping directive names to source lists
--reset Reset to the Bazaar baseline
# View current CSP
wp bazaar csp ledger

# Add Stripe to connect-src (JSON object required)
wp bazaar csp ledger --set='{"connect-src":"'"'"'self'"'"' https://api.stripe.com"}'

# Reset to defaults
wp bazaar csp ledger --reset

wp bazaar bundle

Install a .wpbundle archive — a multi-ware package that installs several wares in one step.

wp bazaar bundle <file.wpbundle> [--verbose]
wp bazaar bundle finance-suite.wpbundle
wp bazaar bundle ~/Downloads/starter-pack.wpbundle --verbose

Developer Tools

wp bazaar scaffold

Generate a REST endpoint stub with a matching TypeScript type helper.

wp bazaar scaffold <name> [endpoint] [--namespace=<namespace>] [--route=<route>]

The first argument is the name and the optional second argument is the action type (default: endpoint).

wp bazaar scaffold sync_orders
wp bazaar scaffold list_products endpoint --namespace=my-ware/v1

Output: a PHP file with register_rest_route() wired up, ready to drop into a companion plugin.


wp bazaar types

Emit TypeScript type definitions derived from a ware's manifest. Generates types for Config (from settings), BusEvent, and JobId.

wp bazaar types <slug> [--out=<file>]
wp bazaar types ledger
wp bazaar types ledger --out=src/types/bazaar.d.ts

wp bazaar sign

Sign a .wp archive with an RSA private key. The resulting signature is added to the archive as a top-level signature field in manifest.json and is verified on install.

wp bazaar sign <file.wp> --key=<privkey.pem> [--passphrase=<pass>]
wp bazaar sign ledger.wp --key=private.pem
wp bazaar sign ledger.wp --key=private.pem --passphrase=hunter2

wp bazaar keypair

Generate an RSA-2048 keypair for ware signing.

wp bazaar keypair [<output-dir>]

Writes private.pem and public.pem to the given directory (default: current directory).

wp bazaar keypair
wp bazaar keypair ~/.bazaar/keys/

Scripting Patterns

Bulk install from a directory

for ware in ~/wares/*.wp; do
  wp bazaar install "$ware"
done

Export the full registry as JSON

wp bazaar list-wares --format=json > wares-backup.json

Disable all wares at once

wp bazaar list-wares --status=enabled --fields=slug --format=csv \
  | tail -n +2 \
  | while read slug; do
      wp bazaar disable "$slug"
    done

Check for updates in CI

#!/usr/bin/env bash
set -euo pipefail

outdated=$(wp bazaar outdated --format=json)
count=$(echo "$outdated" | jq length)

if [ "$count" -gt 0 ]; then
  echo "$count ware(s) have updates available:"
  echo "$outdated" | jq '.[] | "\(.slug): \(.current) → \(.latest)"' -r
  exit 1
fi
echo "All wares are up to date."

CI/CD deployment

#!/usr/bin/env bash
set -euo pipefail

REMOTE="deploy@your-server.com"
WP_PATH="/var/www/html"

npm run package

scp my-ware.wp "${REMOTE}:/tmp/my-ware.wp"
ssh "$REMOTE" "wp --path='${WP_PATH}' bazaar install /tmp/my-ware.wp --force && rm /tmp/my-ware.wp"

Check if a ware is installed before acting

if wp bazaar list-wares --format=json | jq -e '.[] | select(.slug == "ledger")' > /dev/null; then
  echo "ledger is installed"
else
  wp bazaar install ledger.wp
fi

Multi-Site with Aliases

Define site aliases in ~/.wp-cli/config.yml to run Bazaar commands on any environment:

@production:
  ssh: deploy@production.example.com
  path: /var/www/html

@staging:
  ssh: deploy@staging.example.com
  path: /var/www/staging

@local:
  path: ~/Sites/mysite
wp @production bazaar list-wares
wp @staging    bazaar install ledger.wp --force
wp @local      bazaar delete  old-ware --yes

Tip

See WordPress Shell for advanced automation patterns including environment sync scripts and GitHub Actions CI integration.