PHPackages                             skylence/laravel-artisan-agent-output - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. skylence/laravel-artisan-agent-output

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

skylence/laravel-artisan-agent-output
=====================================

Agent-optimized output for Laravel Artisan commands

v0.2.0(2mo ago)03721MITPHPPHP ^8.2

Since Apr 9Pushed 2w agoCompare

[ Source](https://github.com/skylence-be/laravel-artisan-agent-output)[ Packagist](https://packagist.org/packages/skylence/laravel-artisan-agent-output)[ RSS](/packages/skylence-laravel-artisan-agent-output/feed)WikiDiscussions main Synced 2w ago

READMEChangelogDependencies (14)Versions (3)Used By (1)

Artisan Agent Output
====================

[](#artisan-agent-output)

Agent-optimized output for Laravel Artisan commands. Detects AI coding agents and replaces verbose, decorated output with clean text or structured JSON.

The Problem
-----------

[](#the-problem)

AI coding agents waste tokens on Artisan's decorative output — ANSI colors, box-drawing tables, progress bars, Unicode symbols. None of this is useful to an LLM.

**Before (444 tokens):**

```
 ┌──────────────────────────────────────────────────────┐
 │                    Application                        │
 ├──────────────────────────────────────────────────────┤
 │ Application Name ····················· Laravel        │
 │ Laravel Version ······················ 13.2.0         │
 │ PHP Version ·························· 8.4.19         │
 │ Environment ·························· local          │
 │ Debug Mode ··························· ENABLED        │
 └──────────────────────────────────────────────────────┘

```

**After (38 tokens):**

```
{"environment":{"application_name":"Laravel","laravel_version":"13.2.0","php_version":"8.4.19","environment":"local","debug_mode":true}}
```

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

[](#installation)

```
composer require skylence/laravel-artisan-agent-output
```

Zero config. The package auto-discovers its service provider and activates only when an AI agent is detected (Claude Code, Cursor, Devin, Gemini CLI, etc.). Humans see normal output.

How It Works
------------

[](#how-it-works)

### Layer 1: Cleaned Text (all commands)

[](#layer-1-cleaned-text-all-commands)

Strips ANSI colors, box-drawing characters, decorative Unicode, and excess whitespace from all Artisan output. Works with every command automatically.

### Layer 2: Structured JSON (10 core commands)

[](#layer-2-structured-json-10-core-commands)

For commands with registered parsers, the cleaned text is suppressed entirely and replaced with compact structured JSON. Ships with parsers for 10 core Laravel commands.

Supported Commands
------------------

[](#supported-commands)

CommandJSON Output`about`App name, versions, environment, debug, drivers`migrate:status`Migrations with name, status, batch number`route:list`Routes with method, URI, name, action, middleware, domain, constraints, exclusions`db:show`Connection info, tables with sizes`db:table`Columns with types, indexes, foreign keys`schedule:list`Scheduled tasks with cron expression, next run time`model:show`Attributes, relations, casts, events, observers`queue:failed`Failed jobs with ID, connection, queue, exception`event:list`Events with registered listeners`config:show`Configuration key-value pairsAll other commands get cleaned text output (Layer 1).

JSON Output Examples
--------------------

[](#json-output-examples)

### `php artisan migrate:status`

[](#php-artisan-migratestatus)

```
{
  "total": 96,
  "ran": 96,
  "pending": 0,
  "migrations": [
    {"name": "0001_01_01_000000_create_users_table", "status": "ran", "batch": 1},
    {"name": "0001_01_01_000001_create_cache_table", "status": "ran", "batch": 1}
  ]
}
```

### `php artisan route:list`

[](#php-artisan-routelist)

```
{
  "total": 402,
  "routes": [
    {
      "method": "GET|HEAD",
      "uri": "dashboard/team/settings",
      "name": "dashboard.team.settings.index",
      "action": "Closure",
      "middleware": ["web", "LogRequests", "EnsureTeamAccess", "CheckApiToken"]
    },
    {
      "method": "GET|HEAD",
      "uri": "tenant/dashboard",
      "name": "tenant.dashboard",
      "action": "Closure",
      "middleware": ["web"],
      "domain": "{tenant}.example.com"
    },
    {
      "method": "GET|HEAD",
      "uri": "admin/reports/{type}",
      "name": "admin.reports.show",
      "action": "Closure",
      "middleware": ["web"],
      "wheres": {"type": "sales|inventory|finance"}
    },
    {
      "method": "GET|HEAD",
      "uri": "light",
      "name": "light",
      "action": "Closure",
      "middleware": ["web", "LogRequests"],
      "without_middleware": ["CheckApiToken", "EnsureTeamAccess"]
    }
  ]
}
```

Route entries include `domain`, `wheres`, and `without_middleware` only when present.

### `php artisan schedule:list`

[](#php-artisan-schedulelist)

```
{
  "total": 14,
  "tasks": [
    {"command": "backup:run --only-db", "expression": "0 1 * * *", "description": "", "next_run": "2026-04-10 01:00:00"},
    {"command": "exact:refresh-tokens", "expression": "*/5 * * * *", "description": "exact:refresh-tokens", "next_run": "2026-04-09 13:40:00"}
  ]
}
```

### `php artisan about`

[](#php-artisan-about)

```
{
  "environment": {
    "application_name": "Laravel",
    "laravel_version": "13.2.0",
    "php_version": "8.4.19",
    "environment": "local",
    "debug_mode": true,
    "url": "myapp.test",
    "timezone": "Europe/Brussels",
    "locale": "en"
  },
  "cache": {"config": false, "events": false, "routes": false, "views": false},
  "drivers": {"broadcasting": "log", "cache": "redis", "database": "pgsql", "queue": "redis", "session": "redis"}
}
```

Configuration
-------------

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=artisan-agent-output-config
```

```
return [
    // Set to false to disable JSON parsers (cleaned text only for all commands)
    'json' => true,

    // Commands to exclude from JSON parsing (will still get cleaned text)
    'exclude' => [],
];
```

Registering Custom Parsers
--------------------------

[](#registering-custom-parsers)

Third-party packages can register their own JSON parsers:

```
use Skylence\ArtisanAgentOutput\Facades\AgentOutput;

// In your service provider's boot() method:
AgentOutput::register('horizon:status', HorizonStatusParser::class);
```

Implement the `CommandParser` interface:

```
use Illuminate\Contracts\Foundation\Application;
use Skylence\ArtisanAgentOutput\Contracts\CommandParser;

class HorizonStatusParser implements CommandParser
{
    public function parse(Application $app): array
    {
        $horizon = $app->make('horizon');

        return [
            'status' => $horizon->status(),
            'processes' => $horizon->processCount(),
        ];
    }
}
```

Parsers should query Laravel services directly from the container rather than parsing text output.

Kill Switch
-----------

[](#kill-switch)

Set the `AGENT_OUTPUT_DISABLE` environment variable to bypass all processing:

```
AGENT_OUTPUT_DISABLE=1 php artisan about
```

How It Complements Other Tools
------------------------------

[](#how-it-complements-other-tools)

ToolWhat it doesHow it relates**[PAO](https://github.com/nunomaduro/pao)**Optimizes PHPUnit/Pest/PHPStan output for agentsPAO handles test runners, this package handles Artisan**[Laravel Boost](https://github.com/laravel/boost)**MCP server helping agents discover commandsBoost helps agents know *what to run*, this cleans *what comes back*Requirements
------------

[](#requirements)

- PHP 8.3+
- Laravel 12 or 13

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance91

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~3 days

Total

2

Last Release

75d ago

PHP version history (2 changes)v0.1.0PHP ^8.3

v0.2.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ad0eeb3e0f0183e243d7edf649313243750f8048918eb00c9c041c5dc379149?d=identicon)[skylence](/maintainers/skylence)

---

Top Contributors

[![jonasvanderhaegen](https://avatars.githubusercontent.com/u/7755555?v=4)](https://github.com/jonasvanderhaegen "jonasvanderhaegen (38 commits)")

---

Tags

laravelpackagejsonlaravelaiartisanAgentoutput

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/skylence-laravel-artisan-agent-output/health.svg)

```
[![Health](https://phpackages.com/badges/skylence-laravel-artisan-agent-output/health.svg)](https://phpackages.com/packages/skylence-laravel-artisan-agent-output)
```

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

9782.1M162](/packages/laravel-ai)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k14.1M122](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9742.3M121](/packages/roots-acorn)[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M153](/packages/spatie-laravel-health)[sbsaga/toon

🧠 TOON for Laravel — a compact, human-readable, and token-efficient data format for AI prompts &amp; LLM contexts. Perfect for ChatGPT, Gemini, Claude, Mistral, and OpenAI integrations (JSON ⇄ TOON).

6442.4k](/packages/sbsaga-toon)

PHPackages © 2026

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