This example demonstrates how to use the HWP CLI to interact with a WordPress site. It shows how to:
- Configure the CLI to connect to your WordPress site
- Use CLI commands to check WordPress and plugin status
- Use CLI commands to list installed HWP plugins
- Copy the environment configuration:
cp .env.example .env
- Update
.env
with your WordPress site URL:
WP_URL=http://localhost:8889 # Change this to your WordPress site URL
- Install dependencies:
pnpm install
Check WordPress site status and plugin details:
pnpm status
Example output:
WordPress Status:
Environment: local
URL: http://localhost:8889
Version: 6.4.2
Debug Mode: Disabled
HWP Status:
Plugin: hwp-cli
Status: Active
Version: 1.0.0
REST API: Available
List all installed HWP plugins and their status:
pnpm plugins
Example output:
Installed HWP Plugins:
HWP CLI Plugin v1.0.0
Status: Active
NPM Package: Not specified
---
This example assumes you have a WordPress site running with the HWP CLI plugin installed and activated. The CLI commands will communicate with the WordPress site specified in your .env
file.