⌨️ CLI Tool
cmd/composer-skills is a command-line tool built on Cobra that exposes the full capabilities of Composer Skills from the terminal — supporting both remote Packagist API queries and local Composer CLI operations.
Positioning
- 🌐 Remote: Search packages, get details/statistics, security advisories, package management (requires API credentials).
- 📦 Local: Local Composer operations such as install / require / update / audit / validate / config / auth.
- 🤖 Pipeline-friendly: Supports
--jsonoutput for easy consumption by scripts in CI/CD.
Subcommand Overview
| Command Group | Description | Key Subcommands |
|---|---|---|
package | Package information | info, stats, v2-metadata, dev-versions |
repo | Repository queries | stats, list, list-vendor, list-type, list-with-data, popular |
search | Package search | query, tags, type |
security | Security advisories | advisories, package, since |
changes | Package changes | (Package change tracking) |
manage | Package management (requires credentials) | create, edit, update |
local | Local Composer operations | install, require, update, audit, validate, get-php-version, has-extension, exec, suggest, config, auth, home, validate-lock, normalize, environment, project-info, about |
Global Options
| Option | Default | Description |
|---|---|---|
--timeout | 60 | HTTP request timeout (seconds) |
--base-url | https://packagist.org | Packagist API base URL |
--repo-url | https://repo.packagist.org | Composer repository URL |
--username | — | Packagist username (required for management commands) |
--api-token | — | Packagist API Token |
--json | false | Output results as JSON |
Quick Examples
bash
# Search packages
composer-skills search query "logging"
# Get package details (JSON output)
composer-skills package info monolog/monolog --json
# Get security advisories
composer-skills security advisories
# Install dependencies locally
composer-skills local install
# Add a package dependency
composer-skills local require monolog/monolog
# Run a local security audit
composer-skills local auditFor installation and build instructions, see Installation & Usage.
Mapping to the SDK
The CLI is a thin wrapper around the SDK — each subcommand internally calls the corresponding method in pkg/client or pkg/composer. For example, package info → ComposerClient.GetPackage, and local audit → Composer.AuditWithJSON. Therefore, the CLI documentation and the SDK Reference can be cross-referenced.
Want equivalent capabilities in Go code?
Just import the corresponding SDK package directly — no need to go through the CLI. See Getting Started.