🚀 Installation & Usage
How to obtain and run the composer-skills CLI tool.
Prerequisites
- 📦 Remote Packagist commands: only the
composer-skillsbinary is required, no PHP needed. - 🛠️ Local
localcommand 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@latestInstalls 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-skillsThe repository root also provides a build.sh script:
bash
./build.sh # Output goes to the build/ directoryOption 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 --helpThis 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 popularSecurity Checks
bash
# Global security advisories
composer-skills security advisories
# Advisories for a specific package
composer-skills security package monolog/monologLocal 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 informationJSON 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 \
--jsonAdvanced
- For the full list of subcommands, see CLI Overview.
- For usage in CI/CD, see CI/CD Pipelines.
- For the Go SDK corresponding to the local commands, see Composer CLI SDK.