Search by

adachsoft / composer-tool

Arkadiusz Adach

AI tool-call adapter for running Composer operations via adachsoft/composer-lib.

Package info

gitlab.com/a.adach/composer-tool

Issues

pkg:composer/adachsoft/composer-tool

Statistics

Installs: 52

Dependents: 0

Suggesters: 0

Stars: 0

v0.9.1 2026-09-11 06:01 UTC

This package is auto-updated.

Last update: 2026-09-11 04:03:06 UTC


README

AI tool-call adapter for running Composer operations via adachsoft/composer-lib, implemented as a SPI tool for adachsoft/ai-tool-call.

Requirements

  • PHP ^8.3
  • adachsoft/ai-tool-call
  • adachsoft/composer-lib
  • adachsoft/command-executor-lib
  • adachsoft/normalized-safe-path

Installation

composer require adachsoft/composer-tool

Tools

Each tool has a dedicated reference document containing its request parameters, result payload, factory configuration, defaults, and monorepo package_path behavior.

Composer operations

  • composer - executes Composer operations such as install, update, require, validate, and run scripts.
  • composer_script - lists and runs scripts from composer.json.

Dependency inspection

Both dependency inspection factories read working_directory from the ConfigMap passed to each create() call. A single factory instance can therefore create tools for different working directories. Paths returned by these tools are relative to the configured working directory and do not expose absolute filesystem paths.

composer.json operations

Minimal usage

use AdachSoft\AiToolCall\PublicApi\Builder\AiToolCallFacadeBuilder;
use AdachSoft\AiToolCall\SPI\Collection\ConfigMap;
use AdachSoft\ComposerTool\Tool\ComposerToolFactory;

$facade = AiToolCallFacadeBuilder::new()
    ->withSpiFactories([
        new ComposerToolFactory(),
    ])
    ->withToolConfigs([
        'composer' => new ConfigMap([
            'working_directory' => __DIR__,
        ]),
    ])
    ->build();

See the dedicated tool documentation for complete registration examples and configuration options.

Architecture decisions

Versioning

This package follows Semantic Versioning and is versioned exclusively through Git tags. The composer.json file intentionally does not contain an explicit version field.

License

MIT