@@ -130,7 +130,7 @@ EXAMPLES
130130 $ sf agent create --name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
131131```
132132
133- _ See code: [ src/commands/agent/create.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.22.8 /src/commands/agent/create.ts ) _
133+ _ See code: [ src/commands/agent/create.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.23.0 /src/commands/agent/create.ts ) _
134134
135135## ` sf agent generate agent-spec `
136136
@@ -235,7 +235,7 @@ EXAMPLES
235235 $ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
236236```
237237
238- _ See code: [ src/commands/agent/generate/agent-spec.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.22.8 /src/commands/agent/generate/agent-spec.ts ) _
238+ _ See code: [ src/commands/agent/generate/agent-spec.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.23.0 /src/commands/agent/generate/agent-spec.ts ) _
239239
240240## ` sf agent generate template `
241241
@@ -283,7 +283,7 @@ EXAMPLES
283283 force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
284284```
285285
286- _ See code: [ src/commands/agent/generate/template.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.22.8 /src/commands/agent/generate/template.ts ) _
286+ _ See code: [ src/commands/agent/generate/template.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.23.0 /src/commands/agent/generate/template.ts ) _
287287
288288## ` sf agent generate test-spec `
289289
@@ -341,26 +341,27 @@ EXAMPLES
341341 force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
342342```
343343
344- _ See code: [ src/commands/agent/generate/test-spec.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.22.8 /src/commands/agent/generate/test-spec.ts ) _
344+ _ See code: [ src/commands/agent/generate/test-spec.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.23.0 /src/commands/agent/generate/test-spec.ts ) _
345345
346346## ` sf agent preview `
347347
348348Interact with an active agent to preview how the agent responds to your statements, questions, and commands (utterances).
349349
350350```
351351USAGE
352- $ sf agent preview -o <value> -a <value> [--flags-dir <value>] [--api-version <value>] [-n <value>] [-d <value>]
353- [-x]
352+ $ sf agent preview (-c <value> -o <value>) [--flags-dir <value>] [--api-version <value>] [-n <value>] [-d
353+ <value>] [-x]
354354
355355FLAGS
356- -a, --connected-app-user=<value> (required) Username or alias of the connected app user that's configured with
357- web-based access tokens to the agent.
358- -d, --output-dir=<value> Directory where conversation transcripts are saved.
359- -n, --api-name=<value> API name of the agent you want to interact with.
360- -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
361- configuration variable is already set.
362- -x, --apex-debug Enable Apex debug logging during the agent preview conversation.
363- --api-version=<value> Override the api version used for api requests made by this command
356+ -c, --client-app=<value> (required) Name of the linked client app to use for the agent connection. You must have
357+ previously created this link with "org login web --client-app". Run "org display" to see
358+ the available linked client apps.
359+ -d, --output-dir=<value> Directory where conversation transcripts are saved.
360+ -n, --api-name=<value> API name of the agent you want to interact with.
361+ -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
362+ configuration variable is already set.
363+ -x, --apex-debug Enable Apex debug logging during the agent preview conversation.
364+ --api-version=<value> Override the api version used for api requests made by this command
364365
365366GLOBAL FLAGS
366367 --flags-dir=<value> Import flag values from a directory.
@@ -387,55 +388,57 @@ DESCRIPTION
387388
388389 Before you use this command, you must complete these steps:
389390
390- 1. Create a connected app in your org as described in the "Create a Connected App" section here:
391- https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#create-a-connected-app. Do these
392- four additional steps:
391+ 1. Using your org's Setup UI, create a connected app in your org as described in the "Create a Connected App" section
392+ here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#create-a-connected-app. Do
393+ these additional steps:
393394
394395 a. When specifying the connected app's Callback URL, add this second callback URL on a new line:
395396 "http://localhost:1717/OauthRedirect".
396397
397398 b. When adding the scopes to the connected app, add "Manage user data via Web browsers (web)".
398399
399- c. Ensure that the "Require Secret for Web Server Flow" option is not selected.
400-
401- d. Make note of the user that you specified as the "Run As" user when updating the Client Credentials Flow section.
402-
403400 2. Add the connected app to your agent as described in the "Add Connected App to Agent" section here:
404401 https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#add-connected-app-to-agent.
405402
406403 3. Copy the consumer key from your connected app as described in the "Obtain Credentials" section here:
407404 https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#obtain-credentials.
408405
409- 4. Set the "SFDX_AUTH_SCOPES" environment variable to "refresh_token sfap_api chatbot_api web api". This step ensures
410- that you get the specific OAuth scopes required by this command.
406+ 4. If you haven't already, run the "org login web" CLI command as usual to authorize the development org that contains
407+ the agent you want to preview.
408+
409+ 5. Re-run the "org web login" command to link the new connected app to your already-authenticated user. Use the
410+ --client-app flag to give the link a name; you can specify any string, but make a note of it because you'll need it
411+ later. Use --username to specify the username that you used to log into the org in the previous step. Use --client-id
412+ to specify the consumer key you previously copied. Finally, use --scopes as indicated to specify the required API
413+ scopes. Here's an example:
411414
412- 5. Using the username of the user you specified as the "Run As" user above, authorize your org using the web server
413- flow, as described in this document:
414- https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_web_flow.htm.
415+ sf org login web --client-app agent-app --username <username> --client-id <consumer-key> --scopes "sfap_api
416+ chatbot_api refresh_token api web"
415417
416418 IMPORTANT: You must use the "--client-id <CONNECTED-APP-CONSUMER-KEY>" flag of "org login web", where
417419 CONNECTED-APP-CONSUMER-KEY is the consumer key you previously copied. This step ensures that the "org login web"
418420 command uses your custom connected app, and not the default CLI connected app.
419421
420- Press Enter to skip sharing the client secret.
422+ 6. Press Enter to skip sharing the client secret, then log in with your org username as usual and click Accept .
421423
422- 6. When you run this command to interact with an agent, specify the username you authorized in the preceding step with
423- the --connected-app-user (-a) flag.
424+ 7. Run this command ("agent preview") to interact with an agent by using the --target-org flag to specify the org
425+ username or alias as usual and --client-app to specify the linked connected app ("agent-app" in the previous example).
426+ Use the "org display" command to get the list of client apps associated with an org.
424427
425428EXAMPLES
426- Interact with an agent with API name "Resort_Manager" in the org with alias "my-org". Connect to your agent using
427- the alias "my-agent-user"; this alias must point to the username who is authorized using the Web server flow :
429+ Interact with an agent with API name "Resort_Manager" in the org with alias "my-org" and the linked " agent-app"
430+ connected app :
428431
429- $ sf agent preview --api-name "Resort_Manager" --target-org my-org --connected -app-user my- agent-user
432+ $ sf agent preview --api-name "Resort_Manager" --target-org my-org --client -app agent-app
430433
431434 Same as the preceding example, but this time save the conversation transcripts to the "./transcripts/my-preview"
432435 directory rather than the default "./temp/agent-preview":
433436
434- $ sf agent preview --api-name "Resort_Manager" --target-org my-org --connected -app-user my-agent-user \
435- --output-dir "transcripts/my-preview"
437+ $ sf agent preview --api-name "Resort_Manager" --target-org my-org --client -app agent-app --output-dir \
438+ "transcripts/my-preview"
436439```
437440
438- _ See code: [ src/commands/agent/preview.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.22.8 /src/commands/agent/preview.ts ) _
441+ _ See code: [ src/commands/agent/preview.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.23.0 /src/commands/agent/preview.ts ) _
439442
440443## ` sf agent test create `
441444
@@ -490,7 +493,7 @@ EXAMPLES
490493 $ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview
491494```
492495
493- _ See code: [ src/commands/agent/test/create.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.22.8 /src/commands/agent/test/create.ts ) _
496+ _ See code: [ src/commands/agent/test/create.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.23.0 /src/commands/agent/test/create.ts ) _
494497
495498## ` sf agent test list `
496499
@@ -525,7 +528,7 @@ EXAMPLES
525528 $ sf agent test list --target-org my-org
526529```
527530
528- _ See code: [ src/commands/agent/test/list.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.22.8 /src/commands/agent/test/list.ts ) _
531+ _ See code: [ src/commands/agent/test/list.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.23.0 /src/commands/agent/test/list.ts ) _
529532
530533## ` sf agent test results `
531534
@@ -581,7 +584,7 @@ FLAG DESCRIPTIONS
581584 test results aren't written.
582585```
583586
584- _ See code: [ src/commands/agent/test/results.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.22.8 /src/commands/agent/test/results.ts ) _
587+ _ See code: [ src/commands/agent/test/results.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.23.0 /src/commands/agent/test/results.ts ) _
585588
586589## ` sf agent test resume `
587590
@@ -644,7 +647,7 @@ FLAG DESCRIPTIONS
644647 test results aren't written.
645648```
646649
647- _ See code: [ src/commands/agent/test/resume.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.22.8 /src/commands/agent/test/resume.ts ) _
650+ _ See code: [ src/commands/agent/test/resume.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.23.0 /src/commands/agent/test/resume.ts ) _
648651
649652## ` sf agent test run `
650653
@@ -708,6 +711,6 @@ FLAG DESCRIPTIONS
708711 test results aren't written.
709712```
710713
711- _ See code: [ src/commands/agent/test/run.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.22.8 /src/commands/agent/test/run.ts ) _
714+ _ See code: [ src/commands/agent/test/run.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.23.0 /src/commands/agent/test/run.ts ) _
712715
713716<!-- commandsstop -->
0 commit comments