@@ -132,7 +132,7 @@ EXAMPLES
132132 $ sf agent create --agent-name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
133133```
134134
135- _ See code: [ src/commands/agent/create.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.8 /src/commands/agent/create.ts ) _
135+ _ See code: [ src/commands/agent/create.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.9 /src/commands/agent/create.ts ) _
136136
137137## ` sf agent generate agent-spec `
138138
@@ -237,7 +237,7 @@ EXAMPLES
237237 $ sf agent generate agent-spec --tone formal --agent-user [email protected] 238238```
239239
240- _ See code: [ src/commands/agent/generate/agent-spec.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.8 /src/commands/agent/generate/agent-spec.ts ) _
240+ _ See code: [ src/commands/agent/generate/agent-spec.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.9 /src/commands/agent/generate/agent-spec.ts ) _
241241
242242## ` sf agent generate template `
243243
@@ -285,7 +285,7 @@ EXAMPLES
285285 force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
286286```
287287
288- _ See code: [ src/commands/agent/generate/template.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.8 /src/commands/agent/generate/template.ts ) _
288+ _ See code: [ src/commands/agent/generate/template.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.9 /src/commands/agent/generate/template.ts ) _
289289
290290## ` sf agent generate test-spec `
291291
@@ -343,7 +343,7 @@ EXAMPLES
343343 force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
344344```
345345
346- _ See code: [ src/commands/agent/generate/test-spec.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.8 /src/commands/agent/generate/test-spec.ts ) _
346+ _ See code: [ src/commands/agent/generate/test-spec.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.9 /src/commands/agent/generate/test-spec.ts ) _
347347
348348## ` sf agent preview `
349349
@@ -355,7 +355,7 @@ USAGE
355355
356356FLAGS
357357 -a, --connected-app-user=<value> (required) Username or alias of the connected app user that's configured with
358- JWT -based access tokens to the agent.
358+ web -based access tokens to the agent.
359359 -d, --output-dir=<value> Directory where conversation transcripts are saved.
360360 -n, --api-name=<value> API name of the agent you want to interact with.
361361 -o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
@@ -386,40 +386,57 @@ DESCRIPTION
386386 Find the agent's API name in its main details page in your org's Agent page in Setup.
387387
388388 Before you use this command, you must complete these steps:
389+ -----------------------------------------------------------
389390
390391 1. Create a connected app in your org as described in the "Create a Connected App" section here:
391392 https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#create-a-connected-app. Do these
392- two additional steps:
393+ four additional steps:
393394
394395 a. When specifying the connected app's Callback URL, add this second callback URL on a new line:
395- http://localhost:1717/OauthRedirect
396+ " http://localhost:1717/OauthRedirect".
396397
397- b. Make note of the user that you specified as the "Run As" user when updating the Client Credentials Flow section.
398+ b. When adding the scopes to the connected app, add "Manage user data via Web browsers (web)".
399+
400+ c. Ensure that the "Require Secret for Web Server Flow" option is not selected.
401+
402+ d. Make note of the user that you specified as the "Run As" user when updating the Client Credentials Flow section.
398403
399404 2. Add the connected app to your agent as described in the "Add Connected App to Agent" section here:
400405 https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#add-connected-app-to-agent.
401406
402- 3. Using the username of the user you specified as the "Run As" user above, authorize your org using the JWT flow, as
403- described in this document:
404- https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_jwt_flow.htm.
407+ 3. Copy the consumer key from your connected app as described in the "Obtain Credentials" section here:
408+ https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#obtain-credentials.
409+
410+ 4. Set the "SFDX_AUTH_SCOPES" environment variable to "refresh_token sfap_api chatbot_api web api". This step ensures
411+ that you get the specific OAuth scopes required by this command.
412+
413+ 5. Using the username of the user you specified as the "Run As" user above, authorize your org using the web server
414+ flow, as described in this document:
415+ https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_web_flow.htm.
416+
417+ IMPORTANT: You must use the "--client-id <CONNECTED-APP-CONSUMER-KEY>" flag of "org login web", where
418+ CONNECTED-APP-CONSUMER-KEY is the consumer key you previously copied. This step ensures that the "org login web"
419+ command uses your custom connected app, and not the default CLI connected app.
420+
421+ Press Enter to skip sharing the client secret.
405422
406- 4 . When you run this command to interact with an agent, specify the username you authorized in the preceding step with
423+ 6 . When you run this command to interact with an agent, specify the username you authorized in the preceding step with
407424 the --connected-app-user (-a) flag.
408425
409426EXAMPLES
410427 Interact with an agent with API name "Resort_Manager" in the org with alias "my-org". Connect to your agent using
411- the alias "my-jwt -user"; this alias must point to the username who is authorized using JWT :
428+ the alias "my-agent -user"; this alias must point to the username who is authorized using the Web server flow :
412429
413- $ sf agent preview --api-name "Resort_Manager" --target-org my-org --connected-app-user my-jwt -user
430+ $ sf agent preview --api-name "Resort_Manager" --target-org my-org --connected-app-user my-agent -user
414431
415432 Same as the preceding example, but this time save the conversation transcripts to the "./transcripts/my-preview"
416433 directory rather than the default "./temp/agent-preview":
417434
418- $ sf agent preview --api-name "Resort_Manager" --target-org my-org --connected-app-user my-jwt -user --output-dir \
419- "transcripts/my-preview"
435+ $ sf agent preview --api-name "Resort_Manager" --target-org my-org --connected-app-user my-agent -user \
436+ --output-dir "transcripts/my-preview"
420437```
421438
422- _ See code: [ src/commands/agent/preview.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.8 /src/commands/agent/preview.ts ) _
439+ _ See code: [ src/commands/agent/preview.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.9 /src/commands/agent/preview.ts ) _
423440
424441## ` sf agent test create `
425442
@@ -474,7 +491,7 @@ EXAMPLES
474491 $ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --test-api-name Resort_Manager_Test --preview
475492```
476493
477- _ See code: [ src/commands/agent/test/create.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.8 /src/commands/agent/test/create.ts ) _
494+ _ See code: [ src/commands/agent/test/create.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.9 /src/commands/agent/test/create.ts ) _
478495
479496## ` sf agent test list `
480497
@@ -509,7 +526,7 @@ EXAMPLES
509526 $ sf agent test list --target-org my-org
510527```
511528
512- _ See code: [ src/commands/agent/test/list.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.8 /src/commands/agent/test/list.ts ) _
529+ _ See code: [ src/commands/agent/test/list.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.9 /src/commands/agent/test/list.ts ) _
513530
514531## ` sf agent test results `
515532
@@ -565,7 +582,7 @@ FLAG DESCRIPTIONS
565582 test results aren't written.
566583```
567584
568- _ See code: [ src/commands/agent/test/results.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.8 /src/commands/agent/test/results.ts ) _
585+ _ See code: [ src/commands/agent/test/results.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.9 /src/commands/agent/test/results.ts ) _
569586
570587## ` sf agent test resume `
571588
@@ -628,7 +645,7 @@ FLAG DESCRIPTIONS
628645 test results aren't written.
629646```
630647
631- _ See code: [ src/commands/agent/test/resume.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.8 /src/commands/agent/test/resume.ts ) _
648+ _ See code: [ src/commands/agent/test/resume.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.9 /src/commands/agent/test/resume.ts ) _
632649
633650## ` sf agent test run `
634651
@@ -692,6 +709,6 @@ FLAG DESCRIPTIONS
692709 test results aren't written.
693710```
694711
695- _ See code: [ src/commands/agent/test/run.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.8 /src/commands/agent/test/run.ts ) _
712+ _ See code: [ src/commands/agent/test/run.ts] ( https://github.com/salesforcecli/plugin-agent/blob/1.20.9 /src/commands/agent/test/run.ts ) _
696713
697714<!-- commandsstop -->
0 commit comments