Composer
$ composer Official Med RiskComposer (composer) is PHP's canonical dependency manager and PSR-4 autoloader generator. It provides first-class agent ergonomics including --no-interaction, --no-ansi, --dry-run on installs/updates, and --format=json on show, outdated, and audit.
brew install composer composer resolves composer.json/composer.lock, audits packages, and generates vendor/autoload.php locally inside the workspace.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --format=json on show, outdated, audit, and search, plus global --no-interaction, --no-ansi, and --dry-run on install/update/require.
composer show --format=jsonandcomposer audit --format=jsonemit clean JSON- Global
--no-interactionand--no-ansiflags prevent hangs and ANSI noise
Supports --dry-run, composer audit, and --no-scripts, though composer.json scripts/plugins run arbitrary PHP code by default unless --no-scripts is passed.
--dry-runsimulates lockfile mutations safely--no-scriptsblocks lifecycle hook execution in untrusted projects
Distributed as a single .phar or via Homebrew across macOS, Linux, and Windows, requiring a host PHP runtime.
- Requires PHP 7.2.5+ runtime on host
Unified dependency solver, security auditor, script runner, and autoloader generator with fast Composer v2 parallel downloads.
- Composer v2 parallel metadata/archive downloads and built-in
audit
Official composer/composer project under MIT license, backed by Private Packagist maintainers.
- Official
composer/composerrepository (MIT)
Thorough CLI documentation at getcomposer.org/doc/03-cli.md and detailed --help.
- Official CLI reference at getcomposer.org/doc/03-cli.md
Security, Auth & Guardrails
Public Packagist requires no auth; private repository tokens are stored in ~/.composer/auth.json or COMPOSER_AUTH JSON env var.
MIT open-source CLI; free to use.
# Composer Agent Rules - Always pass `--no-interaction --no-ansi` (or set `COMPOSER_NO_INTERACTION=1`). - Run `composer update --dry-run` before mutating `composer.lock`, and prefer `composer install --no-scripts` when inspecting untrusted repos.
Agent-Ready Command Recipes
Safe Read-Only Queries
composer show --format=json --no-interaction
Exports installed packages, versions, and descriptions in structured JSON.
composer audit --format=json --no-interaction
Checks composer.lock against Packagist security advisories and returns JSON findings.
Controlled Writes & Previews
composer update --dry-run --no-interaction --no-ansi
Simulates dependency upgrades without downloading packages or modifying composer.lock.
Strengths for Agents
- +
--format=jsononshow,outdated, andauditgives agents structured PHP dependency and CVE data. - + Global
--no-interaction,--no-ansi, and--dry-runflags support safe headless automation. - +
COMPOSER_AUTHenv var cleanly injects CI/agent registry tokens without editing disk.
Caveats & Pitfalls
- ! Requires PHP runtime and extensions matching the target project's
composer.json. - ! Default
install/updateexecutes projectscriptsunless--no-scriptsis passed.