wp ai <command>

Interacts with the WordPress AI Client for text and image generation.

In this article

Examples

# Check AI capabilities status
$ wp ai status
+------------------+-----------+
| Capability       | Supported |
+------------------+-----------+
| Text Generation  | Yes       |
| Image Generation | No        |
+------------------+-----------+

# Generate text from a prompt
$ wp ai generate text "Write a haiku about WordPress"
Success: Generated text:
Open source and free
Empowering creators
WordPress shines bright

# Generate an image from a prompt
$ wp ai generate image "A futuristic WordPress logo" --destination-file=logo.png
Success: Image saved to logo.png

# Check if a prompt is supported
$ wp ai check "Summarize this text"
Success: Text generation is supported for this prompt.

Subcommands

NameDescription
wp ai check

Checks if a prompt is supported for generation.

wp ai generate

Generates AI content.

wp ai is-supported

Checks whether AI features are supported in the current environment.

wp ai status

Checks which AI capabilities are currently supported.

Command documentation is regenerated at every release. To add or update an example, please submit a pull request against the corresponding part of the codebase.