Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Pao Laravel Package

laravel/pao

Laravel PAO detects when PHP tools like PHPUnit, Pest, PHPStan, Rector, and Artisan run inside AI agents such as Claude Code or Cursor, swapping verbose output for compact structured JSON. Zero config, works with any PHP project, PHP 8.3+.

View on GitHub
Deep Wiki
Context7

Laravel PAO is agent-optimized output for PHP tools. It auto-detects when your tooling runs inside an AI agent — Claude Code, Cursor, Devin, Gemini CLI — and swaps verbose human-readable output for compact, structured JSON. Install with composer require laravel/pao --dev; it hooks into your tools via Composer's autoloader with zero configuration. When a human runs the same commands, output stays completely unchanged.

  • Works with PHPUnit, Pest, Paratest, PHPStan, Rector, and Laravel Artisan
  • Framework-agnostic: Laravel, Symfony, Laminas, or vanilla PHP
  • Strips ANSI colors, box-drawing characters, and excess whitespace from Artisan output
  • Auto-discovered service provider for Laravel projects
  • Requires PHP 8.3+ and installs as a dev dependency
Frequently asked questions about Pao
What does the laravel/pao package actually do?
Laravel PAO is a dev-only Composer package that detects when PHP tools run inside an AI coding agent and replaces verbose human-readable output with compact structured JSON. It works with PHPUnit, Pest, Paratest, PHPStan, Rector, and Laravel Artisan commands. For Artisan specifically, it also strips ANSI colors, box-drawing characters, and excess whitespace to reduce token usage.
How do I install Laravel PAO and does it require configuration?
Install it as a dev dependency with composer require laravel/pao --dev. There is no configuration file or manual setup: PAO hooks into PHPUnit, Pest, Paratest, PHPStan, and Rector through Composer's autoloader, and Laravel's service provider auto-discovery handles Artisan output. It only activates when an AI agent is detected, so human terminal output stays the same.
Which PHP testing and analysis tools does laravel/pao support?
PAO supports PHPUnit 12-13, Pest 4-5, Paratest, PHPStan 1.x, Rector, and Laravel Artisan commands. The package is designed to reduce fragmentation when AI agents interact with multiple testing and static analysis tools. JSON output includes tool-specific fields such as duration_ms, error_details, and a raw fallback field.
Does Laravel PAO change terminal output for human developers?
No. Laravel PAO activates only when it detects an AI coding agent such as Claude Code, Cursor, Devin, or Gemini CLI. When you run PHPUnit, Pest, PHPStan, Rector, or Artisan directly in your terminal, colors, formatting, and output are unchanged. This dual-mode behavior keeps human workflows intact while optimizing agent interactions.
How does PAO detect AI coding agents like Claude Code or Cursor?
PAO detects agents through environment signals and CLI flags rather than requiring manual configuration. The detection logic is used to decide whether to emit compact JSON or pass through the original tool output. If detection fails or an unknown agent is present, PAO can fall back to raw output; version 1.1.5 improved this fallback to bypass the formatter entirely.
What Laravel and PHP versions does laravel/pao require?
Laravel PAO requires PHP 8.3 or newer. For Laravel projects, Artisan optimizations require Laravel 12+ so the service provider can be auto-discovered. The underlying testing integrations support PHPUnit 12-13, Pest 4-5, Paratest, PHPStan 1.x, and Rector.
Can I use laravel/pao in a non-Laravel project like Symfony?
Yes. PAO works with any PHP project that uses Composer, including Symfony, Laminas, and vanilla PHP applications. In non-Laravel projects it hooks into PHPUnit, Pest, Paratest, PHPStan, and Rector through Composer's autoloader. The Laravel-specific Artisan output cleaning only applies when a Laravel application and service provider are present.
How can I test or debug PAO's JSON output locally?
You can simulate an agent run by setting the environment variables or CLI flags that PAO uses for detection, then running your usual tool command. The package's GitHub repository and tests include sample JSON outputs you can compare against. If you need the original unstructured output, the JSON payload's raw field preserves it for debugging.
Does laravel/pao add performance overhead or affect production?
PAO is a dev-only dependency and uses lazy loading plus context-aware activation, so runtime impact is minimal; benchmarks cited by the maintainers are under 1% overhead. It does not activate in production because it only responds to detected AI agent contexts. You should still benchmark high-volume suites with 10K+ tests and validate behavior in CI/CD timeouts or crash scenarios.
What are alternatives to laravel/pao and how does it compare?
Alternatives include writing custom JSON parsers for each tool, using native tool flags like PHPUnit's --log-junit, or building agent-specific output wrappers. Laravel PAO's advantage is zero-config support across PHPUnit, Pest, Paratest, PHPStan, Rector, and Artisan in one package. It is maintained under the Laravel organization, and keeping an eye on its changelog is recommended for PHPUnit 14 and future dependency updates.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
vento/laravel-airbrake
wfeller/laravel-batch
maco-studios/mage-os-installer
busarm/armie
siberfx/laravel-logger
kfteam1991/dcat-admin
dashed/dashed-laposta
dashed/dashed-ecommerce-montaportal
dashed/dashed-ecommerce-etsy
neohq/string-blade-compiler
log1x/acf-composer
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core
nodisrupt/laravel-agent
sierratecnologia/media-manager