jeffersongoncalves / packagist-cli
CLI tool to publish and manage Composer packages on Packagist via its API (submit, update, list, info).
Package info
github.com/jeffersongoncalves/packagist-cli
Type:project
pkg:composer/jeffersongoncalves/packagist-cli
Fund package maintenance!
Requires
- php: ^8.2
Requires (Dev)
- guzzlehttp/guzzle: ^7.10
- laravel-zero/framework: ^12.0
- laravel/pint: ^1.25
- mockery/mockery: ^1.6
- pestphp/pest: ^3.8|^4.1
README
packagist-cli
A small CLI to publish and manage your Composer packages on Packagist
directly from the terminal — submit a new package, force a re-crawl, and inspect what you
have published. It stores your Packagist API token locally in ~/.config/packagist.json
(0600) so you only authenticate once.
Built with Laravel Zero.
Installation
composer global require jeffersongoncalves/packagist-cli
Or download the PHAR from the releases page.
Authentication
Grab your API token from https://packagist.org/profile/ and store it:
packagist auth
# or non-interactively
packagist auth --username=you --token=xxxxxxxx
The token is written to $XDG_CONFIG_HOME/packagist.json (falling back to
~/.config/packagist.json) with 0600 permissions.
| Flag | Description |
|---|---|
--username= |
Packagist username (skips the prompt) |
--token= |
Packagist API token (skips the prompt) |
--show |
Print the stored credentials (token masked) |
--forget |
Remove the stored credentials |
Commands
submit — register a new package
packagist submit https://github.com/jeffersongoncalves/laravel-zero-support
# shorthand (assumed GitHub):
packagist submit jeffersongoncalves/laravel-zero-support
update — force a re-crawl
packagist update jeffersongoncalves/laravel-zero-support
# or by repository URL
packagist update https://github.com/jeffersongoncalves/laravel-zero-support
list — list a vendor's packages
packagist list jeffersongoncalves
# defaults to the authenticated username when omitted
packagist list
info — inspect a package
packagist info jeffersongoncalves/laravel-zero-support
Development
composer install composer test # pest + pint --test composer build # build the PHAR into builds/
License
MIT © Jefferson Gonçalves
