- How do I install Laravel PAO for PHPUnit/Pest testing?
- Run `composer require laravel/pao --dev`—it auto-hooks into PHPUnit, Pest, Paratest, and other tools. No config needed. Works with Laravel 12+ and PHP 8.3+.
- Will PAO break my existing terminal output for developers?
- No. PAO only activates when it detects AI agents (e.g., Claude Code, Cursor). Human terminal runs remain unchanged with full ANSI colors and formatting.
- Does Laravel PAO support custom PHPUnit listeners or plugins?
- PAO handles core PHPUnit/Pest output, but custom listeners or plugins with non-standard CLI formatting might cause inconsistencies. Test thoroughly if using advanced setups.
- Can I use PAO with Laravel 11 or PHP 8.2?
- No. PAO requires Laravel 12+ and PHP 8.3+ for compatibility with modern PHPUnit/Pest/Rector versions. Upgrade first if needed.
- How does PAO detect AI agents like Cursor or Gemini CLI?
- PAO checks the `HTTP_USER_AGENT` or `PAO_AGENT_USER_AGENT` environment variable for known AI agent patterns. It’s open-source, so you can extend detection logic if needed.
- Will PAO slow down my test suite or Artisan commands?
- Minimal overhead (~5-10ms per test run). The tradeoff is massive token savings for AI agents (99.8% reduction in output size), with zero impact on human workflows.
- Does PAO work with PHPStan or Rector in Laravel?
- Yes. PAO auto-detects and optimizes output for PHPStan, Rector, and other CLI tools alongside PHPUnit/Pest. No extra setup required.
- What if my CI/CD pipeline relies on parsing test output logs?
- PAO preserves human-readable output in CI unless explicitly run via an AI agent. For CI-specific needs, use `PAO_ENABLED=false` to disable it.
- Are there alternatives to PAO for AI-friendly test output?
- Manual JSON output parsing or custom scripts are alternatives, but PAO is the only zero-config, Laravel-optimized solution for PHPUnit/Pest/Artisan with AI agent detection.
- How do I disable PAO if it’s causing issues?
- Set `PAO_ENABLED=false` in your environment. This forces PAO to skip all output transformations, reverting to default CLI behavior.