Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ wp connectors list [--status=<status>] [--fields=<fields>] [--format=<format>]
- connected
- active
- installed
- not installed
- uninstalled
---

[--fields=<fields>]
Expand All @@ -324,13 +324,13 @@ wp connectors list [--status=<status>] [--fields=<fields>] [--format=<format>]

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

# List only connected connectors
$ wp connectors list --status=connected
Expand Down
8 changes: 4 additions & 4 deletions features/connectors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ Feature: List and get AI connectors
"""

@require-wp-7.0
Scenario: List connectors shows not-installed status when plugins are absent
Scenario: List connectors shows uninstalled status when plugins are absent
When I run `wp connectors list --format=json`
Then STDOUT should contain:
"""
"name":"OpenAI"
"""
And STDOUT should contain:
"""
"status":"not installed"
"status":"uninstalled"
"""

@require-wp-7.0
Expand All @@ -62,7 +62,7 @@ Feature: List and get AI connectors

@require-wp-7.0
Scenario: List connectors supports --status filter
When I run `wp connectors list --status="not installed" --format=json`
When I run `wp connectors list --status=uninstalled --format=json`
Then STDOUT should contain:
"""
"name":"OpenAI"
Expand All @@ -85,7 +85,7 @@ Feature: List and get AI connectors
When I run `wp connectors get openai --format=json`
Then STDOUT should be JSON containing:
"""
{"id":"openai","name":"OpenAI","description":"Text and image generation with GPT and Dall-E.","status":"not installed","credentials_url":"https://platform.openai.com/api-keys","api_key":""}
{"id":"openai","name":"OpenAI","description":"Text and image generation with GPT and Dall-E.","status":"uninstalled","credentials_url":"https://platform.openai.com/api-keys","api_key":""}
"""

# TODO: Depends on https://core.trac.wordpress.org/ticket/64819.
Expand Down
20 changes: 10 additions & 10 deletions src/Connectors_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Connectors_Command extends WP_CLI_Command {
* - connected
* - active
* - installed
* - not installed
* - uninstalled
* ---
*
* [--fields=<fields>]
Expand All @@ -62,13 +62,13 @@ class Connectors_Command extends WP_CLI_Command {
*
* # List all connectors
* $ wp connectors list
* +-----------+-----------+-----------------------------------------------+---------------+
* | id | name | description | status |
* +-----------+-----------+-----------------------------------------------+---------------+
* | anthropic | Anthropic | Text generation with Claude. | not installed |
* | google | Google | Text and image generation with Gemini... | not installed |
* | openai | OpenAI | Text and image generation with GPT and Dall-E | connected |
* +-----------+-----------+-----------------------------------------------+---------------+
* +-----------+-----------+-----------------------------------------------+-------------+
* | id | name | description | status |
* +-----------+-----------+-----------------------------------------------+-------------+
* | anthropic | Anthropic | Text generation with Claude. | uninstalled |
* | google | Google | Text and image generation with Gemini... | uninstalled |
* | openai | OpenAI | Text and image generation with GPT and Dall-E | connected |
* +-----------+-----------+-----------------------------------------------+-------------+
*
* # List only connected connectors
* $ wp connectors list --status=connected
Expand Down Expand Up @@ -214,7 +214,7 @@ private function build_connector_item( string $connector_id, array $connector ):
/**
* Returns the status of a connector.
*
* Possible values: 'connected', 'active', 'installed', 'not installed'.
* Possible values: 'connected', 'active', 'installed', 'uninstalled'.
*
* @param string $connector_id The connector ID.
* @param mixed[] $connector Connector settings from wp_get_connectors().
Expand Down Expand Up @@ -245,7 +245,7 @@ private function get_connector_status( string $connector_id, array $connector ):
return 'installed';
}

return 'not installed';
return 'uninstalled';
}

/**
Expand Down