Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change from --job-spec to --spec [skip-validate-pr] #45

Merged
merged 2 commits into from
Dec 16, 2024
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 @@ -4,7 +4,7 @@
"command": "agent:create",
"flagAliases": [],
"flagChars": ["f", "n", "o"],
"flags": ["api-version", "flags-dir", "job-spec", "json", "name", "target-org"],
"flags": ["api-version", "flags-dir", "json", "name", "spec", "target-org"],
"plugin": "@salesforce/plugin-agent"
},
{
Expand Down
8 changes: 4 additions & 4 deletions messages/agent.create.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ Create an agent in your org from a local agent spec file.

# description

To generate an agent spec file, run the "agent generate spec" CLI command, which outputs a JSON file with the list of jobs and descriptions that the new agent can perform. Then specify this generated spec file to the --job-spec flag of this command, along with the name of the new agent.
To generate an agent spec file, run the "agent generate spec" CLI command, which outputs a JSON file with the list of jobs and descriptions that the new agent can perform. Then specify this generated spec file to the --spec flag of this command, along with the name of the new agent.

When this command finishes, your org contains the new agent, which you can then edit in the Agent Builder UI. The new agent already has a list of topics and actions that were automatically created from the list of jobs in the provided agent spec file. This command also retrieves all the metadata files associated with the new agent to your local DX project.

To open the new agent in your org's Agent Builder UI, run this command: "sf org open agent --name <api-name-of-your-agent>".
To open the new agent in your org's Agent Builder UI, run this command: "sf org open agent --name <api-name-of-your-agent>".

# flags.job-spec.summary
# flags.spec.summary

Path to an agent spec file.

Expand All @@ -22,4 +22,4 @@ API name of the new agent.

- Create an agent called "CustomerSupportAgent" in an org with alias "my-org" using the specified agent spec file:

<%= config.bin %> <%= command.id %> --name CustomerSupportAgent --job-spec ./config/agentSpec.json --target-org my-org
<%= config.bin %> <%= command.id %> --name CustomerSupportAgent --spec ./config/agentSpec.json --target-org my-org
8 changes: 4 additions & 4 deletions src/commands/agent/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export default class AgentCreate extends SfCommand<AgentCreateResult> {
public static readonly flags = {
'target-org': Flags.requiredOrg(),
'api-version': Flags.orgApiVersion(),
'job-spec': Flags.file({
spec: Flags.file({
char: 'f',
required: true,
summary: messages.getMessage('flags.job-spec.summary'),
summary: messages.getMessage('flags.spec.summary'),
}),
name: Flags.string({
char: 'n',
Expand All @@ -44,7 +44,7 @@ export default class AgentCreate extends SfCommand<AgentCreateResult> {

public async run(): Promise<AgentCreateResult> {
const { flags } = await this.parse(AgentCreate);
const jsonParsingStage = `Parsing ${flags['job-spec']}`;
const jsonParsingStage = `Parsing ${flags.spec}`;
const mso = new MultiStageOutput({
jsonEnabled: this.jsonEnabled(),
title: `Creating ${flags.name} Agent`,
Expand All @@ -59,7 +59,7 @@ export default class AgentCreate extends SfCommand<AgentCreateResult> {

mso.goto(jsonParsingStage);
const agentConfig = {
...(JSON.parse(fs.readFileSync(flags['job-spec'], 'utf8')) as AgentCreateConfig),
...(JSON.parse(fs.readFileSync(flags.spec, 'utf8')) as AgentCreateConfig),
name: flags.name,
};

Expand Down
Loading