productivity
WooCommerce CLI for AI Agents
Use the WooCommerce CLI from KosmoKrator to call WooCommerce tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.WooCommerce CLI Setup
WooCommerce can be configured headlessly with `kosmokrator integrations:configure woocommerce`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure woocommerce --set access_token="$WOOCOMMERCE_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor woocommerce --json
kosmokrator integrations:status --json Credentials
Authentication type: Bearer token bearer_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
access_token | WOOCOMMERCE_ACCESS_TOKEN | Secret secret | yes | Access Token |
base_url | WOOCOMMERCE_BASE_URL | URL url | no | Base URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call woocommerce.woocommerce_list_products '{"per_page":1,"page":1,"search":"example_search","status":"example_status","category":"example_category","sku":"example_sku","orderby":"example_orderby","order":"example_order"}' --json kosmo integrations:woocommerce woocommerce_list_products '{"per_page":1,"page":1,"search":"example_search","status":"example_status","category":"example_category","sku":"example_sku","orderby":"example_orderby","order":"example_order"}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs woocommerce --json
kosmo integrations:docs woocommerce.woocommerce_list_products --json
kosmo integrations:schema woocommerce.woocommerce_list_products --json
kosmo integrations:search "WooCommerce" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
woocommerce.woocommerce_list_products
List products from the WooCommerce catalog. Supports pagination, filtering by name or SKU, and including variants/images.
read - Parameters
- per_page, page, search, status, category, sku, orderby, order
kosmo integrations:call woocommerce.woocommerce_list_products '{"per_page":1,"page":1,"search":"example_search","status":"example_status","category":"example_category","sku":"example_sku","orderby":"example_orderby","order":"example_order"}' --json kosmo integrations:woocommerce woocommerce_list_products '{"per_page":1,"page":1,"search":"example_search","status":"example_status","category":"example_category","sku":"example_sku","orderby":"example_orderby","order":"example_order"}' --json woocommerce.woocommerce_get_product
Get a single product from the WooCommerce catalog by its ID. Returns full product details.
read - Parameters
- id
kosmo integrations:call woocommerce.woocommerce_get_product '{"id":1}' --json kosmo integrations:woocommerce woocommerce_get_product '{"id":1}' --json woocommerce.woocommerce_create_product
Create a new product in the WooCommerce catalog. Requires name and regular_price. Supports type (simple, grouped, external, variable), SKU, description, and more.
write - Parameters
- name, regular_price, type, sku, description, short_description, weight, categories, manage_stock, stock_quantity, status, images
kosmo integrations:call woocommerce.woocommerce_create_product '{"name":"example_name","regular_price":"example_regular_price","type":"example_type","sku":"example_sku","description":"example_description","short_description":"example_short_description","weight":"example_weight","categories":"example_categories"}' --json kosmo integrations:woocommerce woocommerce_create_product '{"name":"example_name","regular_price":"example_regular_price","type":"example_type","sku":"example_sku","description":"example_description","short_description":"example_short_description","weight":"example_weight","categories":"example_categories"}' --json woocommerce.woocommerce_list_orders
List orders from the WooCommerce store. Supports filtering by status, customer, and pagination.
read - Parameters
- per_page, page, status, customer, after, before, orderby, order
kosmo integrations:call woocommerce.woocommerce_list_orders '{"per_page":1,"page":1,"status":"example_status","customer":1,"after":"example_after","before":"example_before","orderby":"example_orderby","order":"example_order"}' --json kosmo integrations:woocommerce woocommerce_list_orders '{"per_page":1,"page":1,"status":"example_status","customer":1,"after":"example_after","before":"example_before","orderby":"example_orderby","order":"example_order"}' --json woocommerce.woocommerce_get_order
Get a single order from the WooCommerce store by its ID. Returns full order details including line items and totals.
read - Parameters
- id
kosmo integrations:call woocommerce.woocommerce_get_order '{"id":1}' --json kosmo integrations:woocommerce woocommerce_get_order '{"id":1}' --json woocommerce.woocommerce_list_customers
List customers from the WooCommerce store. Supports filtering by name or email and pagination.
read - Parameters
- per_page, page, search, orderby, order
kosmo integrations:call woocommerce.woocommerce_list_customers '{"per_page":1,"page":1,"search":"example_search","orderby":"example_orderby","order":"example_order"}' --json kosmo integrations:woocommerce woocommerce_list_customers '{"per_page":1,"page":1,"search":"example_search","orderby":"example_orderby","order":"example_order"}' --json woocommerce.woocommerce_get_current_user
Get the system status from WooCommerce. Use this to verify the API connection is working and retrieve store information.
read - Parameters
- none
kosmo integrations:call woocommerce.woocommerce_get_current_user '{}' --json kosmo integrations:woocommerce woocommerce_get_current_user '{}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
woocommerce.woocommerce_list_products 8 parameters
kosmo integrations:schema woocommerce.woocommerce_list_products --json | Parameter | Type | Required | Description |
|---|---|---|---|
per_page | integer | no | Number of products to return per page (default: 10, max: 100). |
page | integer | no | Page number for pagination (default: 1). |
search | string | no | Search products by name or description. |
status | string | no | Filter by product status: "publish", "draft", "pending", "private", or "trash". |
category | string | no | Filter by category ID. |
sku | string | no | Filter by SKU. |
orderby | string | no | Sort collection by field (e.g., "date", "id", "title", "slug", "price"). |
order | string | no | Sort direction: "asc" or "desc". |
woocommerce.woocommerce_get_product 1 parameters
kosmo integrations:schema woocommerce.woocommerce_get_product --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The product ID. |
woocommerce.woocommerce_create_product 12 parameters
kosmo integrations:schema woocommerce.woocommerce_create_product --json | Parameter | Type | Required | Description |
|---|---|---|---|
name | string | yes | Product name. |
regular_price | string | yes | Base price (e.g., "29.99"). |
type | string | no | Product type: "simple", "grouped", "external", or "variable" (default: "simple"). |
sku | string | no | Unique SKU for the product. |
description | string | no | Product description (HTML allowed). |
short_description | string | no | Short product description. |
weight | string | no | Weight of the product. |
categories | array | no | Array of category objects with "id" keys. |
manage_stock | boolean | no | Whether to enable stock management (default: false). |
stock_quantity | integer | no | Stock level (when manage_stock is true). |
status | string | no | Product status: "publish", "draft", "pending", or "private" (default: "publish"). |
images | array | no | Array of image objects with "src" key. |
woocommerce.woocommerce_list_orders 8 parameters
kosmo integrations:schema woocommerce.woocommerce_list_orders --json | Parameter | Type | Required | Description |
|---|---|---|---|
per_page | integer | no | Number of orders per page (default: 10, max: 100). |
page | integer | no | Page number for pagination (default: 1). |
status | string | no | Filter by order status: "pending", "processing", "on-hold", "completed", "cancelled", "refunded", or "failed". |
customer | integer | no | Filter by customer ID. |
after | string | no | Limit response to orders created after this date (ISO 8601, e.g., "2025-01-01T00:00:00"). |
before | string | no | Limit response to orders created before this date (ISO 8601). |
orderby | string | no | Sort collection by field (e.g., "date", "id", "total"). |
order | string | no | Sort direction: "asc" or "desc". |
woocommerce.woocommerce_get_order 1 parameters
kosmo integrations:schema woocommerce.woocommerce_get_order --json | Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | yes | The order ID. |
woocommerce.woocommerce_list_customers 5 parameters
kosmo integrations:schema woocommerce.woocommerce_list_customers --json | Parameter | Type | Required | Description |
|---|---|---|---|
per_page | integer | no | Number of customers per page (default: 10, max: 100). |
page | integer | no | Page number for pagination (default: 1). |
search | string | no | Search by customer name or email. |
orderby | string | no | Sort collection by field (e.g., "id", "name", "registered_date"). |
order | string | no | Sort direction: "asc" or "desc". |
woocommerce.woocommerce_get_current_user 0 parameters
kosmo integrations:schema woocommerce.woocommerce_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.