WP-CLI commands
The following WP-CLI commands are supported by ClassifAI:
Language Processing Commands
-
wp classifai post <post_ids> [--post_type=<post_type>] [--limit=<limit>] [--link=<link>]Batch post classification using IBM Watson NLU API.
-
<post_ids>: A comma delimited list of post IDs to classify. Used if post_type is false or absent.default:
true -
[--post_type=<post_type>]: Batch classify posts belonging to this post type. If false or absent relies on post_ids.default:
falseoptions:
- any post type name
false, if args contains post_ids
-
[--limit=<limit>]: Limit classification to N posts.default:
falseoptions:
false, no limit- N, max number of posts to classify
-
[--link=<link>]: Whether to link classification results to Taxonomy terms.default:
true
-
-
wp classifai text <text> [--category=<bool>] [--keyword=<bool>] [--concept=<bool>] [--entity=<bool>] [--input=<input>] [--only-normalize=<bool>]Directly classify text using IBM Watson NLU API.
-
<text>: A string of text to classify. -
[--category=<bool>]: Enables NLU category feature.default:
true -
[--keyword=<bool>]: Enables NLU keyword feature.default:
true -
[--concept=<bool>]: Enables NLU concept feature.default:
true -
[--entity=<bool>]: Enables NLU entity feature.default:
true -
[--input=<input>]: Path to input file or URL.default:
falseoptions:
- path to local file
- path to remote URL
false, usesargs[0]instead
-
[--only-normalize=<bool>]: Prints the normalized text that will be sent to the NLU API.default:
false
-
-
wp classifai text_to_speech <post_ids> [--post_type=<post_type>] [--post_status=<post_status>] [--per_page=<per_page>] [--dry-run=<bool>]Batch generation of text-to-speech data using Microsoft Azure's Text to Speech API.
-
<post_ids>: A comma-delimited list of post IDs to generate text-to-speech for. Used if post_type isfalseor absent.default:
null -
[--post_type=<post_type>]: Batch process items belonging to this post type. Iffalseor absent, will rely onpost_ids.default:
falseoptions:
- any post type name
-
[--post_status=<post_status>]: Batch process items that have this post status. Defaults topublish.default:
publishoptions:
- any post status name
-
[--per_page=<int>]: How many items should be processed at a time. Will still process all items but will do it in batches matching this number. Defaults to 100.default:
100options:
- N, max number of items to process at a time
-
[--dry-run=<bool>]: Whether to run as a dry-run. Defaults totrue, so will run in dry-run mode unless this is set tofalse.default:
trueoptions:
trueto run in dry-run modefalseto run in normal mode
-
-
wp classifai transcribe_audio <attachment_ids> [--files=<files>] [--per_page=<per_page>] [--force=<bool>] [--dry-run=<bool>]Batch generation of audio transcriptions using OpenAI's Audio Transcription API. Can either process existing attachments or process files from the local filesystem or remote URLs.
-
<attachment_ids>: A comma-delimited list of attachment IDs to generate transcriptions for. If not set, will instead run a query to get all audio attachments to process.default:
null -
[--files=<files>]: A comma-delimited list of file paths to generate transcriptions for. Will take precedence overattachment_idsif set.default:
nulloptions:
- path to local file
- path to remote URL
-
[--per_page=<int>]: How many items should be processed at a time. Will still process all items but will do it in batches matching this number. Defaults to 100.default:
100options:
- N, max number of items to process at a time
-
[--force=<bool>]: Whether to process audio files that already have a transcription set. Defaults tofalse.default:
falseoptions:
trueto process all itemsfalseto only process items that don't have transcriptions set
-
[--dry-run=<bool>]: Whether to run as a dry-run. Defaults totrue, so will run in dry-run mode unless this is set tofalse.default:
trueoptions:
trueto run in dry-run modefalseto run in normal mode
-
-
wp classifai generate_excerpt <post_ids> [--post_type=<post_type>] [--post_status=<post_status>] [--per_page=<per_page>] [--force=<bool>] [--dry-run=<bool>]Batch generation of excerpts using OpenAI's ChatGPT API.
-
<post_ids>: A comma-delimited list of post IDs to generate excerpts for. Used if post_type isfalseor absent.default:
null -
[--post_type=<post_type>]: Batch process items belonging to this post type. Iffalseor absent, will rely onpost_ids.default:
falseoptions:
- any post type name
-
[--post_status=<post_status>]: Batch process items that have this post status. Defaults topublish.default:
publishoptions:
- any post status name
-
[--per_page=<int>]: How many items should be processed at a time. Will still process all items but will do it in batches matching this number. Defaults to 100.default:
100options:
- N, max number of items to process at a time
-
[--force=<bool>]: Whether to process items that already have an excerpt set. Defaults tofalse.default:
falseoptions:
trueto process all itemsfalseto only process items that don't have an excerpt set
-
[--dry-run=<bool>]: Whether to run as a dry-run. Defaults totrue, so will run in dry-run mode unless this is set tofalse.default:
trueoptions:
trueto run in dry-run modefalseto run in normal mode
-
-
wp classifai embeddings <post_ids> [--post_type=<post_type>] [--post_status=<post_status>] [--per_page=<per_page>] [--dry-run=<bool>]Batch classification of items using the OpenAI Embeddings API.
-
<post_ids>: A comma-delimited list of post IDs to classify. Used ifpost_typeisfalseor absent.default:
null -
[--post_type=<post_type>]: Batch process items belonging to this post type. Iffalseor absent, will rely onpost_ids.default:
falseoptions:
- any post type name
-
[--post_status=<post_status>]: Batch process items that have this post status. Defaults topublish.default:
publishoptions:
- any post status name
-
[--per_page=<int>]: How many items should be processed at a time. Will still process all items but will do it in batches matching this number. Defaults to 100.default:
100options:
- N, max number of items to process at a time
-
[--dry-run=<bool>]: Whether to run as a dry-run. Defaults totrue, so will run in dry-run mode unless this is set tofalse.default:
trueoptions:
trueto run in dry-run modefalseto run in normal mode
-
Image Processing Commands
-
wp classifai image <attachment_ids> [--limit=<int>] [--skip=<skip>] [--force]Directly add description "alt text" and tags to attachment(s) using Azure AI Vision API.
-
<attachment_ids>: Comma delimited list of Attachment IDs to classify. -
[--limit=<int>]: Limit number of attachments to classify.default:
100 -
[--skip=<skip>]: Skip first N attachments.default:
false -
[--force]: Force classifying attachments regardless of their alt.default:
false
-
-
wp classifai crop <attachment_ids> [--limit=<limit>] [--skip=<skip>]Batch crop image(s) using Azure AI Vision API.
-
<attachment_ids>: Comma delimited list of Attachment IDs to crop. -
[--limit=<int>]: Limit number of attachments to crop.default:
100 -
[--skip=<skip>]: Skip first N attachments.default:
false
-
ClassifAI Settings Commands
-
wp classifai authPrints the Basic Auth header based on credentials configured in the plugin.
-
wp classifai resetRestores the plugin configuration to factory defaults. Any API credentials will need to be re-entered after this is ran.