Skip to content

🚀 Installation & Usage

How to obtain and run the composer-skills CLI tool.

Prerequisites

  • 📦 Remote Packagist commands: only the composer-skills binary is required, no PHP needed.
  • 🛠️ Local local command group: requires PHP 7.4+ and Composer 2.0+ to be installed on the machine (or let the SDK auto-install them, see Auto-Install Mechanism).

Option 1: go install

bash
go install github.com/scagogogo/composer-skills/cmd/composer-skills@latest

Installs to $GOPATH/bin (make sure this directory is in your PATH).

Option 2: Build from Source

bash
git clone https://github.com/scagogogo/composer-skills.git
cd composer-skills
make build          # Output is in bin/composer-skills
# or
go build -o composer-skills ./cmd/composer-skills

The repository root also provides a build.sh script:

bash
./build.sh          # Output goes to the build/ directory

Option 3: Docker

The project ships with a Dockerfile and docker-compose.yml:

bash
docker build -t composer-skills .
docker run --rm composer-skills search query "logging"

See Docker Deployment for details.

Verify the Installation

bash
composer-skills --help

This should output the root command and the list of subcommands.

Common Workflows

Querying Remote Package Information

bash
# Search
composer-skills search query "psr log"

# Details
composer-skills package info psr/log

# Statistics
composer-skills repo stats

# Popular packages
composer-skills repo popular

Security Checks

bash
# Global security advisories
composer-skills security advisories

# Advisories for a specific package
composer-skills security package monolog/monolog

Local Project Operations

Inside a PHP project directory:

bash
composer-skills local install              # Install dependencies
composer-skills local require monolog/monolog "^3.0"
composer-skills local update
composer-skills local audit                # Security audit
composer-skills local validate-lock        # Validate the lock file
composer-skills local project-info         # Project information

JSON Output (for Script Consumption)

bash
composer-skills package info monolog/monolog --json | jq .

Configuring Authentication (Management Commands)

manage create/edit/update requires Packagist API credentials:

bash
composer-skills manage create \
  --username YOUR_USERNAME \
  --api-token YOUR_TOKEN \
  --json

Advanced

Released under the MIT License