CLI Commands (StorefrontAgentBundle) 

oro:ai-agent:access-token:create 

Creates an OAuth2 access token for the specified customer user for the Smart Agent microservice for development or testing purposes.

php bin/console oro:ai-agent:access-token:create

Commands in Use (Examples) 

The following example runs the creation of an OAuth2 access token for customer user Amanda and returns the result in JSON format:

php bin/console oro:ai-agent:access-token:create --current-customer-user=1 --format=json

The output would be as follows:

{
    "customer_user_identifier": "1",
    "access_token": "access token hash",
    "client_name": "Oro Agent Client"
}

The following example runs the creation of an OAuth2 access token for customer user Amanda and returns the result in text format:

php bin/console oro:ai-agent:access-token:create --current-customer-user=1

The output would be as follows:

OAuth2 Access Token
-------------------
* customer_user_identifier: 1
* access_token: access token hash
* client_name: Oro Agent Client