⌨️ CLI Quick Reference
In 8 minutes, master the complete subcommand usage of the composer-skills command-line tool. No Go code needed, drive Packagist API and local Composer directly from the terminal.
Why a CLI?
cmd/composer-skills is built on Cobra, exposing SDK capabilities to the terminal. It's suitable for writing automation scripts, one-off checks, or skipping Go compilation in CI. All commands fall into two categories:
- 🌐 Remote commands (
package/repo/search/security/changes/manage): Use Packagist HTTP API, no PHP needed. - 🖥️ Local commands (
local/global/config/auth/environment, etc.): Execute localcomposer, requires PHP.
Build & Help
bash
make build # Produces ./bin/composer-skills
./bin/composer-skills # Top-level help
./bin/composer-skills local --help # Every command has --help🌐 Packagist Operations (No PHP Required)
bash
# Search packages
./bin/composer-skills search query "logging"
./bin/composer-skills search tags json,logging
./bin/composer-skills search type "logging" library
# Package details & statistics
./bin/composer-skills package info monolog/monolog
./bin/composer-skills package stats monolog/monolog
./bin/composer-skills package v2-metadata symfony/console
./bin/composer-skills package dev-versions monolog/monolog
# Repository statistics & listings
./bin/composer-skills repo stats
./bin/composer-skills repo list
./bin/composer-skills repo list-vendor symfony
./bin/composer-skills repo list-type library
./bin/composer-skills repo list-with-data --fields name,downloads
./bin/composer-skills repo popular --per-page 20
# Security advisories (site-wide / specific packages / incremental)
./bin/composer-skills security advisories
./bin/composer-skills security package monolog/monolog
./bin/composer-skills security since 2026-01-01
# Change tracking
./bin/composer-skills changes🖥️ Local Composer Operations (Requires PHP)
bash
# Dependency management
./bin/composer-skills local install --working-dir /path/to/project
./bin/composer-skills local require monolog/monolog --version "^3.0" --working-dir .
./bin/composer-skills local update monolog/monolog --working-dir .
./bin/composer-skills local remove monolog/monolog --working-dir .
# Inspection & diagnostics
./bin/composer-skills local audit --working-dir .
./bin/composer-skills local outdated --working-dir .
./bin/composer-skills local validate --working-dir .
./bin/composer-skills local why monolog/monolog --working-dir .
./bin/composer-skills local why-not monolog/monolog 4.0 --working-dir .
./bin/composer-skills local tree monolog/monolog --working-dir .
./bin/composer-skills local fund --working-dir .
./bin/composer-skills local licenses --working-dir .
./bin/composer-skills local check-licenses --working-dir .
./bin/composer-skills local check --working-dir .
./bin/composer-skills local diagnose --working-dir .
./bin/composer-skills local status --working-dir .
# Project & scripts
./bin/composer-skills local create-project laravel/laravel /tmp/app
./bin/composer-skills local init --working-dir .
./bin/composer-skills local dump-autoload --working-dir .
./bin/composer-skills local run-script post-install-cmd --working-dir .
./bin/composer-skills local list-scripts --working-dir .
./bin/composer-skills local reinstall monolog/monolog --working-dir .
./bin/composer-skills local bump monolog/monolog --working-dir .
./bin/composer-skills local browse monolog/monolog
# Platform
./bin/composer-skills local version --working-dir .
./bin/composer-skills local get-php-version
./bin/composer-skills local has-extension mbstring
./bin/composer-skills local check-platform
./bin/composer-skills local exec phpunit
./bin/composer-skills local suggest --working-dir .
./bin/composer-skills local self-update
./bin/composer-skills local archive /tmp/dist --working-dir .🌍 Global Operations
bash
./bin/composer-skills global require phpstan/phpstan --version "^1.0"
./bin/composer-skills global update phpstan/phpstan
./bin/composer-skills global remove phpstan/phpstan
./bin/composer-skills global install
./bin/composer-skills global list⚙️ Configuration & Authentication
bash
# Configuration
./bin/composer-skills config get minimum-stability
./bin/composer-skills config set minimum-stability dev
# Authentication
./bin/composer-skills auth show
./bin/composer-skills auth add-github github.com ghp_xxx
./bin/composer-skills auth add-gitlab gitlab.com glpat-xxx
./bin/composer-skills auth add-bearer example.com my-token
./bin/composer-skills auth add-http-basic example.com user pass
./bin/composer-skills auth remove github github.com
# Validation & normalization
./bin/composer-skills validate-lock --working-dir .
./bin/composer-skills normalize --working-dir .
# Environment & project info
./bin/composer-skills environment
./bin/composer-skills project-info --working-dir .
./bin/composer-skills home # Open Composer documentation homepage
./bin/composer-skills aboutExpected Output Examples
$ ./bin/composer-skills search query "monolog"
monolog/monolog Sends your logs to files, sockets, inboxes, databases and web services
...
$ ./bin/composer-skills local audit --working-dir .
Found 0 security vulnerability advisoriesScripting Usage
All commands follow standard exit codes: success 0, failure non-0. Chain with set -e in shell for simple pipelines. Use the SDK for JSON output (see 🔒 Security Audit Pipeline). Always pass --working-dir explicitly in CI, otherwise it will look for composer.json in the repository root.
Next Steps
- Want typed results instead of text? All CLI commands are backed by SDK methods.
- Chain CLI into a complete pipeline: 🔒 Building a Security Audit Pipeline.