🚀 What is Composer Skills
The Go SDK the PHP Composer ecosystem was missing — a single
importgives you a typed, tested API covering the Packagist REST API and every Composer CLI command, with zero-config auto-install built in.
🎯 Project positioning
Composer Skills is an SDK written in Go, designed for developers who need to interact with the PHP/Composer ecosystem. It bundles two things into a single package:
- 🌐 Packagist REST API client (pure Go, no PHP required) — search packages, query statistics, pull security advisories.
- 🛠️ Composer CLI wrapper SDK (executes the local
composerbinary) — install/update dependencies, audit vulnerabilities, manage projects, configure authentication.
Package path:
github.com/scagogogo/composer-skills💔 The core pain point it solves
If you've written Go code that calls Composer, you've most likely written fragile code that breaks at the slightest touch:
// 😩 The old way — fragile, untyped, no error handling
out, _ := exec.Command("composer", "audit").Output()
lines := strings.Split(string(out), "\n")
// Then you have to parse these strings yourself... breaks the moment the format changesComposer Skills gives you this:
// 😊 The new way — typed, tested, auto-installing
result, _ := comp.AuditWithJSON()
fmt.Printf("Vulnerabilities: %d\n", result.Found)📊 Key figures
| Metric | Value | Description |
|---|---|---|
| 🛠️ SDK methods | 234 | Wraps all standard Composer CLI commands across 20 categories |
| 🌐 API methods | 20 | Covers Packagist search, statistics, security advisories, listing, management |
| 🧪 Test cases | 450+ | Mock-isolated, fully validated in CI |
| ⌨️ CLI subcommands | 50+ | Exposes all SDK capabilities from the terminal |
| 💡 Convenience methods | 18+ | Shortcuts like IsPackageInstalled, GetProjectSummary |
🌰 A minimal example
The snippet below demonstrates "zero-config auto-install + typed audit" — if Composer isn't installed on the machine, it installs it for you:
package main
import (
"fmt"
"log"
"github.com/scagogogo/composer-skills/pkg/composer"
)
func main() {
// Default Options already enables AutoInstall, which auto-installs when missing
comp, err := composer.New(composer.DefaultOptions())
if err != nil {
log.Fatal(err)
}
comp.SetWorkingDir("/path/to/php/project")
// Structured audit results, no more string parsing
result, err := comp.AuditWithJSON()
if err != nil {
log.Fatal(err)
}
fmt.Printf("Vulnerabilities found: %d\n", result.Found)
}No PHP required
If you only want to query Packagist (search packages, view statistics, pull security advisories), just use pkg/client — it's pure Go and requires no local PHP or Composer installation at all. See Dual SDK architecture.
🧭 Next steps
- 🚀 First time? See Getting started to run your first example in 5 minutes.
- 📦 Integrating into a project? See Installation for dependencies and system requirements.
- 🤔 Want to understand the design? Read What problem it solves and Dual SDK architecture.
- 🔄 Want it in CI? See CI/CD pipeline and Docker deployment.
In one sentence
Stop hand-writing exec.Command parsing. One import, and you get typed APIs + auto-install + cross-platform support, all at once.