Provides console commands for managing the ADP debug system.
- Composer:
app-dev-panel/cli - Namespace:
AppDevPanel\Cli\ - PHP: 8.4+
- Dependencies:
app-dev-panel/kernel,app-dev-panel/api,app-dev-panel/mcp-server,app-dev-panel/frontend-assets, Symfony Console, Symfony Process
src/
├── Command/
│ ├── DebugServerCommand.php # Start debug socket server (dev)
│ ├── DebugResetCommand.php # Clear debug data (debug:reset)
│ ├── DebugServerBroadcastCommand.php # Broadcast test messages (dev:broadcast)
│ ├── DebugQueryCommand.php # Query stored debug data (debug:query)
│ ├── DebugSummaryCommand.php # Show brief summary of debug entry (debug:summary)
│ ├── DebugDumpCommand.php # View dumped objects (debug:dump)
│ ├── DebugTailCommand.php # Watch entries in real-time (debug:tail)
│ ├── ServeCommand.php # Start HTTP debug server (serve)
│ ├── McpServeCommand.php # Start MCP server for AI integration (mcp:serve)
│ ├── FrontendUpdateCommand.php # Download latest frontend build (frontend:update)
│ ├── InspectConfigCommand.php # Inspect application config (inspect:config)
│ ├── InspectDatabaseCommand.php # Inspect database schema/data (inspect:db)
│ └── InspectRoutesCommand.php # Inspect application routes (inspect:routes)
└── Server/
└── server-router.php # Router for built-in PHP server (bootstraps API)
tests/
└── Unit/
└── Command/
├── DebugDumpCommandTest.php
├── DebugQueryCommandTest.php
├── DebugServerBroadcastCommandTest.php
├── DebugServerCommandTest.php
├── DebugSummaryCommandTest.php
├── DebugTailCommandTest.php
├── FrontendUpdateCommandTest.php
├── InspectConfigCommandTest.php
├── InspectDatabaseCommandTest.php
├── InspectRoutesCommandTest.php
├── McpServeCommandTest.php
├── ResetCommandTest.php
└── ServeCommandTest.php
Starts a UDP socket server that listens for real-time debug messages from the application.
php yii dev # Default: 0.0.0.0:8890
php yii dev -a 127.0.0.1 -p 9000 # Custom address and portThe server receives and categorizes messages:
MESSAGE_TYPE_VAR_DUMPER— Variable dumpsMESSAGE_TYPE_LOGGER— Log messages- Plain text messages
Handles SIGINT (Ctrl+C) for graceful shutdown.
Stops the debugger and clears all stored debug data.
php yii debug:resetCalls Debugger::stop() and StorageInterface::clear().
Sends test messages to all connected debug server clients. Useful for verifying connectivity.
php yii dev:broadcast # Default: "Test message"
php yii dev:broadcast -m "Hello world" # Custom messageBroadcasts in both MESSAGE_TYPE_LOGGER and MESSAGE_TYPE_VAR_DUMPER formats.
Query stored debug data from the CLI. Subcommands: list, view.
debug:query list # List recent entries (default 20)
debug:query list --limit=5 # Limit entries
debug:query list --json # Raw JSON output
debug:query view <id> # Full entry data
debug:query view <id> -c <CollectorFQCN> # Specific collector dataUses CollectorRepositoryInterface to read from storage.
Starts a standalone HTTP server using PHP built-in server, serving the ADP API directly. When --frontend-path is omitted, the command auto-resolves the bundle via AppDevPanel\FrontendAssets\FrontendAssets::path() (from app-dev-panel/frontend-assets), so the full panel SPA is served at / out of the box. When a frontend path is available, the process is launched with php -S host:port -t <frontendPath> so the built-in server resolves static files from the bundle directory.
serve # Default: 127.0.0.1:8888, panel auto-resolved from FrontendAssets
serve --host=0.0.0.0 --port=9000 # Custom host/port
serve --storage-path=/path/to/debug/data # Custom storage
serve --frontend-path=/path/to/built/assets # Override bundle path (e.g. local dev build)Fetches frontend-dist.zip from the latest GitHub Release and extracts it into --path. The archive contains both the panel SPA (index.html, bundle.js, assets/) and the toolbar widget (toolbar/bundle.js, toolbar/bundle.css). Intended for PHAR users or environments where Composer is not the update vehicle; composer-based installs update via composer update app-dev-panel/frontend-assets.
frontend:update check # Show current vs latest version
frontend:update check --json # Machine-readable output
frontend:update download --path=/path/to/dist # Install latest panel + toolbar buildWrites a .adp-version file next to index.html so subsequent check invocations can compare installed vs latest. Emits a warning if the installed directory has index.html but no toolbar/bundle.js — typical for archives produced before toolbar was bundled. The GitHub API call is capped at 10s; the asset download at 30s.
bin/adp is the standalone CLI entry point (vendor/bin/adp after Composer install). Registers ServeCommand, FrontendUpdateCommand, and (when app-dev-panel/testing is installed) DebugFixturesCommand.
Autoloader lookup order (first hit wins):
$GLOBALS['_composer_autoload_path']— set by the Composer-generatedvendor/bin/adpproxy, points atvendor/autoload.php.__DIR__ . '/../../../autoload.php'— Composer install layout (vendor/app-dev-panel/cli/bin/→vendor/autoload.php).__DIR__ . '/../../../vendor/autoload.php'— monorepo layout (libs/Cli/bin/→ rootvendor/autoload.php).__DIR__ . '/../vendor/autoload.php'— standalone checkout with its ownvendor/.
Symfony Console 8 removed Application::add() in favour of addCommand(). The binary wraps command registration in a callable that probes method_exists($app, 'addCommand') and falls back to add() on 6.x/7.x — so the full range declared in composer.json (symfony/console: ^6 | ^7 | ^8) is supported.
Starts an MCP (Model Context Protocol) server over stdio, exposing ADP debug data to AI assistants.
mcp:serve --storage-path=/path/to/debug/data # Required: path to debug storageCreates FileStorage and McpToolRegistry, then runs McpServer over StdioTransport.
composer test # Runs PHPUnit