npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@salesforce/plugin-agent

v2.0.0

Published

Commands to interact with Salesforce agents

Downloads

1,656,539

Readme

plugin-agent

NPM Downloads/week License

Install

sf plugins install @salesforce/[email protected]

Contributing

  1. Please read our Code of Conduct
  2. 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.
  3. Fork this repository.
  4. Build the plugin locally
  5. Create a topic branch in your fork. Note, this step is recommended but technically not required if contributing using a fork.
  6. Edit the code in your fork.
  7. 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.
  8. Sign CLA (see CLA below).
  9. Send us a pull request when you are done. We'll review your code, suggest any needed changes, and merge it in.

CLA

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.

Build

To build the plugin locally, make sure to have yarn installed and run the following commands:

# Clone the repository
git clone [email protected]: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

Commands

sf agent activate

Activate an agent in an org.

USAGE
  $ 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; 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.
  --json               Format output as json.

DESCRIPTION
  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.

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

    $ sf agent activate

  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 --version 2 --target-org my-org

See code: src/commands/agent/activate.ts

sf agent adl create

Create an Agentforce Data Library.

USAGE
  $ sf agent adl create -o <value> -n <value> --developer-name <value> --source-type sfdrive|knowledge|retriever
    [--json] [--flags-dir <value>] [--api-version <value>] [--description <value>] [--index-mode basic|enhanced]
    [--retriever-id <value>] [--primary-index-field1 <value>] [--primary-index-field2 <value>] [--content-fields
    <value>] [--data-category-ids <value>] [--data-category-names <value>] [-w <value>]

FLAGS
  -n, --name=<value>                  (required) Display name for the data library (max 80 characters).
  -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>                  Wait N minutes for indexing to complete (KNOWLEDGE libraries). SFDRIVE libraries
                                      require upload before indexing; RETRIEVER libraries are ready immediately.
      --api-version=<value>           Override the api version used for api requests made by this command
      --content-fields=<value>        Comma-separated list of content fields for KNOWLEDGE libraries (optional, mutable
                                      after creation).
      --data-category-ids=<value>     Comma-separated list of data category selection IDs for KNOWLEDGE libraries.
                                      Mutually exclusive with --data-category-names (provide one or the other, not
                                      both).
      --data-category-names=<value>   Comma-separated list of data category names in qualified format (e.g.,
                                      "Group_API_Name.Category"). Mutually exclusive with --data-category-ids (provide
                                      one or the other, not both).
      --description=<value>           Description of the data library (max 255 characters).
      --developer-name=<value>        (required) API name for the data library (max 80 characters, alphanumeric and
                                      underscores only, must start with a letter).
      --index-mode=<option>           Index mode for SFDRIVE libraries: basic or enhanced.
                                      <options: basic|enhanced>
      --primary-index-field1=<value>  Primary index field 1 for KNOWLEDGE libraries (required, immutable after
                                      creation).
      --primary-index-field2=<value>  Primary index field 2 for KNOWLEDGE libraries (required, immutable after
                                      creation).
      --retriever-id=<value>          ID of an active Custom Retriever (required for RETRIEVER source type; retriever
                                      must be active).
      --source-type=<option>          (required) Type of grounding source: sfdrive (file upload), knowledge (Salesforce
                                      Knowledge articles), or retriever (existing active Custom Retriever).
                                      <options: sfdrive|knowledge|retriever>

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Create an Agentforce Data Library.

  Creates a new data library in the target org. The --source-type flag determines the type of library: SFDRIVE (file
  upload), KNOWLEDGE (Salesforce Knowledge articles), or RETRIEVER (existing active Custom Retriever).

  For SFDRIVE libraries, creation provisions the full Data Cloud pipeline (DLO → DMO → SearchIndex → Retriever). Upload
  files with `sf agent adl upload` after creation.

EXAMPLES
  Create an SFDRIVE library:

    $ sf agent adl create --target-org myOrg --name "My Docs" --developer-name My_Docs --source-type sfdrive

  Create a KNOWLEDGE library with index fields:

    $ sf agent adl create --target-org myOrg --name "KB Library" --developer-name KB_Library --source-type knowledge \
      --primary-index-field1 Title --primary-index-field2 Summary

  Create a RETRIEVER library:

    $ sf agent adl create --target-org myOrg --name "Existing Retriever" --developer-name Existing_Retriever \
      --source-type retriever --retriever-id 0ppXX0000000001

See code: src/commands/agent/adl/create.ts

sf agent adl delete

Delete an Agentforce Data Library.

USAGE
  $ sf agent adl delete -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>]

FLAGS
  -i, --library-id=<value>   (required) Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
  -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
  Delete an Agentforce Data Library.

  Permanently deletes a data library and all associated files and indexing data.

EXAMPLES
  Delete a data library:

    $ sf agent adl delete --library-id 1JDSG000007IbWX4A0 --target-org myOrg

See code: src/commands/agent/adl/delete.ts

sf agent adl file add

Add files to an existing Agentforce Data Library.

USAGE
  $ sf agent adl file add -o <value> -i <value> -f <value>... [--json] [--flags-dir <value>] [--api-version <value>]

FLAGS
  -f, --path=<value>...      (required) Path to file(s) to add. Specify multiple times for batch upload.
  -i, --library-id=<value>   (required) Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
  -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
  Add files to an existing Agentforce Data Library.

  Adds one or more files to an existing SFDRIVE data library and triggers SearchIndex re-hydration. This is the day-2
  operation for adding files to an already-provisioned library.

  Adds files to an existing READY library. Unlike `sf agent adl upload`, this does NOT create new downstream Data Cloud
  assets — it appends files to the existing SearchIndex and triggers re-indexing.

  Constraints: at least 1 file required, no duplicate file names in a batch, maximum 1000 files per library.

EXAMPLES
  Add a file to an existing library:

    $ sf agent adl file add -i 1JDSG000007IbWX4A0 --path ./docs/new-guide.pdf --target-org myOrg

  Add multiple files:

    $ sf agent adl file add -i 1JDSG000007IbWX4A0 --path ./docs/guide.pdf --path ./docs/faq.txt --target-org myOrg

See code: src/commands/agent/adl/file/add.ts

sf agent adl file delete

Delete a file from an Agentforce Data Library.

USAGE
  $ sf agent adl file delete -o <value> -i <value> --file-id <value> [--json] [--flags-dir <value>] [--api-version
  <value>]

FLAGS
  -i, --library-id=<value>   (required) Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
  -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
      --file-id=<value>      (required) ID of the file to delete (AiGroundingFileRef record ID).

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Delete a file from an Agentforce Data Library.

  Permanently removes a file from an SFDRIVE data library and triggers re-indexing of the search index.

EXAMPLES
  Delete a file from a data library:

    $ sf agent adl file delete --library-id 1JDSG000007IbWX4A0 --file-id a1B2C3D4E5F6G7H8I9 --target-org myOrg

See code: src/commands/agent/adl/file/delete.ts

sf agent adl file list

List files in an Agentforce Data Library.

USAGE
  $ sf agent adl file list -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>] [--page-size
    <value>] [--offset <value>] [--status uploaded|indexing|indexed|index_failed|deleting|delete_failed]

FLAGS
  -i, --library-id=<value>   (required) Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
  -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
      --offset=<value>       Number of files to skip before returning results (for pagination).
      --page-size=<value>    [default: 50] Number of files to return per page (1-200, default 50).
      --status=<option>      Filter files by indexing status.
                             <options: uploaded|indexing|indexed|index_failed|deleting|delete_failed>

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  List files in an Agentforce Data Library.

  Returns the list of files in an SFDRIVE library including file name, size, and creation date.

EXAMPLES
  List files in a data library:

    $ sf agent adl file list --library-id 1JDSG000007IbWX4A0 --target-org myOrg

  List files and output as JSON:

    $ sf agent adl file list --library-id 1JDSG000007IbWX4A0 --target-org myOrg --json

See code: src/commands/agent/adl/file/list.ts

sf agent adl get

Get details of an Agentforce Data Library.

USAGE
  $ sf agent adl get -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>]

FLAGS
  -i, --library-id=<value>   (required) Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
  -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
  Get details of an Agentforce Data Library.

  Returns the full detail of a data library including its grounding source configuration, status, and retriever ID.

EXAMPLES
  Get details of a data library:

    $ sf agent adl get --library-id 1JDSG000007IbWX4A0 --target-org myOrg

See code: src/commands/agent/adl/get.ts

sf agent adl list

List Agentforce Data Libraries in an org.

USAGE
  $ sf agent adl list -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [--source-type
    sfdrive|knowledge|retriever]

FLAGS
  -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
      --source-type=<option>  Filter by source type: sfdrive, knowledge, or retriever.
                              <options: sfdrive|knowledge|retriever>

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  List Agentforce Data Libraries in an org.

  Returns all data libraries in the target org, including their source type, status, and library ID.

EXAMPLES
  List all data libraries in the default target org:

    $ sf agent adl list --target-org myOrg

  List data libraries and output as JSON:

    $ sf agent adl list --target-org myOrg --json

See code: src/commands/agent/adl/list.ts

sf agent adl status

Get indexing status of an Agentforce Data Library.

USAGE
  $ sf agent adl status -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>]
    [--include-artifacts]

FLAGS
  -i, --library-id=<value>   (required) Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
  -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
      --include-artifacts    Resolve DC asset artifacts (DataStream, DLO, DMO, SearchIndex, Retriever) with entity IDs
                             and names on each stage. Slower — requires additional queries.

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Get indexing status of an Agentforce Data Library.

  Returns the current indexing status including stage details (DATA_STREAM, DATA_LAKE_OBJECT, DATA_MODEL_OBJECT,
  SEARCH_INDEX, RETRIEVER) and any errors.

EXAMPLES
  Get status of a data library:

    $ sf agent adl status --library-id 1JDSG000007IbWX4A0 --target-org myOrg

See code: src/commands/agent/adl/status.ts

sf agent adl update

Update an Agentforce Data Library.

USAGE
  $ sf agent adl update -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>] [-n <value>]
    [--description <value>] [--content-fields <value>] [--restrict-to-public-articles] [--data-category-rule]
    [--retriever-id <value>]

FLAGS
  -i, --library-id=<value>                (required) Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
  -n, --name=<value>                      New display name for the data library (max 80 characters).
  -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
      --content-fields=<value>            Comma-separated list of content fields for KNOWLEDGE libraries (triggers
                                          re-indexing).
      --[no-]data-category-rule           Enable or disable data category filtering for KNOWLEDGE libraries. Use
                                          --no-data-category-rule to disable.
      --description=<value>               New description for the data library (max 255 characters).
      --[no-]restrict-to-public-articles  Restrict to public Knowledge articles only (KNOWLEDGE libraries, triggers
                                          re-indexing).
      --retriever-id=<value>              Swap the retriever for a RETRIEVER library (must be an active Custom Retriever
                                          ID).

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Update an Agentforce Data Library.

  Updates the label, description, or other mutable properties of an existing data library.

EXAMPLES
  Update the label of a data library:

    $ sf agent adl update --library-id 1JDSG000007IbWX4A0 --name "New Name" --target-org myOrg

  Update the description:

    $ sf agent adl update --library-id 1JDSG000007IbWX4A0 --description "Updated description" --target-org myOrg

  Update Knowledge library content fields (triggers re-indexing):

    $ sf agent adl update --library-id 1JDSG000007IbWX4A0 --content-fields "Answer**c,Summary**c" --target-org myOrg

  Restrict Knowledge library to public articles:

    $ sf agent adl update --library-id 1JDSG000007IbWX4A0 --restrict-to-public-articles --target-org myOrg

See code: src/commands/agent/adl/update.ts

sf agent adl upload

Upload a file to an SFDRIVE Agentforce Data Library.

USAGE
  $ sf agent adl upload -o <value> -i <value> -f <value>... [--json] [--flags-dir <value>] [--api-version <value>] [-w
    <value>]

FLAGS
  -f, --file=<value>...      (required) Path to the file to upload.
  -i, --library-id=<value>   (required) Agentforce Data Library ID (18-char Salesforce ID with prefix 1JD).
  -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 indexing to complete. If not specified, returns after
                             triggering indexing.
      --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
  Upload a file to an SFDRIVE Agentforce Data Library.

  Performs the multi-step upload workflow: checks upload readiness, obtains a pre-signed S3 URL, uploads the file,
  triggers indexing, and optionally polls until the library is ready (retrieverId is populated).

  Upload triggers the full Data Cloud provisioning pipeline, creating all downstream assets (DLO, DMO, SearchIndex,
  Retriever). Use `sf agent adl status` to monitor progress. For adding files to an already-provisioned library, use `sf
  agent adl file add` instead.

  This command only works with SFDRIVE libraries. KNOWLEDGE libraries index automatically after creation, and RETRIEVER
  libraries require no file upload.

EXAMPLES
  Upload a file and wait for indexing to complete:

    $ sf agent adl upload --library-id 1JDSG000007IbWX4A0 --file ./docs/guide.pdf --target-org myOrg --wait 10

  Upload a file without waiting:

    $ sf agent adl upload --library-id 1JDSG000007IbWX4A0 --file ./docs/guide.pdf --target-org myOrg

See code: src/commands/agent/adl/upload.ts

sf agent create

Create an agent in your org using a local agent spec file.

USAGE
  $ sf agent create -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [--name <value>] [--api-name
    <value>] [--spec <value>] [--preview]

FLAGS
  -o, --target-org=<value>   (required) Username or alias of the target org. Not required if the `target-org`
                             configuration variable is already set.
      --api-name=<value>     API name of the new agent; if not specified, the API name is derived from the agent name
                             (label); the API name must not exist in the org.
      --api-version=<value>  Override the api version used for api requests made by this command
      --name=<value>         Name (label) of the new agent.
      --preview              Preview the agent without saving it in your org.
      --spec=<value>         Path to an agent spec file.

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Create an agent in your org using a local agent spec file.

  NOTE: This command creates an agent that doesn't use Agent Script as its blueprint. We generally don't recommend you
  use this workflow to create an agent. Rather, use the "agent generate|validate|publish authoring-bundle" commands to
  author agents that use the Agent Script language. See "Author an Agent"
  (https://developer.salesforce.com/docs/einstein/genai/guide/agent-dx-nga-author-agent.html) for details.

  To run this command, you must have an agent spec file, which is a YAML file that define the agent properties and
  contains a list of AI-generated topics. Topics define the range of jobs the agent can handle. Use the "agent generate
  agent-spec" CLI command to generate an agent spec file. Then specify the file to this command using the --spec flag,
  along with the name (label) of the new agent with the --name flag. If you don't specify any of the required flags, the
  command prompts you.

  When this command completes, your org contains the new agent, which you can then edit and customize in the Agent
  Builder UI. The new agent's topics are the same as the ones listed in the agent spec file. The agent might also have
  some AI-generated actions, or you can add them. This command also retrieves all the metadata files associated with the
  new agent to your local Salesforce DX project.

  Use the --preview flag to review what the agent looks like without actually saving it in your org. When previewing,
  the command creates a JSON file in the current directory with all the agent details. The name of the JSON file is the
  agent's API name and a timestamp.

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

EXAMPLES
  Create an agent by being prompted for the required information, such as the agent spec file and agent name, and then
  create it in your default org:

    $ sf agent create

  Create an agent by specifying the agent name, API name, and spec file with flags; use the org with alias "my-org";
  the command fails if the API name is already being used in your org:

    $ sf agent create --name "Resort Manager" --api-name Resort_Manager --spec specs/resortManagerAgent.yaml \
      --target-org my-org

  Preview the creation of an agent named "Resort Manager" and use your default org:

    $ sf agent create --name "Resort Manager" --spec specs/resortManagerAgent.yaml --preview

See code: src/commands/agent/create.ts

sf agent deactivate

Deactivate an agent in an org.

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; 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

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  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.

  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:

    $ sf agent deactivate

  Deactivate the agent Resort_Manager in the org with alias "my_org":

    $ sf agent deactivate --api-name Resort_Manager --target-org my-org

See code: src/commands/agent/deactivate.ts

sf agent generate agent-spec

Generate an agent spec, which is a YAML file that captures what an agent can do.

USAGE
  $ sf agent generate agent-spec -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [--type customer|internal]
    [--role <value>] [--company-name <value>] [--company-description <value>] [--company-website <value>] [--max-topics
    <value>] [--agent-user <value>] [--enrich-logs true|false] [--tone formal|casual|neutral] [--spec <value>]
    [--output-file <value>] [--full-interview] [--grounding-context <value> --prompt-template <value>]
    [--force-overwrite]

FLAGS
  -o, --target-org=<value>           (required) Username or alias of the target org. Not required if the `target-org`
                                     configuration variable is already set.
      --agent-user=<value>           Username of a user in your org to assign to your agent; determines what your agent
                                     can access and do.
      --api-version=<value>          Override the api version used for api requests made by this command
      --company-description=<value>  Description of your company.
      --company-name=<value>         Name of your company.
      --company-website=<value>      Website URL of your company.
      --enrich-logs=<option>         Adds agent conversation data to event logs so you can view all agent session
                                     activity in one place.
                                     <options: true|false>
      --force-overwrite              Don't prompt the user to confirm that an existing spec file will be overwritten.
      --full-interview               Prompt for both required and optional flags.
      --grounding-context=<value>    Context information and personalization that's added to your prompts when using a
                                     custom prompt template.
      --max-topics=<value>           Maximum number of topics to generate in the agent spec; default is 5.
      --output-file=<value>          [default: specs/agentSpec.yaml] Path for the generated YAML agent spec file; can be
                                     an absolute or relative path.
      --prompt-template=<value>      API name of a customized prompt template to use instead of the default prompt
                                     template.
      --role=<value>                 Role of the agent.
      --spec=<value>                 Agent spec file, in YAML format, to use as input to the command.
      --tone=<option>                Conversational style of the agent, such as how it expresses your brand personality
                                     in its messages through word choice, punctuation, and sentence structure.
                                     <options: formal|casual|neutral>
      --type=<option>                Type of agent to create. Internal types are copilots used internally by your
                                     company and customer types are the agents you create for your customers.
                                     <options: customer|internal>

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Generate an agent spec, which is a YAML file that captures what an agent can do.

  An agent spec is a YAML-formatted file that contains basic information about the agent, such as its role, company
  description, and an AI-generated list of topics based on this information. Topics define the range of jobs your agent
  can handle.

  Use flags, such as --role and --company-description, to provide details about your company and the role that the agent
  plays in your company. If you prefer, you can also be prompted for the basic information; use --full-interview to be
  prompted for all required and optional properties. Upon command execution, the large language model (LLM) associated
  with your org uses the provided information to generate a list of topics for the agent. Because the LLM uses the
  company and role information to generate the topics, we recommend that you provide accurate, complete, and specific
  details so the LLM generates the best and most relevant topics. Once generated, you can edit the spec file; for
  example, you can remove topics that don't apply or change a topic's description.

  You can also iterate the spec generation process by using the --spec flag to pass an existing agent spec file to this
  command, and then using the --role, --company-description, etc, flags to refine your agent properties. Iteratively
  improving the description of your agent allows the LLM to generate progressively better topics.

  You can also specify other agent properties, such as a custom prompt template, how to ground the prompt template to
  add context to the agent's prompts, the tone of the prompts, and the username of a user in the org to assign to the
  agent.

  When your agent spec is ready, generate an authoring bundle from it by passing the spec file to the --spec flag of the
  "agent generate authoring-bundle" CLI command. An authoring bundle is a metadata type that contains an Agent Script
  file, which is the blueprint for an agent. (While not recommended, you can also use the agent spec file to immediately
  create an agent with the "agent create" command. We don't recommend this workflow because these types of agents don't
  use Agent Script, and are thus less flexible and more difficult to maintain.)

EXAMPLES
  Generate an agent spec in the default location and use flags to specify the agent properties, such as its role and
  your company details; use your default org:

    $ sf agent generate agent-spec --type customer --role "Field customer complaints and manage employee schedules." \
      --company-name "Coral Cloud Resorts" --company-description "Provide customers with exceptional destination \
      activities, unforgettable experiences, and reservation services."

  Generate an agent spec by being prompted for the required agent properties and generate a maxiumum of 5 topics;
  write the generated file to the "specs/resortManagerSpec.yaml" file and use the org with alias "my-org":

    $ sf agent generate agent-spec --max-topics 5 --output-file specs/resortManagerAgent.yaml --target-org my-org

  Be prompted for all required and optional agent properties; use your default org:

    $ sf agent generate agent-spec --full-interview

  Specify an existing agent spec file called "specs/resortManagerAgent.yaml", and then overwrite it with a new version
  that contains newly AI-generated topics based on the updated role information passed in with the --role flag:

    $ sf agent generate agent-spec --spec specs/resortManagerAgent.yaml --output-file specs/resortManagerAgent.yaml \
      --role "Field customer complaints, manage employee schedules, and ensure all resort operations are running \
      smoothly"

  Specify that the conversational tone of the agent is formal and to attach the "[email protected]" username to
  it; be prompted for the required properties and use your default org:

    $ sf agent generate agent-spec --tone formal --agent-user [email protected]

See code: src/commands/agent/generate/agent-spec.ts

sf agent generate authoring-bundle

Generate an authoring bundle from an existing agent spec YAML file.

USAGE
  $ sf agent generate authoring-bundle -o <value> [--json] [--flags-dir <value>] [--api-name <value>] [--api-version <value>] [-f
    <value>] [--no-spec] [-d <value>] [-n <value>] [--force-overwrite]

FLAGS
  -d, --output-dir=<value>   Directory where the authoring bundle files are generated.
  -f, --spec=<value>         Path to the agent spec YAML file. If you don't specify the flag, the command provides a
                             list that you can choose from. Use the --no-spec flag to skip using an agent spec entirely.
  -n, --name=<value>         Name (label) of the authoring bundle; if not specified, you're prompted for the name.
  -o, --target-org=<value>   (required) Username or alias of the target org. Not required if the `target-org`
                             configuration variable is already set.
      --api-name=<value>     API name of the new authoring bundle; if not specified, the API name is derived from the
                             authoring bundle name (label); the API name can't exist in the org.
      --api-version=<value>  Override the api version used for api requests made by this command
      --force-overwrite      Overwrite the existing authoring bundle if one with the same API name already exists
                             locally.
      --no-spec              Skip prompting for an agent spec and use the default Agent Script boilerplate in the
                             generated authoring bundle.

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Generate an authoring bundle from an existing agent spec YAML file.

  Authoring bundles are metadata components that contain an agent's Agent Script file. The Agent Script file is the
  agent's blueprint; it fully describes what the agent can do using the Agent Script language.

  Use this command to generate a new authoring bundle based on an agent spec YAML file, which you create with the "agent
  generate agent-spec" command. The agent spec YAML file is a high-level description of the agent; it describes its
  essence rather than exactly what it can do. The resulting Agent Script file is customized to reflect what's in the
  agent spec file. You can also create an authoring bundle without an agent spec file by specifying the "--no-spec"
  flag; in this case, the resulting Agent Script file is just the default boilerplate.

  The metadata type for authoring bundles is aiAuthoringBundle, which consist of a standard
  "<bundle-api-name>.bundle-meta.xml" metadata file and the Agent Script file (with extension ".agent"). When you run
  this command, the new authoring bundle is generated in the force-app/main/default/aiAuthoringBundles/<bundle-api-name>
  directory. Use the --output-dir flag to generate them elsewhere.

  After you generate the initial authoring bundle, code the Agent Script file so your agent behaves exactly as you want.
  The Agent Script file generated by this command is just a first draft of your agent! Interactively test the agent by
  conversing with it using the "agent preview" command. Then publish the agent to your org with the "agent publish
  authoring-bundle" command.

  This command requires an org because it uses it to access an LLM for generating the Agent Script file.

EXAMPLES
  Generate an authoring bundle by being prompted for all required values, such as the agent spec YAML file, the bundle
  name, and the API name; use your default org:

    $ sf agent generate authoring-bundle

  Generate an authoring bundle without using an agent spec file; give the bundle the label "My Authoring Bundle" and
  use your default org:

    $ sf agent generate authoring-bundle --no-spec --name "My Authoring Bundle"

  Generate an authoring bundle from the "specs/agentSpec.yaml" agent spec YAML file and give it the label "My
  Authoring Bundle"; use your default org:

    $ sf agent generate authoring-bundle --spec specs/agentSpec.yaml --name "My Authoring Bundle"

  Similar to previous example, but generate the authoring bundle files in the "other-package-dir/main/default" package
  directory; use the org with alias "my-dev-org":

    $ sf agent generate authoring-bundle --spec specs/agentSpec.yaml --name "My Authoring Bundle" --output-dir \
      other-package-dir/main/default --target-org my-dev-org

See code: src/commands/agent/generate/authoring-bundle.ts

sf agent generate template

Generate an agent template from an existing agent in your DX project so you can then package the template in a second-generation managed package.

USAGE
  $ sf agent generate template -s <value> --agent-version <value> -f <value> [--json] [--flags-dir <value>] [--api-version
    <value>] [-r <value>]

FLAGS
  -f, --agent-file=<value>     (required) Path to an agent (Bot) metadata file.
  -r, --output-dir=<value>     Directory where the generated BotTemplate and GenAiPlannerBundle files are saved.
  -s, --source-org=<value>     (required) Username or alias of the namespaced scratch org that contains the agent which
                               this template is based on.
      --agent-version=<value>  (required) Version of the agent (BotVersion).
      --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
  Generate an agent template from an existing agent in your DX project so you can then package the template in a
  second-generation managed package.

  WARNING: This command doesn't work for agents that were created from an Agent Script file. In other words, you can't
  currently package an agent template for agents that use Agent Script.

  At a high-level, agents are defined by the Bot, BotVersion, and GenAiPlannerBundle metadata types. The
  GenAiPlannerBundle type in turn defines the agent's topics and actions. This command uses the metadata files for these
  three types, located in your local DX project, to generate a BotTemplate metadata file for a specific agent (Bot). You
  then use the BotTemplate metadata file, along with the GenAiPlannerBundle metadata file that references the
  BotTemplate, to package the template in a managed package that you can share between orgs or on AppExchange.

  Use the --agent-file flag to specify the relative or full pathname of the Bot metadata file, such as
  force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml. A single Bot can have multiple
  BotVersions, so use the --agent-version flag to specify the version. The corresponding BotVersion metadata file must
  exist locally. For example, if you specify "--agent-version 4", then the file
  force-app/main/default/bots/My_Awesome_Agent/v4.botVersion-meta.xml must exist.

  The new BotTemplate metadata file is generated in the "botTemplates" directory in the output directory specified with
  the --output-dir flag, and has the name <Agent_API_name>\_v<Version>\_Template.botTemplate-meta.xml, such as
  my-package/botTemplates/My_Awesome_Agent_v4_Template.botTemplate-meta.xml. The command displays the full pathname of
  the generated files when it completes.

  See "Develop and Package Agent Templates Using Scratch Orgs"
  (https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/dev2gp_package_agent_templates.htm) for
  details about the complete process, which includes using a scratch org to create and test the agent, retrieving the
  agent metadata to your DX project, running this command to create the agent template, and then packaging the template.

EXAMPLES
  Generate an agent template from the My_Awesome_Agent Bot metadata file in your DX project and save the BotTemplate
  and GenAiPlannerBundle to the specified directory; use version 1 of the agent. The agent that the template is based
  on is in the org with alias "my-scratch-org":

    $ sf agent generate template --agent-file \
      force-app/main/default/bots/My_Awesome_Agent/My_Awesome_Agent.bot-meta.xml --agent-version 1 --output-dir \
      my-package --source-org my-scratch-org

See code: src/commands/agent/generate/template.ts

sf agent generate test-spec

Generate an agent test spec, which is a YAML file that lists the test cases for testing a specific agent.

USAGE
  $ sf agent generate test-spec [--flags-dir <value>] [-d <value>] [--force-overwrite] [-f <value>] [--test-runner
    agentforce-studio|testing-center]

FLAGS
  -d, --from-definition=<value>  Filepath to an AiEvaluationDefinition or AiTestingDefinition metadata XML file in your
                                 DX project that you want to convert to a test spec YAML file.
  -f, --output-file=<value>      Name of the generated test spec YAML file. Default value is
                                 "specs/<AGENT_API_NAME>-testSpec.yaml" (legacy) or
                                 "specs/<AGENT_API_NAME>-ngtTestSpec.yaml" (Agentforce Studio).
      --force-overwrite          Don't prompt for confirmation when overwriting an existing test spec YAML file.
      --test-runner=<option>     Explicitly specify which test runner to use (agentforce-studio or testing-center).
                                 <options: agentforce-studio|testing-center>

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.

DESCRIPTION
  Generate an agent test spec, which is a YAML file that lists the test cases for testing a specific agent.

  The first step when using Salesforce CLI to create an agent test in your org is to use this interactive command to
  generate a local YAML-formatted test spec file. The test spec YAML file contains information about the agent being
  tested, such as its API name, and then one or more test cases. This command uses the metadata components in your DX
  project when prompting for information, such as the agent API name; it doesn't look in your org.

  To generate a specific agent test case, this command prompts you for this information; when possible, the command
  provides a list of options for you to choose from:

  - Utterance: Natural language statement, question, or command used to test the agent.
  - Expected topic: API name of the topic you expect the agent to use when responding to the utterance.
  - Expected actions: One or more API names of the expection actions the agent takes.
  - Expected outcome: Natural language description of the outcome you expect.
  - (Optional) Custom evaluation: Test an agent's response for specific strings or numbers.
  - (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` (legacy
  testing-center) or `AiTestingDefinition` (Agentforce Studio / NGT), selected via --test-runner.

  If you have an existing AiEvaluationDefinition or AiTestingDefinition metadata XML file in your DX project, you can
  generate its equivalent YAML test spec file with the --from-definition flag. The runner is inferred from the file
  extension; pass --test-runner to override.

EXAMPLES
  Generate an agent test spec YAML file interactively:

    $ sf agent generate test-spec

  Generate an Agentforce Studio (NGT) test spec YAML file interactively:

    $ sf agent generate test-spec --test-runner agentforce-studio

  Generate an agent test spec YAML file and specify a name for the new file; if the file exists, overwrite it without
  confirmation:

    $ sf agent generate test-spec --output-file specs/Resort_Manager-new-version-testSpec.yaml --force-overwrite

  Generate an agent test spec YAML file from an existing AiEvaluationDefinition metadata XML file in your DX project:

    $ sf agent generate test-spec --from-definition \
      force-app/main/default/aiEvaluationDefinitions/Resort_Manager_Tests.aiEvaluationDefinition-meta.xml

  Generate an Agentforce Studio (NGT) test spec YAML file from an existing AiTestingDefinition metadata XML file:

    $ sf agent generate test-spec --from-definition \
      force-app/main/default/aiTestingDefinitions/Returns_Checkout_Tests.aiTestingDefinition-meta.xml

FLAG DESCRIPTIONS
  --test-runner=agentforce-studio|testing-center

    Explicitly specify which test runner to use (agentforce-studio or testing-center).

    By default, the command automatically detects which test runner to use based on the test definition metadata type in
    your org. Use this flag to explicitly specify the runner type. 'agentforce-studio' uses AiTestingDefinition
    metadata. 'testing-center' uses AiEvaluationDefinition metadata.

See code: src/commands/agent/generate/test-spec.ts

sf agent mcp asset list

List the assets (tools, prompts, and resources) for an MCP server in the catalog.

USAGE
  $ sf agent mcp asset list -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>]

FLAGS
  -i, --mcp-server-id=<value>  (required) The ID of the MCP server whose assets you want to list.
  -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
  List the assets (tools, prompts, and resources) for an MCP server in the catalog.

  Returns the assets discovered for the specified MCP server, including each asset's kind (MCP_TOOL, MCP_PROMPT, or
  MCP_RESOURCE), whether it is active, and whether it is available as an agent action.

EXAMPLES
  List the assets for an MCP server in the default target org:

    $ sf agent mcp asset list --target-org myOrg --mcp-server-id 0XSxx0000000001

  List the assets for an MCP server and output as JSON:

    $ sf agent mcp asset list --target-org myOrg --mcp-server-id 0XSxx0000000001 --json

See code: src/commands/agent/mcp/asset/list.ts

sf agent mcp asset replace

Replace the asset set of an MCP server in the API Catalog.

USAGE
  $ sf agent mcp asset replace -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>] [--assets <value>
    | --assets-file <value>]

FLAGS
  -i, --mcp-server-id=<value>  (required) ID of the MCP server whose assets you want to replace.
  -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
      --assets=<value>         The desired asset allowlist as a JSON string (or "-" to read from stdin). Mutually
                               exclusive with --assets-file.
      --assets-file=<value>    Path to a JSON file containing the desired asset allowlist. Mutually exclusive with
                               --assets.

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Replace the asset set of an MCP server in the API Catalog.

  Replaces the full set of assets (tools, prompts, resources) for an MCP server with the asset items you supply. Provide
  the assets either inline with `--assets` (a JSON string, or `-` to read from stdin) or from a file with
  `--assets-file`. The JSON must be either an array of asset items or an object of the form `{ "assets": [...] }`. Each
  asset item may include `id`, `name`, `label`, `description`, `active`, and `kind`. This is a full replacement:
  existing assets not present in the supplied set are removed, so provide the complete desired asset set (read the
  current set first with `agent mcp asset list` or `agent mcp fetch`).

EXAMPLES
  Replace the assets inline with a JSON string:

    $ sf agent mcp asset replace --mcp-server-id 0XSxx0000000001 --assets \
      '{"assets":[{"name":"McpTool__add","active":true}]}' --target-org myOrg

  Replace the assets from a JSON file:

    $ sf agent mcp asset replace --mcp-server-id 0XSxx0000000001 --assets-file ./assets.json --target-org myOrg

  Pipe the assets from stdin:
  cat assets.json | sf agent mcp asset replace --mcp-server-id 0XSxx0000000001 --assets - --target-org myOrg

See code: src/commands/agent/mcp/asset/replace.ts

sf agent mcp create

Create an MCP server in the API Catalog.

USAGE
  $ sf agent mcp create -o <value> -n <value> --server-url <value> [--json] [--flags-dir <value>] [--api-version
    <value>] [--label <value>] [--description <value>] [--auth-type OAUTH|NO_AUTH] [--identity-provider <value>]
    [--client-id <value>] [--client-secret <value>] [--scope <value>]

FLAGS
  -n, --name=<value>               (required) Unique name of the MCP server.
  -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
      --auth-type=<option>         [default: NO_AUTH] Authorization type to use when connecting to the MCP server.
                                   <options: OAUTH|NO_AUTH>
      --client-id=<value>          OAuth client ID. Required when auth-type is OAUTH.
      --client-secret=<value>      OAuth client secret. Required when auth-type is OAUTH. Pass "-" to read it from stdin
                                   (piped) and keep it out of shell history.
      --description=<value>        Description of the MCP server.
      --identity-provider=<value>  Identity provider to use for OAuth authorization. Required when auth-type is OAUTH.
      --label=<value>              Human-readable label for the MCP server.
      --scope=<value>              OAuth scope to request. Required when auth-type is OAUTH.
      --server-url=<value>         (required) URL of the external MCP server.

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Create an MCP server in the API Catalog.

  Registers an external Model Context Protocol (MCP) server with the API Catalog and discovers its assets (tools,
  prompts, and resources). Provide the server URL and, when the server requires it, OAuth authorization details. When
  the authorization type is OAUTH you must supply the identity provider, client ID, client secret, and scope.

EXAMPLES
  Create an MCP server with no authentication:

    $ sf agent mcp create --name myServer --server-url https://mcp.example.com --target-org myOrg

  Create an MCP server that uses OAuth authentication, piping the client secret from stdin to keep it out of shell history:
  cat secret.txt | sf agent mcp create --name myServer --server-url https://mcp.example.com --auth-type OAUTH --identity-provider myIdp --client-id abc123 --client-secret - --scope "read write" --target-org myOrg

See code: src/commands/agent/mcp/create.ts

sf agent mcp delete

Delete an MCP server from the API Catalog.

USAGE
  $ sf agent mcp delete -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>] [--no-prompt]

FLAGS
  -i, --mcp-server-id=<value>  (required) ID of the MCP server to delete.
  -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
      --no-prompt              Skip the confirmation prompt and delete the MCP server immediately.

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Delete an MCP server from the API Catalog.

  Permanently removes an MCP (Model Context Protocol) server registration from the API Catalog, identified by its ID. By
  default you are prompted to confirm the deletion; pass --no-prompt to skip the confirmation (for example in scripts
  and CI).

EXAMPLES
  Delete an MCP server, confirming interactively:

    $ sf agent mcp delete --mcp-server-id 0XSxx0000000001 --target-org myOrg

  Delete an MCP server without a confirmation prompt:

    $ sf agent mcp delete --mcp-server-id 0XSxx0000000001 --target-org myOrg --no-prompt

See code: src/commands/agent/mcp/delete.ts

sf agent mcp fetch

Fetch the live assets (tools, prompts, resources) advertised by an MCP server.

USAGE
  $ sf agent mcp fetch -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>]

FLAGS
  -i, --mcp-server-id=<value>  (required) ID of the MCP server to fetch assets 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

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  Fetch the live assets (tools, prompts, resources) advertised by an MCP server.

  Performs a live fetch against the configured MCP server identified by its ID, returning the assets (MCP tools,
  prompts, and resources) it currently advertises along with their status and activation state. Use this to refresh the
  view of what an MCP server exposes before activating its assets as agent actions.

EXAMPLES
  Fetch the assets advertised by an MCP server in the default target org:

    $ sf agent mcp fetch --target-org myOrg --mcp-server-id 0XSxx0000000001

  Fetch MCP server assets and output as JSON:

    $ sf agent mcp fetch --target-org myOrg --mcp-server-id 0XSxx0000000001 --json

See code: src/commands/agent/mcp/fetch.ts

sf agent mcp get

Get a single MCP server registered in the API Catalog.

USAGE
  $ sf agent mcp get -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>]

FLAGS
  -i, --mcp-server-id=<value>  (required) The identifier of the MCP server to retrieve.
  -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
  Get a single MCP server registered in the API Catalog.

  Retrieves the details of an MCP (Model Context Protocol) server by its identifier, including its name, label, type,
  status, and server URL.

EXAMPLES
  Get an MCP server by id in the default target org:

    $ sf agent mcp get --target-org myOrg --mcp-server-id 0Mx000000000001

  Get an MCP server and output as JSON:

    $ sf agent mcp get --target-org myOrg --mcp-server-id 0Mx000000000001 --json

See code: src/commands/agent/mcp/get.ts

sf agent mcp list

List the MCP servers registered in the API Catalog.

USAGE
  $ sf agent mcp list -o <value> [--json] [--flags-dir <value>] [--api-version <value>] [--label <value>] [--type
    EXTERNAL] [--status ACTIVE|DISCONNECTED]

FLAGS
  -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
      --label=<value>        Filter the MCP servers by label.
      --status=<option>      Filter the MCP servers by connection status. Only ACTIVE and DISCONNECTED are supported as
                             filters.
                             <options: ACTIVE|DISCONNECTED>
      --type=<option>        Filter the MCP servers by type.
                             <options: EXTERNAL>

GLOBAL FLAGS
  --flags-dir=<value>  Import flag values from a directory.
  --json               Format output as json.

DESCRIPTION
  List the MCP servers registered in the API Catalog.

  Returns the Model Context Protocol (MCP) servers registered in the API Catalog, optionally filtered by label, type, or
  status. Use this to discover which MCP servers are available and inspect their server URLs and current status.

EXAMPLES
  List all MCP servers in the default target org:

    $ sf agent mcp list --target-org myOrg

  List external MCP servers filtered by status and output as JSON:

    $ sf agent mcp list --target-org myOrg --type EXTERNAL --status ACTIVE --json

See code: src/commands/agent/mcp/list.ts

sf agent mcp update

Update an MCP server registered in the API Catalog.

USAGE
  $ sf agent mcp update -o <value> -i <value> [--json] [--flags-dir <value>] [--api-version <value>] [--label <value>]
    [--description <value>] [--server-url <value>] [--auth-type OAUTH|NO_AUTH] [--identity-provider <value>]
    [--client-id <value>] [--client-secret <value>] [--scope <value>]

FLAGS
  -i, --mcp-server-id=<value>      (required) ID of the MCP server to update.
  -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 comm