Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion command-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
"command": "org:open:agent",
"flagAliases": ["urlonly"],
"flagChars": ["b", "n", "o", "r"],
"flags": ["api-version", "browser", "flags-dir", "json", "name", "private", "target-org", "url-only"],
"flags": ["api-name", "api-version", "browser", "flags-dir", "json", "private", "target-org", "url-only"],
"plugin": "@salesforce/plugin-org"
},
{
Expand Down
10 changes: 5 additions & 5 deletions messages/open.agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Open an agent in your org's Agent Builder UI in a browser.

# description

Use the --name flag to open an agent using its API name in the Agent Builder UI of your org. To find the agent's API name, go to Setup in your org and navigate to the agent's details page.
Use the --api-name flag to open an agent using its API name in the Agent Builder UI of your org. To find the agent's API name, go to Setup in your org and navigate to the agent's details page.

To generate the URL but not launch it in your browser, specify --url-only.

Expand All @@ -14,17 +14,17 @@ To open Agent Builder in a specific browser, use the --browser flag. Supported b

- Open the agent with API name Coral_Cloud_Agent in your default org using your default browser:

$ <%= config.bin %> <%= command.id %> --name Coral_Cloud_Agent
$ <%= config.bin %> <%= command.id %> --api-name Coral_Cloud_Agent

- Open the agent in an incognito window of your default browser:

$ <%= config.bin %> <%= command.id %> --private --name Coral_Cloud_Agent:
$ <%= config.bin %> <%= command.id %> --private --api-name Coral_Cloud_Agent:

- Open the agent in an org with alias MyTestOrg1 using the Firefox browser:

$ <%= config.bin %> <%= command.id %> --target-org MyTestOrg1 --browser firefox --name Coral_Cloud_Agent
$ <%= config.bin %> <%= command.id %> --target-org MyTestOrg1 --browser firefox --api-name Coral_Cloud_Agent

# flags.name.summary
# flags.api-name.summary

API name, also known as developer name, of the agent you want to open in the org's Agent Builder UI.

Expand Down
7 changes: 3 additions & 4 deletions src/commands/org/open/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,14 @@ export class OrgOpenAgent extends OrgOpenCommandBase<OrgOpenOutput> {
public static readonly summary = messages.getMessage('summary');
public static readonly description = messages.getMessage('description');
public static readonly examples = messages.getMessages('examples');
public static readonly state = 'beta';

public static readonly flags = {
...OrgOpenCommandBase.flags,
'target-org': Flags.requiredOrg(),
'api-version': Flags.orgApiVersion(),
name: Flags.string({
'api-name': Flags.string({
char: 'n',
summary: messages.getMessage('flags.name.summary'),
summary: messages.getMessage('flags.api-name.summary'),
required: true,
}),
private: Flags.boolean({
Expand Down Expand Up @@ -54,7 +53,7 @@ export class OrgOpenAgent extends OrgOpenCommandBase<OrgOpenOutput> {

const [frontDoorUrl, retUrl] = await Promise.all([
buildFrontdoorUrl(this.org, this.connection, true),
buildRetUrl(this.connection, flags.name),
buildRetUrl(this.connection, flags['api-name']),
]);

return this.openOrgUI(flags, frontDoorUrl, encodeURIComponent(retUrl));
Expand Down
Loading