Skip to content

Commit

Permalink
fix: change from --job-spec to --spec [skip-validate-pr]
Browse files Browse the repository at this point in the history
  • Loading branch information
WillieRuemmele committed Dec 16, 2024
1 parent aa0c5fe commit 6234021
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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
6 changes: 3 additions & 3 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 Down
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

0 comments on commit 6234021

Please sign in to comment.