Config Commands #
Get or set the CLI API key used by WP-CLI commands to authenticate against the REST API. The currently supported configuration key is api_key.
# Set the CLI API key
wp dmsi-api config set api_key dmsi_key_<your-key>
# Get the current CLI API key
wp dmsi-api config get api_key
Example output:
dmsi_key_a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2
Note: The config set api_key command stores the key in the dmsi_aapi_cli_key WordPress option. This key is used for all subsequent WP-CLI API calls.
Customer Commands #
Manage DDLS customers from the command line.
# List customers
wp dmsi-api customers list [--status=<status>] [--email=<email>] [--page=<n>] [--per-page=<n>] [--format=json|table|csv]
# Get a specific customer by ID
wp dmsi-api customers get <id> [--format=json|table]
# Create a new customer (--email is required)
wp dmsi-api customers create --email=<email> [--first_name=<name>] [--last_name=<name>] [--company=<company>] [--status=<status>] [--format=json]
# Update an existing customer
wp dmsi-api customers update <id> [--email=<email>] [--first_name=<name>] [--last_name=<name>] [--company=<company>] [--format=json]
# Delete a customer (prompts for confirmation unless --yes is passed)
wp dmsi-api customers delete <id> [--yes]
# Import customers from a CSV file (email column required)
wp dmsi-api customers import <file> [--dry-run] [--format=json|table|csv]
Example — list active customers as a table:
wp dmsi-api customers list --status=active --format=table
+----+------------+-----------+---------------------+--------+
| id | first_name | last_name | email | status |
+----+------------+-----------+---------------------+--------+
| 1 | Jane | Smith | jane@example.com | active |
| 2 | ACME | Corp | billing@acme.com | active |
+----+------------+-----------+---------------------+--------+
Example — create a customer:
wp dmsi-api customers create --email="new@example.com" --first_name="Jane" --last_name="Doe"
{
"id": 3,
"email": "new@example.com",
"first_name": "Jane",
"last_name": "Doe",
"status": "active"
}
