Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
af07c24
fix: add --version flag to agent activate/deactivate
WillieRuemmele Mar 3, 2026
4fe0098
fix: deactivate only one version anywyays
WillieRuemmele Mar 3, 2026
240c90e
chore: fix output
WillieRuemmele Mar 3, 2026
a6dd2a7
fix: usability, errors, tests
WillieRuemmele Mar 3, 2026
6b057c0
chore: filter deleted versions
WillieRuemmele Mar 3, 2026
c165ee9
fix: edit
jshackell-sfdc Mar 3, 2026
8edf77f
Update agent.deactivate.md
jshackell-sfdc Mar 3, 2026
92de9f2
Merge pull request #349 from salesforcecli/jshackell-sfdc-patch-1
WillieRuemmele Mar 3, 2026
6a2c5cc
chore: add a skill for reviewing plugin-agent PRs
shetzel Mar 8, 2026
3d42f66
chore: enable json flag on deactivate
WillieRuemmele Mar 9, 2026
35afe80
Merge branch 'main' into wr/activateVersion
WillieRuemmele Mar 9, 2026
610c1e9
feat(run-eval): whitelist state/setupSessionContext, translate contex…
Jaganpro Mar 9, 2026
bb45251
chore: regenerate JSON schemas after RunEvalResult type change
Jaganpro Mar 9, 2026
2f27bed
feat: add comprehensive contextVariables validation, tests, and docum…
WillieRuemmele Mar 9, 2026
5b6d631
Merge pull request #357 from salesforcecli/qa/356
WillieRuemmele Mar 9, 2026
a746474
chore(release): 1.32.0 [skip ci]
svc-cli-bot Mar 9, 2026
77cd590
fix: update local asset references to global assets
EstebanRomero84 Mar 9, 2026
4ceea6f
Merge pull request #355 from salesforcecli/sh/pr-review-skill
WillieRuemmele Mar 10, 2026
da30ff2
chore: hide unactivatable/deactivatble options, alphabetize
WillieRuemmele Mar 10, 2026
f8d2555
chore: dedup localActions
EstebanRomero84 Mar 10, 2026
bf3e742
fix: sort version choices descending so latest appears first
marcelinollano Mar 10, 2026
7dea3e4
fix: add guard for empty available versions and unit tests
marcelinollano Mar 10, 2026
1f1d511
chore: handle empty local actions
EstebanRomero84 Mar 11, 2026
f9c8cf1
test: update NUT to test local assets logic
EstebanRomero84 Mar 11, 2026
9419bf2
test: fix NUT assertion
WillieRuemmele Mar 11, 2026
c046353
test: fix NUT
EstebanRomero84 Mar 11, 2026
ff155c5
test: add unit tests
EstebanRomero84 Mar 11, 2026
6327eb5
Merge pull request #348 from salesforcecli/wr/activateVersion
marcelinollano Mar 11, 2026
5efe4be
chore(release): 1.32.1 [skip ci]
svc-cli-bot Mar 11, 2026
29949a3
fix: small tweak to "agent generate template" help
jshackell-sfdc Mar 12, 2026
db44817
Merge pull request #359 from salesforcecli/js/edit-messages
jshackell-sfdc Mar 12, 2026
d2561b6
chore: merge main
shetzel Mar 13, 2026
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
37 changes: 37 additions & 0 deletions .cursor/skills/agent-pr-review/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
name: agent-pr-review
description: Review pull requests in plugin-agent using GitHub CLI. Use for "review PR", "code review", or "gh pr view".
---

# Agent PR Review (plugin-agent)

## Required

- `gh` CLI required (no git-only fallback)

## Working directory

- repo root (parent of this `.cursor`)

## Commands

- `gh pr view <PR_NUMBER> --json title,number,body,files,commits,additions,deletions,changedFiles,baseRefName,headRefName,author,labels`
- `gh pr diff <PR_NUMBER>`

## Review checklist

- correctness, security, regressions
- error handling, edge cases
- tests cover changes or note gaps
- input validation, API misuse
- command messages have entries in messages dir
- errors not swallowed; rethrown errors set original as cause
- suggest code reuse
- suggest output improvements for agent use (esp. `--json`)

## Output format

- Findings first, severity order (Critical → High → Medium → Low)
- cite files/snippets
- Questions/Assumptions if needed
- Summary last, brief
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## [1.32.1](https://github.com/salesforcecli/plugin-agent/compare/1.32.0...1.32.1) (2026-03-11)

### Bug Fixes

- add --version flag to agent activate/deactivate ([af07c24](https://github.com/salesforcecli/plugin-agent/commit/af07c242b57b3265dc686e19e421715f4ac84684))
- add guard for empty available versions and unit tests ([7dea3e4](https://github.com/salesforcecli/plugin-agent/commit/7dea3e488162f2ae90ad68944f900524ee871f17))
- deactivate only one version anywyays ([4fe0098](https://github.com/salesforcecli/plugin-agent/commit/4fe0098c24a9bce63ff10b37b740cd6a846936c5))
- edit ([c165ee9](https://github.com/salesforcecli/plugin-agent/commit/c165ee9f9bbf72c737ee9949bc93983d5e28e86c))
- sort version choices descending so latest appears first ([bf3e742](https://github.com/salesforcecli/plugin-agent/commit/bf3e7423e939a5b41bf8f2dedd2619b356316ade))
- usability, errors, tests ([a6dd2a7](https://github.com/salesforcecli/plugin-agent/commit/a6dd2a7109ffbecd46d618c77f70014c59fc4dc3))

# [1.32.0](https://github.com/salesforcecli/plugin-agent/compare/1.31.3...1.32.0) (2026-03-09)

### Features

- add comprehensive contextVariables validation, tests, and documentation ([2f27bed](https://github.com/salesforcecli/plugin-agent/commit/2f27bedb7aae05ca2254f2b18f63c8d4d073dc26))
- **run-eval:** whitelist state/setupSessionContext, translate contextVariables, preserve outputs ([610c1e9](https://github.com/salesforcecli/plugin-agent/commit/610c1e93be3e64c89f6f7b91b71ecf9176bacc91))

## [1.31.3](https://github.com/salesforcecli/plugin-agent/compare/1.31.2...1.31.3) (2026-03-08)

### Bug Fixes
Expand Down
77 changes: 46 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,17 @@ Activate an agent in an org.

```
USAGE
$ sf agent activate -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-n <value>]
$ sf agent activate -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-n <value>] [--version
<value>]
FLAGS
-n, --api-name=<value> API name of the agent to activate.
-n, --api-name=<value> API name of the agent to activate; if not specified, the command provides a list that you
choose from.
-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
--version=<value> Version number of the agent to activate; if not specified, the command provides a list that
you choose from.
GLOBAL FLAGS
--flags-dir=<value> Import flag values from a directory.
Expand All @@ -100,23 +104,29 @@ GLOBAL FLAGS
DESCRIPTION
Activate an agent in an org.
Activating an agent makes it immediately available to your users. An agent must be active before you can preview it
with the "agent preview" CLI command or VS Code.
Activating an agent makes it immediately available to your users. A published agent must be active before you can
preview it with the "agent preview" CLI command or VS Code. Agents can have multiple versions; only one version can be
active at a time.
You must know the agent's API name to activate it; you can either be prompted for it or you can specify it with the
--api-name flag. Find the agent's API name in its Agent Details page of your org's Agentforce Studio UI in Setup.
If you run the command without the --api-name or --version flags, the command provides a list of agent API names and
versions for you to choose from. Use the flags to specify the exact agent and version without being prompted. If you
use the --json flag and not --version, then the latest agent version is automatically activated.
The value of the --version flag is always a number, corresponding to the "vX" part of the "BotVersion" metadata in
your project. For example, if you have a force-app/main/default/bots/My_Agent/v4.botVersion-meta.xml file in your
project, then you activate this version with the "--version 4" flag.
EXAMPLES
Activate an agent in your default target org by being prompted:
Activate an agent in your default target org by being prompted for both its API name and version:
$ sf agent activate
Activate an agent with API name Resort_Manager in the org with alias "my-org":
Activate version 2 of an agent with API name Resort_Manager in the org with alias "my-org":
$ sf agent activate --api-name Resort_Manager --target-org my-org
$ sf agent activate --api-name Resort_Manager --version 2 --target-org my-org
```

_See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/activate.ts)_
_See code: [src/commands/agent/activate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/activate.ts)_

## `sf agent create`

Expand Down Expand Up @@ -183,7 +193,7 @@ EXAMPLES
$ sf agent create --name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview
```

_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/create.ts)_
_See code: [src/commands/agent/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/create.ts)_

## `sf agent deactivate`

Expand All @@ -194,7 +204,8 @@ USAGE
$ sf agent deactivate -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [-n <value>]
FLAGS
-n, --api-name=<value> API name of the agent to deactivate.
-n, --api-name=<value> API name of the agent to deactivate; if not specified, the command provides a list that you
choose from.
-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
Expand All @@ -210,8 +221,8 @@ DESCRIPTION
topics or actions, you must deactivate it. You can't preview an agent with the "agent preview" CLI command or VS Code
if it's deactivated.
You must know the agent's API name to deactivate it; you can either be prompted for it or you can specify it with the
--api-name flag. Find the agent's API name in its Agent Details page of your org's Agentforce Studio UI in Setup.
If you run the command without the --api-name flag, the command provides a list of agent API names for you to choose
from. Use the flag to specify the exact agent without being prompted.
EXAMPLES
Deactivate an agent in your default target org by being prompted:
Expand All @@ -223,7 +234,7 @@ EXAMPLES
$ sf agent deactivate --api-name Resort_Manager --target-org my-org
```

_See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/deactivate.ts)_
_See code: [src/commands/agent/deactivate.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/deactivate.ts)_

## `sf agent generate agent-spec`

Expand Down Expand Up @@ -330,7 +341,7 @@ EXAMPLES
$ sf agent generate agent-spec --tone formal --agent-user resortmanager@myorg.com
```

_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/generate/agent-spec.ts)_
_See code: [src/commands/agent/generate/agent-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/generate/agent-spec.ts)_

## `sf agent generate authoring-bundle`

Expand Down Expand Up @@ -407,7 +418,7 @@ EXAMPLES
other-package-dir/main/default --target-org my-dev-org
```

_See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/generate/authoring-bundle.ts)_
_See code: [src/commands/agent/generate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/generate/authoring-bundle.ts)_

## `sf agent generate template`

Expand Down Expand Up @@ -455,7 +466,7 @@ EXAMPLES
force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1
```

_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/generate/template.ts)_
_See code: [src/commands/agent/generate/template.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/generate/template.ts)_

## `sf agent generate test-spec`

Expand Down Expand Up @@ -494,6 +505,10 @@ DESCRIPTION
- (Optional) Conversation history: Boilerplate for additional context you can add to the test in the form of a
conversation history.
You can manually add contextVariables to test cases in the generated YAML file to inject contextual data (such as
CaseId or RoutableId) into agent sessions. This is useful for testing agent behavior with different contextual
information.
When your test spec is ready, you then run the "agent test create" command to actually create the test in your org and
synchronize the metadata with your DX project. The metadata type for an agent test is AiEvaluationDefinition.
Expand All @@ -516,7 +531,7 @@ EXAMPLES
force-app//main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml
```

_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/generate/test-spec.ts)_
_See code: [src/commands/agent/generate/test-spec.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/generate/test-spec.ts)_

## `sf agent preview`

Expand Down Expand Up @@ -589,7 +604,7 @@ EXAMPLES
$ sf agent preview --use-live-actions --apex-debug --output-dir transcripts/my-preview
```

_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/preview.ts)_
_See code: [src/commands/agent/preview.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/preview.ts)_

## `sf agent preview end`

Expand Down Expand Up @@ -644,7 +659,7 @@ EXAMPLES
$ sf agent preview end --authoring-bundle My_Local_Agent
```

_See code: [src/commands/agent/preview/end.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/preview/end.ts)_
_See code: [src/commands/agent/preview/end.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/preview/end.ts)_

## `sf agent preview send`

Expand Down Expand Up @@ -702,7 +717,7 @@ EXAMPLES
$ sf agent preview send --utterance "what can you help me with?" --authoring-bundle My_Local_Agent
```

_See code: [src/commands/agent/preview/send.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/preview/send.ts)_
_See code: [src/commands/agent/preview/send.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/preview/send.ts)_

## `sf agent preview sessions`

Expand Down Expand Up @@ -735,7 +750,7 @@ EXAMPLES
$ sf agent preview sessions
```

_See code: [src/commands/agent/preview/sessions.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/preview/sessions.ts)_
_See code: [src/commands/agent/preview/sessions.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/preview/sessions.ts)_

## `sf agent preview start`

Expand Down Expand Up @@ -792,7 +807,7 @@ EXAMPLES
$ sf agent preview start --api-name My_Published_Agent
```

_See code: [src/commands/agent/preview/start.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/preview/start.ts)_
_See code: [src/commands/agent/preview/start.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/preview/start.ts)_

## `sf agent publish authoring-bundle`

Expand Down Expand Up @@ -841,7 +856,7 @@ EXAMPLES
$ sf agent publish authoring-bundle --api-name MyAuthoringbundle --target-org my-dev-org
```

_See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/publish/authoring-bundle.ts)_
_See code: [src/commands/agent/publish/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/publish/authoring-bundle.ts)_

## `sf agent test create`

Expand Down Expand Up @@ -896,7 +911,7 @@ EXAMPLES
$ sf agent test create --spec specs/Resort_Manager-testSpec.yaml --api-name Resort_Manager_Test --preview
```

_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/test/create.ts)_
_See code: [src/commands/agent/test/create.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/test/create.ts)_

## `sf agent test list`

Expand Down Expand Up @@ -931,7 +946,7 @@ EXAMPLES
$ sf agent test list --target-org my-org
```

_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/test/list.ts)_
_See code: [src/commands/agent/test/list.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/test/list.ts)_

## `sf agent test results`

Expand Down Expand Up @@ -997,7 +1012,7 @@ FLAG DESCRIPTIONS
expression when using custom evaluations.
```

_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/test/results.ts)_
_See code: [src/commands/agent/test/results.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/test/results.ts)_

## `sf agent test resume`

Expand Down Expand Up @@ -1070,7 +1085,7 @@ FLAG DESCRIPTIONS
expression when using custom evaluations.
```

_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/test/resume.ts)_
_See code: [src/commands/agent/test/resume.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/test/resume.ts)_

## `sf agent test run`

Expand Down Expand Up @@ -1144,7 +1159,7 @@ FLAG DESCRIPTIONS
expression when using custom evaluations.
```

_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/test/run.ts)_
_See code: [src/commands/agent/test/run.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/test/run.ts)_

## `sf agent validate authoring-bundle`

Expand Down Expand Up @@ -1191,6 +1206,6 @@ EXAMPLES
$ sf agent validate authoring-bundle --api-name MyAuthoringBundle --target-org my-dev-org
```

_See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.31.3/src/commands/agent/validate/authoring-bundle.ts)_
_See code: [src/commands/agent/validate/authoring-bundle.ts](https://github.com/salesforcecli/plugin-agent/blob/1.32.1/src/commands/agent/validate/authoring-bundle.ts)_

<!-- commandsstop -->
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:activate",
"flagAliases": [],
"flagChars": ["n", "o"],
"flags": ["api-name", "api-version", "flags-dir", "json", "target-org"],
"flags": ["api-name", "api-version", "flags-dir", "json", "target-org", "version"],
"plugin": "@salesforce/plugin-agent"
},
{
Expand Down
18 changes: 12 additions & 6 deletions messages/agent.activate.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,29 @@ Activate an agent in an org.

# description

Activating an agent makes it immediately available to your users. An agent must be active before you can preview it with the "agent preview" CLI command or VS Code.
Activating an agent makes it immediately available to your users. A published agent must be active before you can preview it with the "agent preview" CLI command or VS Code. Agents can have multiple versions; only one version can be active at a time.

You must know the agent's API name to activate it; you can either be prompted for it or you can specify it with the --api-name flag. Find the agent's API name in its Agent Details page of your org's Agentforce Studio UI in Setup.
If you run the command without the --api-name or --version flags, the command provides a list of agent API names and versions for you to choose from. Use the flags to specify the exact agent and version without being prompted. If you use the --json flag and not --version, then the latest agent version is automatically activated.

The value of the --version flag is always a number, corresponding to the "vX" part of the "BotVersion" metadata in your project. For example, if you have a force-app/main/default/bots/My_Agent/v4.botVersion-meta.xml file in your project, then you activate this version with the "--version 4" flag.

# examples

- Activate an agent in your default target org by being prompted:
- Activate an agent in your default target org by being prompted for both its API name and version:

<%= config.bin %> <%= command.id %>

- Activate an agent with API name Resort_Manager in the org with alias "my-org":
- Activate version 2 of an agent with API name Resort_Manager in the org with alias "my-org":

<%= config.bin %> <%= command.id %> --api-name Resort_Manager --target-org my-org
<%= config.bin %> <%= command.id %> --api-name Resort_Manager --version 2 --target-org my-org

# flags.api-name.summary

API name of the agent to activate.
API name of the agent to activate; if not specified, the command provides a list that you choose from.

# flags.version.summary

Version number of the agent to activate; if not specified, the command provides a list that you choose from.

# error.missingRequiredFlags

Expand Down
4 changes: 4 additions & 0 deletions messages/agent.activation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ Agent %s has been deleted and can't be activated.
# error.agentIsDefault

Agent %s is the default Agentforce agent in your org and you can't change its activation status.

# error.noVersionsAvailable

No versions available to %s. All versions are already in the target state.
4 changes: 2 additions & 2 deletions messages/agent.deactivate.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Deactivate an agent in an org.

Deactivating an agent makes it unavailable to your users. To make changes to an agent, such as adding or removing topics or actions, you must deactivate it. You can't preview an agent with the "agent preview" CLI command or VS Code if it's deactivated.

You must know the agent's API name to deactivate it; you can either be prompted for it or you can specify it with the --api-name flag. Find the agent's API name in its Agent Details page of your org's Agentforce Studio UI in Setup.
If you run the command without the --api-name flag, the command provides a list of agent API names for you to choose from. Use the flag to specify the exact agent without being prompted.

# examples

Expand All @@ -20,7 +20,7 @@ You must know the agent's API name to deactivate it; you can either be prompted

# flags.api-name.summary

API name of the agent to deactivate.
API name of the agent to deactivate; if not specified, the command provides a list that you choose from.

# error.missingRequiredFlags

Expand Down
Loading
Loading