- How do I install Flare CLI for Laravel projects?
- Run `composer global require spatie/flare-cli` to install it globally. Ensure Composer’s global bin directory is in your PATH by checking with `composer global config bin-dir --absolute`. No Laravel-specific setup is needed beyond having Flare installed in your app via `spatie/laravel-flare`.
- Does Flare CLI work with Laravel 9 or 10?
- Yes, Flare CLI supports Laravel 8+ since it relies on the Flare API, which requires Laravel 8 or higher. Verify your Laravel version meets Flare’s minimum requirements (PHP 8.0+).
- Can I use Flare CLI to resolve errors in production without logging in?
- No, you must authenticate with `flare login` and provide your Flare API token. The CLI caches the token for subsequent sessions, but you’ll need to log in again if the token expires or is rotated.
- How do I list all errors for a Laravel project using Flare CLI?
- Run `flare list-project-errors --project-id=<your-project-id>` to fetch all errors. Replace `<your-project-id>` with the ID from `flare list-projects`. Use `--limit` to paginate results.
- Is Flare CLI secure for CI/CD pipelines? How do I handle API tokens?
- Store API tokens in environment variables or a secrets manager (e.g., GitHub Secrets, AWS Secrets Manager) instead of hardcoding them. Use `flare login` interactively in CI or pass the token via `--token` flag for automation, but avoid committing tokens to repositories.
- What if Flare’s API changes break Flare CLI commands?
- Flare CLI maps directly to Flare’s API endpoints, so breaking changes (e.g., renamed endpoints or deprecated fields) may require updating the CLI. Monitor [Flare’s changelog](https://github.com/spatie/laravel-flare) and check the [Flare CLI releases](https://github.com/spatie/flare-cli/releases) for compatibility notes.
- Can I use Flare CLI to monitor Laravel queue jobs or HTTP requests?
- Yes, Flare CLI supports monitoring summaries and aggregations via `flare get-monitoring-summary` and `flare list-monitoring-aggregations`. Filter by `type=routes`, `type=jobs`, or `type=database` to inspect specific metrics.
- How do I snooze an error in Flare CLI to ignore it temporarily?
- Use `flare snooze-error --error-id=<id> --minutes=30` to snooze an error for 30 minutes. Replace `<id>` with the error ID from `flare list-project-errors`. Unsnooze later with `flare unsnooze-error --error-id=<id>`.
- Are there alternatives to Flare CLI for Laravel error monitoring?
- If you’re not using Flare, alternatives include Sentry CLI (`sentry-cli`), Bugsnag’s CLI tools, or Laravel Debugbar for local debugging. Flare CLI is uniquely tailored for Spatie’s Flare ecosystem, offering deep integration with its API.
- How do I check if Flare CLI is working correctly in my Laravel app?
- First, ensure `spatie/laravel-flare` is installed and configured in your Laravel app. Then, run `flare get-authenticated-user` to verify API connectivity. Test error commands like `flare list-project-errors` to confirm data flows from your app to Flare.