warden_magento_cli
Execute Magento CLI commands within Warden-managed development environments to manage and automate Magento 2 operations directly from AI assistants.
Instructions
Run bin/magento command inside the php-fpm container
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | Path to the project directory | |
| command | Yes | Magento CLI command (without 'bin/magento' prefix) | |
| args | No | Additional arguments for the command |
Implementation Reference
- server.js:591-610 (handler)Main handler function that runs the Magento CLI command (bin/magento) inside the Warden php-fpm container by constructing a warden env exec command and delegating to executeWardenCommand.async runMagentoCli(args) { const { project_path, command, args: commandArgs = [] } = args; const wardenCommand = [ "env", "exec", "-T", "php-fpm", "php", "bin/magento", command, ...commandArgs, ]; return await this.executeWardenCommand( project_path, wardenCommand, `Running Magento CLI: bin/magento ${command}`, ); }
- server.js:150-176 (schema)Tool schema definition in the ListTools response, specifying name, description, and inputSchema with required project_path and command, optional args array.{ name: "warden_magento_cli", description: "Run bin/magento command inside the php-fpm container", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to the project directory", }, command: { type: "string", description: "Magento CLI command (without 'bin/magento' prefix)", }, args: { type: "array", description: "Additional arguments for the command", items: { type: "string", }, default: [], }, }, required: ["project_path", "command"], }, },
- server.js:335-336 (registration)Registration of the tool handler in the CallToolRequestSchema switch statement, mapping the tool name to the runMagentoCli method.case "warden_magento_cli": return await this.runMagentoCli(request.params.arguments);