Skip to content

[00] Subset Fill, For developers

WP-CLI commands

Every wp subset content-builder command in Subset Fill and Fill Pro, with its options, defaults and examples as wp help prints them.

Subset Fill adds its commands under wp subset content-builder, and Subset Fill Pro adds its own under wp subset content-builder-pro. Run wp help subset content-builder <command> on your site to see the same text there.

wp subset content-builder provider set anthropic --model=claude-opus-5-5
printf %s "$ANTHROPIC_API_KEY" | wp subset content-builder key set anthropic
wp subset content-builder key test
wp subset content-builder map field_sections article.html --plan

map

Arranges a file’s content into a Flexible Content field’s layouts and prints the rows as JSON. It uses the provider and model set on Subset → Fill. The rows are printed after the word-for-word check, with what the check cleared (flags), the rows it dropped (dropped) and the source passages that weren’t placed (unplaced). Nothing is saved.

wp subset content-builder map <field> <file> [--plan] [--raw]
OptionDefaultWhat it does
<field>NoneThe Flexible Content field key, such as field_sections.
<file>NoneAn HTML or plain-text file to arrange. Use - for standard input.
--planOffPrints the chunks and the first chunk’s prompt instead of calling the provider.
--rawOffPrints the rows as the model returned them, before validation.
wp subset content-builder map field_sections article.html
wp subset content-builder map field_sections article.html --plan
wp subset content-builder map field_sections article.html --raw

The old wp sfcb map still runs map, but prints a warning that it’s deprecated. Use wp subset content-builder map in new scripts.

provider

Lists, shows and chooses the AI provider and its model, as on Subset → Fill. Keys are never shown, only where each one comes from.

provider list

Lists the providers available on this site. The key column says where each provider’s key comes from: saved, constant (set in wp-config.php), unreadable (saved before the site’s security keys changed, so enter it again), none or not-needed.

wp subset content-builder provider list [--format=<format>]
OptionDefaultWhat it does
--format=<format>tableOutput format: table, json, csv or yaml.

provider get

Shows one provider, the selected one by default.

wp subset content-builder provider get [<id>] [--format=<format>]
OptionDefaultWhat it does
<id>Selected providerThe provider ID, such as anthropic.
--format=<format>tableOutput format: table, json or yaml.
wp subset content-builder provider get
wp subset content-builder provider get openai --format=json

provider set

Chooses the provider the builder uses, and optionally its model.

wp subset content-builder provider set <id> [--model=<model>]
OptionDefaultWhat it does
<id>NoneThe provider ID, such as anthropic. See provider list.
--model=<model>NoneThe model ID for this provider. An empty value goes back to the provider’s default.
wp subset content-builder provider set anthropic
wp subset content-builder provider set openrouter --model=anthropic/claude-opus-5.5
wp subset content-builder provider set openai --model=

key

Saves, removes and tests provider API keys, as on Subset → Fill. A key is stored encrypted and never printed.

key set

Saves a provider’s API key, encrypted. It reads the key from standard input unless you pass --key. Prefer standard input: a key passed with --key stays in your shell history.

wp subset content-builder key set <provider> [--key=<key>]
OptionDefaultWhat it does
<provider>NoneThe provider ID, such as anthropic.
--key=<key>Standard inputThe API key.
printf %s "$ANTHROPIC_API_KEY" | wp subset content-builder key set anthropic

key delete

Removes a provider’s saved API key. A key set in wp-config.php isn’t affected.

wp subset content-builder key delete <provider>
OptionDefaultWhat it does
<provider>NoneThe provider ID, such as anthropic.
wp subset content-builder key delete openai

key test

Tests a provider’s key and model, as Test connection on the settings screen does. It sends no content.

wp subset content-builder key test [<provider>]
OptionDefaultWhat it does
<provider>Selected providerThe provider ID.
wp subset content-builder key test
wp subset content-builder key test openrouter

import (Pro)

Turns a Word file or a web page into the HTML the Build modal would build from, and prints it. It’s the same conversion as Word file and From a web address in the Build modal, with the same size and type checks for Word files, the same public-address rules for web pages and the same sanitised HTML. Nothing is saved unless you pass --images. Warnings go to standard error, so you can pipe the HTML.

wp subset content-builder-pro import <source> [--images] [--post=<id>]
OptionDefaultWhat it does
<source>NoneA .docx file, or an http or https web address.
--imagesOffCopies the images (embedded in the Word file, or on the page) to the media library and points the HTML at the copies. Without it, a Word file’s images are left out and a page’s keep their original addresses.
--post=<id>NoneThe post to attach copied images to.
wp subset content-builder-pro import report.docx > report.html
wp subset content-builder-pro import https://example.com/about --images --post=42
wp subset content-builder-pro import report.docx | wp subset content-builder map field_sections -