Skip to content

⌨️ 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 --json output for easy consumption by scripts in CI/CD.

Subcommand Overview

Command GroupDescriptionKey Subcommands
packagePackage informationinfo, stats, v2-metadata, dev-versions
repoRepository queriesstats, list, list-vendor, list-type, list-with-data, popular
searchPackage searchquery, tags, type
securitySecurity advisoriesadvisories, package, since
changesPackage changes(Package change tracking)
managePackage management (requires credentials)create, edit, update
localLocal Composer operationsinstall, require, update, audit, validate, get-php-version, has-extension, exec, suggest, config, auth, home, validate-lock, normalize, environment, project-info, about

Global Options

OptionDefaultDescription
--timeout60HTTP request timeout (seconds)
--base-urlhttps://packagist.orgPackagist API base URL
--repo-urlhttps://repo.packagist.orgComposer repository URL
--usernamePackagist username (required for management commands)
--api-tokenPackagist API Token
--jsonfalseOutput 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 audit

For 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 infoComposerClient.GetPackage, and local auditComposer.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.

Released under the MIT License