openmas init
Command¶
The openmas init
command helps you initialize a new OpenMAS project with the standard directory structure and configuration files.
Usage¶
Where:
- <project_name>
is the name of the project to create, or "." to initialize in the current directory.
Options¶
--template, -t TEXT
: Template to use for project initialization (e.g., "mcp-server")--name TEXT
: Project name when initializing in current directory (required ifproject_name
is ".")
Purpose¶
This command creates a new OpenMAS project with a standardized directory structure, making it easy to start building multi-agent systems. It:
- Creates the project directory (unless using the current directory)
- Sets up the standard directory structure
- Creates starter configuration files
- (Optionally) Sets up a template with specific agent implementations
Directory Structure¶
The command creates the following directory structure:
project_name/
├── agents/ # Agent implementations
├── shared/ # Shared code between agents
├── extensions/ # Custom extensions
├── config/ # Configuration files
├── tests/ # Test files
├── packages/ # External dependencies
├── .gitignore # Git ignore file
├── openmas_project.yml # Project configuration
├── README.md # Project README
└── requirements.txt # Python dependencies
Example Usage¶
Create a New Project¶
Initialize in Current Directory¶
Use a Template¶
# Create a new project with the MCP server template
openmas init my_mcp_project --template mcp-server
Template Options¶
The --template
option allows you to create a project with pre-configured components. Currently supported templates include:
mcp-server¶
Creates a project with an MCP server agent preconfigured:
This will create:
- A directory structure for an MCP server agent
- A sample implementation in agents/mcp_server/agent.py
- A deployment configuration in agents/mcp_server/openmas.deploy.yaml
Project Configuration¶
The command creates an openmas_project.yml
file with the following structure:
name: "my_project"
version: "0.1.0"
agents: {} # Will contain agent definitions
shared_paths: ["shared"]
plugin_paths: ["extensions"]
default_config:
log_level: "INFO"
communicator_type: "http"
dependencies: [] # External dependencies
Next Steps¶
After initializing a project, you can:
- Create agent implementations in the
agents/
directory - Register your agents in the
openmas_project.yml
file - Run your agents with the
openmas run
command - Validate your project configuration with
openmas validate
Related Commands¶
openmas run
: Run an agent from the projectopenmas validate
: Validate the project configurationopenmas list agents
: List agents defined in the project