sf plugins install @salesforce/plugin-agent@x.y.z
- Please read our Code of Conduct
- Create a new issue before starting your project so that we can keep track of what you are trying to add/fix. That way, we can also offer suggestions or let you know if there is already an effort in progress.
- Fork this repository.
- Build the plugin locally
- Create a topic branch in your fork. Note, this step is recommended but technically not required if contributing using a fork.
- Edit the code in your fork.
- Write appropriate tests for your changes. Try to achieve at least 95% code coverage on any new code. No pull request will be accepted without unit tests.
- Sign CLA (see CLA below).
- Send us a pull request when you are done. We'll review your code, suggest any needed changes, and merge it in.
External contributors will be required to sign a Contributor's License Agreement. You can do so by going to https://cla.salesforce.com/sign-cla.
To build the plugin locally, make sure to have yarn installed and run the following commands:
# Clone the repository
git clone git@github.com:salesforcecli/plugin-agent
# Install the dependencies and compile
yarn && yarn build
To use your plugin, run using the local ./bin/dev.js
or ./bin/dev.cmd
file.
# Run using local run file.
./bin/dev.js agent
There should be no differences when running via the Salesforce CLI or using the local run file. However, it can be useful to link the plugin to do some additional testing or run your commands from anywhere on your machine.
# Link your plugin to the sf cli
sf plugins link .
# To verify
sf plugins
sf agent create
sf agent generate spec
sf agent test cancel
sf agent test results
sf agent test resume
sf agent test run
Create an Agent from an agent spec.
USAGE
$ sf agent create -o <value> -f <value> -n <value> [--json] [--flags-dir <value>] [--api-version <value>]
FLAGS
-f, --job-spec=<value> (required) The path to an agent spec file.
-n, --name=<value> (required) The name of the agent.
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
configuration variable is already set.
--api-version=<value> Override the api version used for api requests made by this command
GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.
--json Format output as json.
DESCRIPTION
Create an Agent from an agent spec.
Create an Agent from an agent spec. Agent metadata is created in the target org and retrieved to the local project.
EXAMPLES
Create an Agent:
$ sf agent create --spec ./agent-spec.json
FLAG DESCRIPTIONS
-f, --job-spec=<value> The path to an agent spec file.
The agent spec file defines job titles and descriptions for the agent and can be created using the `sf agent create
spec` command.
See code: src/commands/agent/create.ts
Create an Agent spec.
USAGE
$ sf agent generate spec -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-t customer|internal]
[--role <value>] [--company-name <value>] [--company-description <value>] [--company-website <value>] [-d <value>]
[-f <value>]
FLAGS
-d, --output-dir=<value> [default: config] The location within the project where the agent spec will be
written.
-f, --file-name=<value> [default: agentSpec.json] The name of the file to write the agent spec to.
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
configuration variable is already set.
-t, --type=<option> The type of agent to create.
<options: customer|internal>
--api-version=<value> Override the api version used for api requests made by this command
--company-description=<value> The description of the company, containing details to be used when generating agent
job descriptions.
--company-name=<value> The name of the company.
--company-website=<value> The website URL for the company.
--role=<value> The role of the agent.
GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.
--json Format output as json.
DESCRIPTION
Create an Agent spec.
Create an Agent spec, which is a list of job titles and descriptions that the agent performs.
EXAMPLES
Create an Agent spec in the default location:
$ sf agent generate spec --type customer_facing --role Support --company-name "Coral Cloud" \
--company-description "A meaningful description"
See code: src/commands/agent/generate/spec.ts
Cancel a running test for an Agent.
USAGE
$ sf agent test cancel -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-i <value>] [-r]
FLAGS
-i, --job-id=<value> The AiEvaluation ID.
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
configuration variable is already set.
-r, --use-most-recent Use the job ID of the most recent test evaluation.
--api-version=<value> Override the api version used for api requests made by this command
GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.
--json Format output as json.
DESCRIPTION
Cancel a running test for an Agent.
Cancel a running test for an Agent, providing the AiEvaluation ID.
EXAMPLES
Cancel a test for an Agent:
$ sf agent test cancel --job-id AiEvalId
See code: src/commands/agent/test/cancel.ts
Get the results of a test evaluation.
USAGE
$ sf agent test results -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>] [--result-format
json|human]
FLAGS
-i, --job-id=<value> (required) The AiEvaluation ID.
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
configuration variable is already set.
--api-version=<value> Override the api version used for api requests made by this command
--result-format=<option> [default: human] Format of the test run results.
<options: json|human>
GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.
--json Format output as json.
DESCRIPTION
Get the results of a test evaluation.
Provide the AiEvaluation ID to get the results of a test evaluation.
EXAMPLES
$ sf agent test results --job-id AiEvalId
See code: src/commands/agent/test/results.ts
Resume a running test for an Agent.
USAGE
$ sf agent test resume -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-i <value>] [-r] [-w
<value>] [--result-format json|human]
FLAGS
-i, --job-id=<value> The AiEvaluation ID.
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
configuration variable is already set.
-r, --use-most-recent Use the job ID of the most recent test evaluation.
-w, --wait=<value> [default: 5 minutes] Number of minutes to wait for the command to complete and display
results to the terminal window.
--api-version=<value> Override the api version used for api requests made by this command
--result-format=<option> [default: human] Format of the test run results.
<options: json|human>
GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.
--json Format output as json.
DESCRIPTION
Resume a running test for an Agent.
Resume a running test for an Agent, providing the AiEvaluation ID.
EXAMPLES
Resume a test for an Agent:
$ sf agent test resume --job-id AiEvalId
FLAG DESCRIPTIONS
-w, --wait=<value> Number of minutes to wait for the command to complete and display results to the terminal window.
If the command continues to run after the wait period, the CLI returns control of the terminal window to you.
See code: src/commands/agent/test/resume.ts
Start a test for an Agent.
USAGE
$ sf agent test run -o <value> -n <value> [--json] [--flags-dir <value>] [--api-version <value>] [-w <value>]
[--result-format json|human]
FLAGS
-n, --name=<value> (required) The name of the AiEvaluationDefinition to start.
-o, --target-org=<value> (required) Username or alias of the target org. Not required if the `target-org`
configuration variable is already set.
-w, --wait=<value> Number of minutes to wait for the command to complete and display results to the
terminal window.
--api-version=<value> Override the api version used for api requests made by this command
--result-format=<option> [default: human] Format of the test run results.
<options: json|human>
GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.
--json Format output as json.
DESCRIPTION
Start a test for an Agent.
Start a test for an Agent, providing the AiEvalDefinitionVersion ID. Returns the job ID.
EXAMPLES
Start a test for an Agent:
$ sf agent test run --name AiEvalDefVerId
FLAG DESCRIPTIONS
-n, --name=<value> The name of the AiEvaluationDefinition to start.
The name of the AiEvaluationDefinition to start.
-w, --wait=<value> Number of minutes to wait for the command to complete and display results to the terminal window.
If the command continues to run after the wait period, the CLI returns control of the terminal window to you.
See code: src/commands/agent/test/run.ts