PHPackages                             wp-cli/ai-command - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wp-cli/ai-command

ActiveWp-cli-package[Utility &amp; Helpers](/categories/utility)

wp-cli/ai-command
=================

Interacts with the WordPress AI Client

v1.0.0(1mo ago)252.2k↓50.2%2MITPHPCI passing

Since May 14Pushed 2w agoCompare

[ Source](https://github.com/wp-cli/ai-command)[ Packagist](https://packagist.org/packages/wp-cli/ai-command)[ Docs](https://github.com/wp-cli/ai-command)[ RSS](/packages/wp-cli-ai-command/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (1)Dependencies (4)Versions (3)Used By (0)

wp-cli/ai-command
=================

[](#wp-cliai-command)

Interacts with the WordPress AI Client

[![Testing](https://github.com/wp-cli/ai-command/actions/workflows/testing.yml/badge.svg)](https://github.com/wp-cli/ai-command/actions/workflows/testing.yml) [![Code Coverage](https://camo.githubusercontent.com/a81445740712d4ca81b980929335e5ce77aedf0af560455b8016cbb636184a42/68747470733a2f2f636f6465636f762e696f2f67682f77702d636c692f61692d636f6d6d616e642f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/wp-cli/ai-command/tree/main)

Quick links: [Using](#using) | [Installing](#installing) | [Contributing](#contributing) | [Support](#support)

Using
-----

[](#using)

This package implements the following commands:

### wp ai

[](#wp-ai)

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

```
wp ai

```

**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.

```

### wp ai check

[](#wp-ai-check)

Checks if a prompt is supported for generation.

```
wp ai check  [--type=]

```

**OPTIONS**

```

	The prompt to check.

[--type=]
	Type to check.
	---
	options:
	  - text
	  - image
	---

```

**EXAMPLES**

```
# Check if text generation is supported
$ wp ai check "Write a poem"

# Check if image generation is supported
$ wp ai check "A sunset" --type=image

```

### wp ai generate

[](#wp-ai-generate)

Generates AI content.

```
wp ai generate   [--model=] [--provider=] [--temperature=] [--top-p=] [--top-k=] [--max-tokens=] [--system-instruction=] [--destination-file=] [--stdout] [--format=]

```

**OPTIONS**

```

	Type of content to generate.
	---
	options:
	  - text
	  - image
	---

	The prompt to send to the AI.

[--model=]
	Comma-separated list of models in order of preference. Format: "provider,model" (e.g., "openai,gpt-4" or "openai,gpt-4,anthropic,claude-3").

[--provider=]
	Specific AI provider to use (e.g., "openai", "anthropic", "google").

[--temperature=]
	Temperature for generation, typically between 0.0 and 1.0. Lower is more deterministic.

[--top-p=]
	Top-p (nucleus sampling) parameter. Value between 0.0 and 1.0.

[--top-k=]
	Top-k sampling parameter. Positive integer.

[--max-tokens=]
	Maximum number of tokens to generate.

[--system-instruction=]
	System instruction to guide the AI's behavior.

[--destination-file=]
	For image generation, path to save the generated image.

[--stdout]
	Output the whole image using standard output (incompatible with --destination-file=)

[--format=]
	Output format for text.
	---
	default: text
	options:
	  - text
	  - json
	---

```

**EXAMPLES**

```
# Generate text
$ wp ai generate text "Explain WordPress in one sentence"

# Generate text with specific settings
$ wp ai generate text "List 3 WordPress features" --temperature=0.1 --max-tokens=100

# Generate with top-p and top-k sampling
$ wp ai generate text "Write a story" --top-p=0.9 --top-k=40

# Generate with model preferences
$ wp ai generate text "Write a haiku" --model=openai,gpt-4,anthropic,claude-3

# Generate with system instruction
$ wp ai generate text "Explain AI" --system-instruction="Explain as if to a 5-year-old"

# Generate image
$ wp ai generate image "A minimalist WordPress logo" --output=wp-logo.png

```

### wp ai is-supported

[](#wp-ai-is-supported)

Checks whether AI features are supported in the current environment.

```
wp ai is-supported

```

Exits with code 0 if AI features are supported, or code 1 if they are not.

**EXAMPLES**

```
# Check if AI is supported
$ wp ai is-supported
Success: AI features are supported.

```

### wp ai status

[](#wp-ai-status)

Checks which AI capabilities are currently supported.

```
wp ai status [--format=]

```

Checks the environment and credentials to determine which AI operations are available. Displays a table showing supported capabilities.

**OPTIONS**

```
[--format=]
	Render output in a particular format.
	---
	default: table
	options:
	  - table
	  - csv
	  - json
	  - yaml
	---

```

**EXAMPLES**

```
# Check AI status
$ wp ai status
+------------------+-----------+
| capability       | supported |
+------------------+-----------+
| Text Generation  | Yes       |
| Image Generation | No        |
+------------------+-----------+

```

### wp connectors

[](#wp-connectors)

Lists and retrieves information about AI connectors.

```
wp connectors

```

**EXAMPLES**

```
# List all available connectors
$ wp connectors list

# Get details about a specific connector
$ wp connectors get openai

```

### wp connectors get

[](#wp-connectors-get)

Gets details about a specific AI connector.

```
wp connectors get  [--fields=] [--format=]

```

**OPTIONS**

```

	The connector ID (e.g., openai, anthropic, google).

[--fields=]
	Comma-separated list of fields to include in the output.

[--format=]
	Render output in a particular format.
	---
	default: table
	options:
	  - table
	  - csv
	  - json
	  - yaml
	---

```

**EXAMPLES**

```
# Get details for the OpenAI connector
$ wp connectors get openai
+-----------------+-----------------------------------------------+
| Field           | Value                                         |
+-----------------+-----------------------------------------------+
| name            | OpenAI                                        |
| description     | Text and image generation with GPT and Dall-E |
| status          | connected                                     |
| credentials_url | https://platform.openai.com/api-keys          |
| api_key         | ••••••••••••6789                              |
+-----------------+-----------------------------------------------+

```

### wp connectors list

[](#wp-connectors-list)

Lists all available AI connectors.

```
wp connectors list [--status=] [--fields=] [--format=]

```

**OPTIONS**

```
[--status=]
	Filter connectors by status.
	---
	options:
	  - connected
	  - active
	  - installed
	  - not installed
	---

[--fields=]
	Comma-separated list of fields to include in the output.

[--format=]
	Render output in a particular format.
	---
	default: table
	options:
	  - table
	  - csv
	  - json
	  - yaml
	---

```

**EXAMPLES**

```
# List all connectors
$ wp connectors list
+-----------+-----------------------------------------------+---------------+
| name      | description                                   | status        |
+-----------+-----------------------------------------------+---------------+
| Anthropic | Text generation with Claude.                  | not installed |
| Google    | Text and image generation with Gemini...      | not installed |
| OpenAI    | Text and image generation with GPT and Dall-E | connected     |
+-----------+-----------------------------------------------+---------------+

# List only connected connectors
$ wp connectors list --status=connected

```

Installing
----------

[](#installing)

This package is included with WP-CLI itself, no additional installation necessary.

To install the latest version of this package over what's included in WP-CLI, run:

```
wp package install git@github.com:wp-cli/ai-command.git

```

Contributing
------------

[](#contributing)

We appreciate you taking the initiative to contribute to this project.

Contributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

For a more thorough introduction, [check out WP-CLI's guide to contributing](https://make.wordpress.org/cli/handbook/contributing/). This package follows those policy and guidelines.

### Reporting a bug

[](#reporting-a-bug)

Think you’ve found a bug? We’d love for you to help us get it fixed.

Before you create a new issue, you should [search existing issues](https://github.com/wp-cli/ai-command/issues?q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.

Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [create a new issue](https://github.com/wp-cli/ai-command/issues/new). Include as much detail as you can, and clear steps to reproduce if possible. For more guidance, [review our bug report documentation](https://make.wordpress.org/cli/handbook/bug-reports/).

### Creating a pull request

[](#creating-a-pull-request)

Want to contribute a new feature? Please first [open a new issue](https://github.com/wp-cli/ai-command/issues/new) to discuss whether the feature is a good fit for the project.

Once you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See "[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)" for details specific to working on this package locally.

### License

[](#license)

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

Support
-------

[](#support)

GitHub issues aren't for general support questions, but there are other venues you can try:

*This README.md is generated dynamically from the project's codebase using `wp scaffold package-readme` ([doc](https://github.com/wp-cli/scaffold-package-command#wp-scaffold-package-readme)). To suggest changes, please submit a pull request against the corresponding part of the codebase.*

###  Health Score

47

—

FairBetter than 93% of packages

Maintenance94

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 63.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

42d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6dde7f578e5530884238e7173f768ae3a890b6d66eb99262a82f2c494a1b67d4?d=identicon)[schlessera](/maintainers/schlessera)

![](https://avatars.githubusercontent.com/u/841956?v=4)[Pascal Birchler](/maintainers/swissspidy)[@swissspidy](https://github.com/swissspidy)

---

Top Contributors

[![swissspidy](https://avatars.githubusercontent.com/u/841956?v=4)](https://github.com/swissspidy "swissspidy (57 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (24 commits)")[![schlessera](https://avatars.githubusercontent.com/u/83631?v=4)](https://github.com/schlessera "schlessera (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")[![ernilambar](https://avatars.githubusercontent.com/u/2098823?v=4)](https://github.com/ernilambar "ernilambar (2 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![wojsmol](https://avatars.githubusercontent.com/u/4176111?v=4)](https://github.com/wojsmol "wojsmol (1 commits)")

### Embed Badge

![Health badge](/badges/wp-cli-ai-command/health.svg)

```
[![Health](https://phpackages.com/badges/wp-cli-ai-command/health.svg)](https://phpackages.com/packages/wp-cli-ai-command)
```

###  Alternatives

[wp-cli/scaffold-command

Generates code for post types, taxonomies, blocks, plugins, child themes, etc.

1728.2M20](/packages/wp-cli-scaffold-command)[wp-cli/core-command

Downloads, installs, updates, and manages a WordPress installation.

5210.9M26](/packages/wp-cli-core-command)[wp-cli/entity-command

Manage WordPress comments, menus, options, posts, sites, terms, and users.

1059.5M77](/packages/wp-cli-entity-command)[wp-cli/search-replace-command

Searches/replaces strings in the database.

598.0M8](/packages/wp-cli-search-replace-command)[wp-cli/checksum-command

Verifies file integrity by comparing to published checksums.

338.1M12](/packages/wp-cli-checksum-command)[wp-cli/wp-cli-tests

WP-CLI testing framework

423.0M129](/packages/wp-cli-wp-cli-tests)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
