Skip to content

feat: adds agent reporter#415

Merged
nunomaduro merged 2 commits intomainfrom
feat/agent-option
Jan 5, 2026
Merged

feat: adds agent reporter#415
nunomaduro merged 2 commits intomainfrom
feat/agent-option

Conversation

@nunomaduro
Copy link
Member

@nunomaduro nunomaduro commented Jan 4, 2026

This pull request adds a --format agent that gets automatically used when Pint is executed within OpenCode or Claude Code.

Screenshot 2026-01-03 at 21 37 27

Why:

The default Pint output is designed for humans - colorful, with progress dots and formatted summaries. AI agents need something different: structured JSON they can reliably parse, unambiguous status values like "status":"pass" instead of inferring from formatted text, minimal output that saves context window and reduces token cost, and deterministic results without ANSI colors or formatting noise.

How it works:

  1. When Claude Code runs Pint, it sets the CLAUDECODE environment variable
  2. When OpenCode runs Pint, it sets the OPENCODE environment variable
  3. Pint detects these and automatically switches to the agent format - no flags needed

Output:

{"status":"fail","files":[{"path":"app/Example.php","fixers":["binary_operator_spaces"]}]}
  • status is pass, fail (test mode), or fixed
  • files only shows up when there are issues

Can also be used explicitly with --format agent.

@imhayatunnabi
Copy link

imhayatunnabi commented Jan 4, 2026

Sir, more frindly if you can make it php artisan format or php artisan pint @nunomaduro

#416

@dillingham
Copy link

--format=json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants