Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Composer

$ composer Official Med Risk
Composer · Code & DevOps · MIT · macos / linux / windows

Composer (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.

FCRS-1.0 Score
86 /100
Good
Medium Confidence
Zero-Friction Install
brew install composer
CLI vs MCP Decision CLI Preferred vs MCP

composer resolves composer.json/composer.lock, audits packages, and generates vendor/autoload.php locally inside the workspace.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
✓ NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 22 / 25

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=json and composer audit --format=json emit clean JSON
  • Global --no-interaction and --no-ansi flags prevent hangs and ANSI noise
Trust & Safety 21 / 25

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-run simulates lockfile mutations safely
  • --no-scripts blocks lifecycle hook execution in untrusted projects
Setup & Portability 12 / 15

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
Utility & Efficiency 14 / 15

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
Maintenance & Lineage 8 / 10

Official composer/composer project under MIT license, backed by Private Packagist maintainers.

  • Official composer/composer repository (MIT)
Docs & Verifiability 9 / 10

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

Auth Modes
No Auth Config File Env API Key
Credential Storage

Public Packagist requires no auth; private repository tokens are stored in ~/.composer/auth.json or COMPOSER_AUTH JSON env var.

Side Effects
Read-Only Local Write
Cost & Quotas

MIT open-source CLI; free to use.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

List installed PHP dependencies as JSON
composer show --format=json --no-interaction

Exports installed packages, versions, and descriptions in structured JSON.

Run security vulnerability audit as JSON
composer audit --format=json --no-interaction

Checks composer.lock against Packagist security advisories and returns JSON findings.

Controlled Writes & Previews

Preview composer update without changing lockfile
composer update --dry-run --no-interaction --no-ansi

Simulates dependency upgrades without downloading packages or modifying composer.lock.

Strengths for Agents

  • + --format=json on show, outdated, and audit gives agents structured PHP dependency and CVE data.
  • + Global --no-interaction, --no-ansi, and --dry-run flags support safe headless automation.
  • + COMPOSER_AUTH env 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/update executes project scripts unless --no-scripts is passed.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI