A standalone CLI tool for Flare built on Laravel Zero. Uses spatie/laravel-openapi-cli to auto-generate artisan commands from the Flare OpenAPI spec.
- Package:
spatie/flare-cli - Binary:
flare - Install:
composer global require spatie/flare-cli
- Laravel Zero 12 — PHP CLI micro-framework
- spatie/laravel-openapi-cli — fetches the spec from
https://flareapp.io/downloads/flare-api.yaml(cached for 24h) and registers one command per API endpoint usingoperationId-based naming withflare:prefix - CredentialStore (
app/Services/CredentialStore.php) — reads/writes API token to~/.flare/config.json - LoginCommand / LogoutCommand — custom commands (not from OpenAPI spec) for auth flow
flare— CLI entry point (the binary)app/Providers/AppServiceProvider.php— registers CredentialStore singleton and OpenApiCli (spec URL, auth, error messaging)app/Services/CredentialStore.php— credential persistence to~/.flare/config.jsonapp/Commands/LoginCommand.php—flare loginapp/Commands/LogoutCommand.php—flare logoutconfig/app.php— providers list (must manually registerOpenApiCliServiceProvider)box.json— PHAR build config
The spatie/laravel-openapi-cli package is installed from Packagist. To develop against a local checkout, temporarily add a path repository pointing to ../laravel-openapi-cli (with a dev-<branch> as <version> alias, since minimum-stability is stable) and revert before committing a release.
When updating the AI agent skill (e.g. filters, sorts, available commands), always verify against the actual flare build (php flare list, php flare <command> --help) to avoid documenting incorrect flags, filter names, or sort options.
- Laravel Zero disables package auto-discovery. Any package service providers must be registered manually in
config/app.php. - The
.auth()callable (not.bearer()) is used for dynamic credential resolution fromCredentialStore.
Follow PSR-12. Use Laravel/Pint for formatting. Tests use Pest.