Overview
Thesam plugin command manages Solace Agent Mesh plugins, allowing you to create new plugins, install existing ones, add plugin-based components to your project, build plugins for distribution, and browse the plugin catalog.
Syntax
Description
Plugins extend SAM functionality by packaging reusable agents, gateways, tools, or custom components. The plugin system supports:- Creating new plugins from templates
- Installing plugins from various sources (local, Git, PyPI)
- Adding plugin components to your project
- Building plugins as distributable packages
- Browsing the official plugin catalog
Subcommands
sam plugin create
Creates a new SAM plugin directory structure with interactive prompts for metadata.Syntax
Arguments
Name of the plugin to create (e.g.,
my-custom-plugin).Options
Plugin type. Options:
agent, gateway, tool, customAuthor’s name for the plugin metadata.
Author’s email for the plugin metadata.
Plugin description.
Initial plugin version.
Skip interactive prompts and use defaults or provided flags.
Examples
Interactive plugin creation:Output
Creates a complete plugin structure:sam plugin install
Installs a plugin from various sources.Syntax
Arguments
Source of the plugin. Can be:
- Local path to a directory (e.g.,
/path/to/plugin) - Local path to a wheel file (e.g.,
/path/to/plugin.whl) - Git URL (e.g.,
https://github.com/user/repo.git) - Official plugin name (e.g.,
web-scraper)
Options
Command to use to install a Python package. Must follow the format
command {package} args.Default: pip3 install {package}Can also be set through the environment variable SAM_PLUGIN_INSTALL_COMMAND.Examples
Install from official registry:Output
sam plugin add
Installs a plugin and creates a new component instance from it.Syntax
Arguments
Name for the component instance to create.
Options
Plugin source: installed module name, local path, or Git URL.
Command to use to install a Python package. Must follow the format
command {package} args.Default: pip3 install {package}Examples
Add component from official plugin:Output
configs/agents/for agent and tool pluginsconfigs/gateways/for gateway pluginsconfigs/plugins/for other plugin types
sam plugin build
Builds the SAM plugin in the specified directory.Syntax
Arguments
Path to plugin directory. Defaults to current directory.
Examples
Build plugin in current directory:Output
Requirements
Requires thebuild package:
sam plugin catalog
Launches the SAM Plugin catalog web interface.Syntax
Options
Port to run the plugin catalog web server on.
Command to use to install a Python package. Must follow the format
command {package} args.Examples
Launch catalog on default port:Output
Plugin Structure
A typical plugin structure created bysam plugin create:
config.yaml
Contains placeholders like__COMPONENT_KEBAB_CASE_NAME__ that are replaced when adding the plugin to a project.
pyproject.toml
Defines package metadata including:- Package name and version
- Dependencies
- Plugin metadata in
[tool.<plugin_name>.metadata]section
Environment Variables
Default command to install Python packages. Must include
{package} placeholder.Example: pip3 install {package}Host for the plugin catalog web interface.
Official Plugin Registry
Official plugins are hosted at:https://github.com/SolaceLabs/solace-agent-mesh-core-plugins
You can install them by name:
Implementation Details
Implemented in:- Create:
/home/daytona/workspace/source/cli/commands/plugin_cmd/create_cmd.py - Install:
/home/daytona/workspace/source/cli/commands/plugin_cmd/install_cmd.py - Add:
/home/daytona/workspace/source/cli/commands/plugin_cmd/add_cmd.py - Build:
/home/daytona/workspace/source/cli/commands/plugin_cmd/build_cmd.py - Catalog:
/home/daytona/workspace/source/cli/commands/plugin_cmd/catalog_cmd.py