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 — reads
resources/openapi/flare-api.yamland 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 OpenApiCliapp/Services/CredentialStore.php— credential persistence to~/.flare/config.jsonapp/Commands/LoginCommand.php—flare loginapp/Commands/LogoutCommand.php—flare logoutresources/openapi/flare-api.yaml— bundled Flare API specconfig/app.php— providers list (must manually registerOpenApiCliServiceProvider)box.json— PHAR build config (must includeresourcesdirectory)
The spatie/laravel-openapi-cli package is loaded via a Composer path repository pointing to ../laravel-openapi-cli with symlink. Run composer update after cloning both repos side by side.
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. - The
resources/directory must be inbox.jsondirectoriesfor the spec to be bundled in the PHAR. resource_path()resolves tophar://paths when running inside a PHAR — this works for reading but not writing.
Follow PSR-12. Use Laravel/Pint for formatting. Tests use Pest.