Skip to content

Add wp connectors list and wp connectors get commands#9

Draft
Copilot wants to merge 11 commits intomainfrom
copilot/add-connectors-command
Draft

Add wp connectors list and wp connectors get commands#9
Copilot wants to merge 11 commits intomainfrom
copilot/add-connectors-command

Conversation

Copy link
Contributor

Copilot AI commented Mar 5, 2026

Exposes the WP 7.0 connector registry (_wp_connectors_get_connector_settings()) via two new WP-CLI commands, giving operators visibility into available AI providers and their configuration state.

New commands

  • wp connectors list — tabular view of all registered connectors. Default columns: name, description, status. Additional fields (type, auth_method, plugin_slug, credentials_url) are available via --fields. Supports --status filtering and --format (table/csv/json/yaml).
  • wp connectors get <connector> — detail view for a single connector rendered as a Field/Value pivot table (like wp post get). Default fields: name, description, status, credentials_url, api_key (masked, via WP core's option_* filter). Additional fields (type, auth_method, plugin_slug) available via --fields.

The status column reflects the connector's current state:

  • connected — an API key is configured
  • active — the provider plugin is active (or the provider is registered directly without a plugin slug)
  • installed — the plugin is installed but not activated
  • not installed — the plugin is not present

Plugin install/active status is resolved by matching the connector's plugin.slug against get_plugins() output.

$ 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     |
+-----------+-----------------------------------------------+---------------+

$ wp connectors list --status=connected
+-----------+-----------------------------------------------+-----------+
| name      | description                                   | status    |
+-----------+-----------------------------------------------+-----------+
| OpenAI    | Text and image generation with GPT and Dall-E | connected |
+-----------+-----------------------------------------------+-----------+

$ 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                              |
+-----------------+-----------------------------------------------+

Removed

The wp ai credentials family of commands (list, get, set, delete) has been removed. API keys can be managed directly via wp option update <setting_name> <value>.

Tests

Behat scenarios cover: built-in provider listing with name, description, and status fields; not installed / active / connected status transitions; --status filter; get pivot layout with masked API key; --fields filtering including hidden fields; error on unknown connector ID; installing the OpenAI provider plugin to flip status; filtering by active status; and a community plugin (ai-provider-for-azure-openai) appearing in the list with status: active.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add connectors command</issue_title>
<issue_description>This is a follow up to #6 and #7.

We should add wp connectors list and wp connectors get commands that uses _wp_connectors_get_connector_settings to display information about the available connectors (name, description, status, api key, auth method, etc).

The plugin slug is available there so we can show whether the connector is installed or not.

See https://github.com/WordPress/wordpress-develop/blob/5f0ac6faf6a1ddd567009fe3a33fb029b6dbcc4a/src/wp-includes/connectors.php#L118 for that code.

We could add tests that install the plugins for the default providers (openai, anthropic, google) and even install a community plugin such as https://github.com/zaherg/ai-provider-for-openrouter and verify that it shows up in the connectors list.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@github-actions github-actions bot added command:ai-credentials-get Related to 'ai credentials get' command command:ai-credentials-list Related to 'ai credentials list' command enhancement New feature or request scope:distribution Related to distribution scope:testing Related to testing labels Mar 5, 2026
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
Copilot AI changed the title [WIP] Add connectors command to manage plugins Add wp connectors list and wp connectors get commands Mar 5, 2026
@swissspidy

This comment was marked as resolved.

…gin_slug/type/auth_method by default

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>

This comment was marked as resolved.

@swissspidy

This comment was marked as resolved.

…ove credentials commands

Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:ai-credentials-get Related to 'ai credentials get' command command:ai-credentials-list Related to 'ai credentials list' command enhancement New feature or request scope:distribution Related to distribution scope:testing Related to testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add connectors command

2 participants