agent generate authoring-bundle

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.

Flag Name (Long)Flag Name (Short)Description
‑‑api‑nameN/AType: 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‑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.
‑‑force‑overwriteN/AType: Boolean

Overwrite the existing authoring bundle if one with the same API name already exists locally.
‑‑jsonN/AType: Boolean

Format output as json.
‑‑name‑nType: Value

Name (label) of the authoring bundle; if not specified, you’re prompted for the name.
‑‑no‑specN/AType: Boolean

Skip prompting for an agent spec and use the default Agent Script boilerplate in the generated authoring bundle.
‑‑output‑dir‑dType: Value

Directory where the authoring bundle files are generated.
‑‑spec‑fType: 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.
‑‑target‑org‑oType: Value
Required

Username or alias of the target org. Not required if the target-org configuration variable is already set.

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:

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

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:

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”: