KosmoKrator

sales

Magento CLI for AI Agents

Use the Magento CLI from KosmoKrator to call Magento tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

7 functions 6 read 1 write Manual OAuth token auth

Magento CLI Setup

Magento can be configured headlessly with `kosmokrator integrations:configure magento`.

# 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 magento --set access_token="$MAGENTO_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor magento --json
kosmokrator integrations:status --json

Credentials

Authentication type: Manual OAuth token oauth2_manual_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token MAGENTO_ACCESS_TOKEN Secret secret yes Access Token
url MAGENTO_URL URL url no API Base URL

Call Magento Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call magento.magento_list_products '{
  "search_criteria": "example_search_criteria",
  "page_size": 1,
  "current_page": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:magento magento_list_products '{
  "search_criteria": "example_search_criteria",
  "page_size": 1,
  "current_page": 1
}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs magento --json
kosmo integrations:docs magento.magento_list_products --json
kosmo integrations:schema magento.magento_list_products --json
kosmo integrations:search "Magento" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Magento.

magento.magento_list_products

Read read

List products from the Magento catalog. Returns a list of products with support for search criteria filtering and pagination.

Parameters
search_criteria, page_size, current_page

Generic CLI call

kosmo integrations:call magento.magento_list_products '{"search_criteria":"example_search_criteria","page_size":1,"current_page":1}' --json

Provider shortcut

kosmo integrations:magento magento_list_products '{"search_criteria":"example_search_criteria","page_size":1,"current_page":1}' --json

magento.magento_get_product

Read read

Get details of a specific Magento product by its SKU. Returns the full product object including attributes, pricing, and stock information.

Parameters
sku

Generic CLI call

kosmo integrations:call magento.magento_get_product '{"sku":"example_sku"}' --json

Provider shortcut

kosmo integrations:magento magento_get_product '{"sku":"example_sku"}' --json

magento.magento_create_product

Write write

Create a new product in the Magento catalog. Requires SKU, name, price, and attribute set ID. Returns the created product object.

Parameters
sku, name, price, attribute_set_id, type_id, weight, description, short_description, visibility, status

Generic CLI call

kosmo integrations:call magento.magento_create_product '{"sku":"example_sku","name":"example_name","price":1,"attribute_set_id":1,"type_id":"example_type_id","weight":1,"description":"example_description","short_description":"example_short_description"}' --json

Provider shortcut

kosmo integrations:magento magento_create_product '{"sku":"example_sku","name":"example_name","price":1,"attribute_set_id":1,"type_id":"example_type_id","weight":1,"description":"example_description","short_description":"example_short_description"}' --json

magento.magento_list_orders

Read read

List orders from the Magento store. Returns a list of orders with support for search criteria filtering and pagination.

Parameters
search_criteria, page_size, current_page

Generic CLI call

kosmo integrations:call magento.magento_list_orders '{"search_criteria":"example_search_criteria","page_size":1,"current_page":1}' --json

Provider shortcut

kosmo integrations:magento magento_list_orders '{"search_criteria":"example_search_criteria","page_size":1,"current_page":1}' --json

magento.magento_get_order

Read read

Get details of a specific Magento order by its ID. Returns the full order object including items, addresses, payment, and totals.

Parameters
order_id

Generic CLI call

kosmo integrations:call magento.magento_get_order '{"order_id":"example_order_id"}' --json

Provider shortcut

kosmo integrations:magento magento_get_order '{"order_id":"example_order_id"}' --json

magento.magento_list_customers

Read read

List customers from the Magento store. Returns a list of customers with support for search criteria filtering and pagination.

Parameters
search_criteria, page_size, current_page

Generic CLI call

kosmo integrations:call magento.magento_list_customers '{"search_criteria":"example_search_criteria","page_size":1,"current_page":1}' --json

Provider shortcut

kosmo integrations:magento magento_list_customers '{"search_criteria":"example_search_criteria","page_size":1,"current_page":1}' --json

magento.magento_get_current_user

Read read

Verify Magento API connectivity and retrieve current user information. Useful as a health check to confirm the integration is properly configured.

Parameters
none

Generic CLI call

kosmo integrations:call magento.magento_get_current_user '{}' --json

Provider shortcut

kosmo integrations:magento magento_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

magento.magento_list_products

List products from the Magento catalog. Returns a list of products with support for search criteria filtering and pagination.

Operation
Read read
Schema command
kosmo integrations:schema magento.magento_list_products --json
ParameterTypeRequiredDescription
search_criteria string no Search criteria filter expression (e.g., "name:like:%shirt%").
page_size integer no Number of products per page (default: 20).
current_page integer no Current page number for pagination (starts at 1).

magento.magento_get_product

Get details of a specific Magento product by its SKU. Returns the full product object including attributes, pricing, and stock information.

Operation
Read read
Schema command
kosmo integrations:schema magento.magento_get_product --json
ParameterTypeRequiredDescription
sku string yes The product SKU (Stock Keeping Unit) to retrieve.

magento.magento_create_product

Create a new product in the Magento catalog. Requires SKU, name, price, and attribute set ID. Returns the created product object.

Operation
Write write
Schema command
kosmo integrations:schema magento.magento_create_product --json
ParameterTypeRequiredDescription
sku string yes Unique product SKU.
name string yes Product name.
price number yes Product price (e.g., 29.99).
attribute_set_id integer no Attribute set ID (default: 4 for Default).
type_id string no Product type (simple, configurable, virtual, etc.). Default: "simple".
weight number no Product weight.
description string no Full product description.
short_description string no Short product description.
visibility integer no Visibility (1=Not Visible, 2=Catalog, 3=Search, 4=Catalog & Search). Default: 4.
status integer no Product status (1=Enabled, 2=Disabled). Default: 1.

magento.magento_list_orders

List orders from the Magento store. Returns a list of orders with support for search criteria filtering and pagination.

Operation
Read read
Schema command
kosmo integrations:schema magento.magento_list_orders --json
ParameterTypeRequiredDescription
search_criteria string no Search criteria filter expression (e.g., "status:pending").
page_size integer no Number of orders per page (default: 20).
current_page integer no Current page number for pagination (starts at 1).

magento.magento_get_order

Get details of a specific Magento order by its ID. Returns the full order object including items, addresses, payment, and totals.

Operation
Read read
Schema command
kosmo integrations:schema magento.magento_get_order --json
ParameterTypeRequiredDescription
order_id string yes The order increment ID or entity ID.

magento.magento_list_customers

List customers from the Magento store. Returns a list of customers with support for search criteria filtering and pagination.

Operation
Read read
Schema command
kosmo integrations:schema magento.magento_list_customers --json
ParameterTypeRequiredDescription
search_criteria string no Search criteria filter expression.
page_size integer no Number of customers per page (default: 20).
current_page integer no Current page number for pagination (starts at 1).

magento.magento_get_current_user

Verify Magento API connectivity and retrieve current user information. Useful as a health check to confirm the integration is properly configured.

Operation
Read read
Schema command
kosmo integrations:schema magento.magento_get_current_user --json
ParameterTypeRequiredDescription
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.