定制 adachsoft/symfony-console-tool 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

adachsoft/symfony-console-tool

最新稳定版本:v0.3.0

Composer 安装命令:

composer require adachsoft/symfony-console-tool

包简介

README 文档

README

Library providing an AI SPI tool for running Symfony Console commands (run) and listing available commands (list) in external Symfony projects.

Installation

composer require adachsoft/symfony-console-tool

Usage with adachsoft/ai-tool-call (SPI)

Register SymfonyConsoleToolFactory in the AiToolCallFacadeBuilder and configure the tool using ConfigMap:

use AdachSoft\AiToolCall\PublicApi\Builder\AiToolCallFacadeBuilder;
use AdachSoft\AiToolCall\SPI\Collection\ConfigMap;
use AdachSoft\SymfonyConsoleTool\Tool\SymfonyConsoleToolFactory;

$builder = AiToolCallFacadeBuilder::new()
    ->withSpiFactories([
        new SymfonyConsoleToolFactory(),
    ])
    ->withToolConfigs([
        'symfony_console' => new ConfigMap([
            'base_path' => '/path/to/your/symfony/project',
            'console_path' => 'bin/console',
            'php_binary' => 'php',
            'timeout' => 30.0,
        ]),
    ]);

$facade = $builder->build();

Then you can call the symfony_console tool via the public API:

use AdachSoft\AiToolCall\PublicApi\Dto\ToolCallRequestDto;

// List commands
$listResult = $facade->callTool(new ToolCallRequestDto(
    toolName: 'symfony_console',
    parameters: [
        'action' => 'list',
    ],
));

// Run a specific command
$runResult = $facade->callTool(new ToolCallRequestDto(
    toolName: 'symfony_console',
    parameters: [
        'action' => 'run',
        'command' => 'cache:clear --env=prod',
    ],
));

The result payload is an array with the following keys:

  • exit_code (int) command exit code
  • output (string) STDOUT contents
  • error_output (string) STDERR contents

Security

console_path is resolved relative to base_path using adachsoft/normalized-safe-path. Any attempt to escape base_path (path traversal) will result in an error and the tool call will fail.

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固