agent activate

Activate an agent in an org.

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.

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.

Flag Name (Long)Flag Name (Short)Description
‑‑api‑name‑nType: Value

API name of the agent to activate; if not specified, the command provides a list that you choose from.
‑‑api‑versionN/AType: Value

Override the api version used for api requests made by this command
‑‑flags‑dirN/AType: Value

Import flag values from a directory.
‑‑jsonN/AType: Boolean

Format output as json.
‑‑target‑org‑oType: Value
Required

Username or alias of the target org. Not required if the target-org configuration variable is already set.
‑‑versionN/AType: Value

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

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

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