PHPackages                             laravel/pao - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. laravel/pao

ActiveLibrary[Framework](/categories/framework)

laravel/pao
===========

Agent-optimized output for PHP testing tools

v1.0.6(1mo ago)6351.4M↓10.8%27[1 issues](https://github.com/laravel/pao/issues)[2 PRs](https://github.com/laravel/pao/pulls)20MITPHPPHP ^8.3CI passing

Since Apr 7Pushed 3d ago5 watchersCompare

[ Source](https://github.com/laravel/pao)[ Packagist](https://packagist.org/packages/laravel/pao)[ RSS](/packages/laravel-pao/feed)WikiDiscussions 1.x Synced 1w ago

READMEChangelog (10)Dependencies (10)Versions (19)Used By (20)

 [![PAO](./art/logo.png)](./art/logo.png)

 [![GitHub Workflow Status (main)](https://github.com/laravel/pao/actions/workflows/tests.yml/badge.svg)](https://github.com/laravel/pao/actions) [![Total Downloads](https://camo.githubusercontent.com/a5ad83215dd27acf593998a0dadcfffacd49c98b77ae410b929361472a677522/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c2f70616f)](https://packagist.org/packages/laravel/pao) [![Latest Version](https://camo.githubusercontent.com/93cd9b62074e09023454756d81eb2fffddedd17b51fa7a551ccaf6f99774f1aa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c2f70616f)](https://packagist.org/packages/laravel/pao) [![License](https://camo.githubusercontent.com/5583de7daf3e1fd5e7444a9d9450237c5d5684368915f941eb2d850c7f84b165/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c61726176656c2f70616f)](https://packagist.org/packages/laravel/pao)

Introduction
------------

[](#introduction)

**Laravel PAO** is agent-optimized output for PHP tools. It works with any PHP project — **Laravel**, **Symfony**, **Laminas**, **vanilla PHP**, or anything else that uses **PHPUnit**, **Pest**, **Paratest**, **PHPStan**, **Rector**, or **Laravel Artisan**.

It detects when your tools are running inside an AI agent — **Claude Code**, **Cursor**, **Devin**, **Gemini CLI**, and others — and replaces the verbose, human-readable output with compact, super minimal, structured JSON. For Laravel Artisan commands, it strips ANSI colors, box-drawing characters, and excess whitespace. Zero config — just install and it works.

Installation
------------

[](#installation)

> **Requires [PHP 8.3+](https://php.net/releases/)** — Works with **PHPUnit 12-13**, **Pest 4-5**, **Paratest**, **PHPStan**, **Rector**, and **Laravel 12+**.

```
composer require laravel/pao --dev
```

That's it. PAO hooks into PHPUnit, Pest, Paratest, PHPStan, and Rector automatically through Composer's autoloader. For Laravel projects, a service provider is auto-discovered to clean Artisan command output.

> **PAO only activates when it detects an AI agent** (Claude Code, Cursor, Devin, Gemini CLI, etc.). When you or your team run tools directly in the terminal, the output is completely unchanged — same colors, same formatting, same experience. Zero impact on human workflows.

Before &amp; After
------------------

[](#before--after)

Your test suite with **1,000 tests** goes from this:

```
PHPUnit 12.5.14 by Sebastian Bergmann and contributors.

.............................................................   61 / 1002 (  6%)
.............................................................  122 / 1002 ( 12%)
...
..........................                                    1002 / 1002 (100%)

Time: 00:00.321, Memory: 46.50 MB

OK (1002 tests, 1002 assertions)

```

To this:

```
{
  "tool": "phpunit",
  "result": "passed",
  "tests": 1002,
  "passed": 1002,
  "duration_ms": 321
}
```

That's up to **99.8% fewer AI tokens**. The output is **constant-size** regardless of how many tests you have — and when tests fail, it includes file paths, line numbers, and failure messages.

Extra output from Pest plugins like `--coverage` or `--profile` is captured, cleaned of ANSI codes and decorations, and included as a `raw` array in the JSON:

```
{
  "tool": "pest",
  "result": "passed",
  "tests": 1002,
  "passed": 1002,
  "duration_ms": 1520,
  "raw": [
    "Http/Controllers/Controller 100.0%",
    "Models/User 0.0%",
    "Total: 33.3 %"
  ]
}
```

### Laravel Artisan

[](#laravel-artisan)

When installed in a Laravel 12+ application, PAO automatically cleans Artisan command output in agent environments — stripping ANSI colors, box-drawing characters, dot separators, and excess whitespace:

```
# Before (without PAO) — 2,111 characters
  Environment ................................................................
  Application Name ................................................... Laravel
  Laravel Version ..................................................... 13.3.0
  PHP Version .......................................................... 8.5.4
  Debug Mode ......................................................... ENABLED

# After (with PAO) — 535 characters
 Environment ..
 Application Name .. Laravel
 Laravel Version .. 13.3.0
 PHP Version .. 8.5.4
 Debug Mode .. ENABLED

```

Up to **75% fewer tokens** on commands like `about`, `db:show`, and `migrate:status` — same information, no decoration.

### PHPStan

[](#phpstan)

PHPStan output is also converted to structured JSON:

```
{
  "tool": "phpstan",
  "result": "failed",
  "errors": 2,
  "error_details": {
    "/app/Http/Controllers/Controller.php": [
      {
        "line": 9,
        "message": "Method Controller::index() should return int but returns string.",
        "identifier": "return.type"
      },
      {
        "line": 14,
        "message": "Call to an undefined method Controller::doesNotExist().",
        "identifier": "method.notFound"
      }
    ]
  }
}
```

### Rector

[](#rector)

Rector is automatically run with its native JSON output format:

```
{
  "tool": "rector",
  "result": "failed",
  "totals": {
    "changed_files": 1,
    "errors": 0
  },
  "file_diffs": [
    {
      "file": "app/Models/User.php",
      "diff": "--- Original\n+++ New\n@@ ...",
      "applied_rectors": [
        "Rector\\Php54\\Rector\\Array_\\LongArrayToShortArrayRector"
      ]
    }
  ],
  "changed_files": [
    "app/Models/User.php"
  ]
}
```

Contributing
------------

[](#contributing)

Thank you for considering contributing to Laravel! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).

Code of Conduct
---------------

[](#code-of-conduct)

In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](https://github.com/laravel/pao/security/policy) on how to report security vulnerabilities.

License
-------

[](#license)

The Laravel PAO is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

66

—

FairBetter than 99% of packages

Maintenance96

Actively maintained with recent releases

Popularity64

Solid adoption and visibility

Community38

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

17

Last Release

40d ago

Major Versions

v0.1.8 → v1.0.02026-04-17

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/463230?v=4)[Taylor Otwell](/maintainers/taylorotwell)[@taylorotwell](https://github.com/taylorotwell)

---

Top Contributors

[![nunomaduro](https://avatars.githubusercontent.com/u/5457236?v=4)](https://github.com/nunomaduro "nunomaduro (73 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![cosmastech](https://avatars.githubusercontent.com/u/42181698?v=4)](https://github.com/cosmastech "cosmastech (2 commits)")[![joetannenbaum](https://avatars.githubusercontent.com/u/2702148?v=4)](https://github.com/joetannenbaum "joetannenbaum (1 commits)")[![MrPunyapal](https://avatars.githubusercontent.com/u/53343069?v=4)](https://github.com/MrPunyapal "MrPunyapal (1 commits)")[![pushpak1300](https://avatars.githubusercontent.com/u/31663512?v=4)](https://github.com/pushpak1300 "pushpak1300 (1 commits)")[![RanaMoizHaider](https://avatars.githubusercontent.com/u/58527494?v=4)](https://github.com/RanaMoizHaider "RanaMoizHaider (1 commits)")[![alimorgaan](https://avatars.githubusercontent.com/u/32411364?v=4)](https://github.com/alimorgaan "alimorgaan (1 commits)")[![takaram](https://avatars.githubusercontent.com/u/18339861?v=4)](https://github.com/takaram "takaram (1 commits)")[![antonkomarev](https://avatars.githubusercontent.com/u/1849174?v=4)](https://github.com/antonkomarev "antonkomarev (1 commits)")[![danielhe4rt](https://avatars.githubusercontent.com/u/6912596?v=4)](https://github.com/danielhe4rt "danielhe4rt (1 commits)")

---

Tags

phptestingphpunitpestPHPStandevaiAgentparatest

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/laravel-pao/health.svg)

```
[![Health](https://phpackages.com/badges/laravel-pao/health.svg)](https://phpackages.com/packages/laravel-pao)
```

###  Alternatives

[spatie/pest-plugin-route-testing

Make sure all routes in your Laravel app are ok

13864.8k](/packages/spatie-pest-plugin-route-testing)[pestphp/pest-plugin-type-coverage

The Type Coverage plugin for Pest PHP.

353.9M966](/packages/pestphp-pest-plugin-type-coverage)[pestphp/pest-plugin-stressless

Stressless plugin for Pest

68943.9k18](/packages/pestphp-pest-plugin-stressless)[ozzie/pest-plugin-nest

Nest Pest PHP tests for better organization and readability

2129.1k](/packages/ozzie-pest-plugin-nest)[alleyinteractive/pest-plugin-wordpress

WordPress Pest Integration

273.9k1](/packages/alleyinteractive-pest-plugin-wordpress)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
