PHPackages                             laravelplus/commander - 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. [CLI &amp; Console](/categories/cli)
4. /
5. laravelplus/commander

ActiveLibrary[CLI &amp; Console](/categories/cli)

laravelplus/commander
=====================

Command execution tracking and management for Laravel applications

v1.0.0(9mo ago)0230↓100%MITBladePHP ^8.4

Since Jul 24Pushed 5mo agoCompare

[ Source](https://github.com/LaravelPlus/commander)[ Packagist](https://packagist.org/packages/laravelplus/commander)[ RSS](/packages/laravelplus-commander/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

LaravelPlus Commander
=====================

[](#laravelplus-commander)

[![Tests](https://github.com/laravelplus/commander/actions/workflows/tests.yml/badge.svg)](https://github.com/laravelplus/commander/actions)[![Latest Version on Packagist](https://camo.githubusercontent.com/fff0a24b2ddfd415259531847907dd94e8a17fb97e1d90e07bff35d8983226e6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c61726176656c706c75732f636f6d6d616e6465722e737667)](https://packagist.org/packages/laravelplus/commander)[![Total Downloads](https://camo.githubusercontent.com/160b8d64ab85d48726d410d4c24a07554fa3ec122b4a57fda530f68c11737d40/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c61726176656c706c75732f636f6d6d616e6465722e737667)](https://packagist.org/packages/laravelplus/commander)[![Monthly Downloads](https://camo.githubusercontent.com/d448ad35ea6c9d5dc484ab969880eb5d2db1613d0a28f2d102215f9d774598a8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6c61726176656c706c75732f636f6d6d616e6465722e737667)](https://packagist.org/packages/laravelplus/commander)[![License](https://camo.githubusercontent.com/d56a66efb641a3980d4b9e6a0f65444f98fe43cc155a3d8b92fac055e1d8d2a9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6c61726176656c706c75732f636f6d6d616e6465722e737667)](https://github.com/laravelplus/commander/blob/main/LICENSE)[![PHP Version](https://camo.githubusercontent.com/e5a332dd7df40240f7d2f1dff0952420f24f2723cb10b802968e1586df4e23e2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6c61726176656c706c75732f636f6d6d616e6465722e737667)](https://packagist.org/packages/laravelplus/commander)[![Laravel Version](https://camo.githubusercontent.com/cd525f738435c63d71729cf6856896766cff9b1eeb6f0922f52b4c408366352d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31322e782532422d627269676874677265656e2e737667)](https://laravel.com)[![Code Style](https://camo.githubusercontent.com/3228be89f864906adf15243b35e8c354bb3fe91c1c02f070563c5cfbef9f36cf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64652532307374796c652d5053522d2d31322d627269676874677265656e2e737667)](https://www.php-fig.org/psr/psr-12/)[![Coverage](https://camo.githubusercontent.com/b3545ae1bcdb4ea486f71f87b43001e82dd21933bc8035d44601706c851265da/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f7665726167652d3130302532352d627269676874677265656e2e737667)](https://github.com/laravelplus/commander)[![PHP 8.4+](https://camo.githubusercontent.com/bfb98d885e37493cddcc01059ebf02a8872de9da37c12691b8bb6d13fcdca735/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e342532422d626c75652e737667)](https://php.net)[![Vue 3](https://camo.githubusercontent.com/4eb4af2e0a420307e3326ddda1d3bf57b042d448a51309e189663d83057ad005/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5675652d332e782d677265656e2e737667)](https://vuejs.org)[![Tailwind CSS](https://camo.githubusercontent.com/c870ce8c42d77b21cbacf4217a49a2157b40b716f4dee096bacefee16860a2aa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5461696c77696e642d4353532d3338423241432e737667)](https://tailwindcss.com)

A modern Laravel package for tracking and managing command executions with detailed analytics, beautiful UI, and comprehensive command management features.

📋 Requirements
--------------

[](#-requirements)

- **PHP**: 8.4 or higher
- **Laravel**: 12.x or higher
- **Vue.js**: 3.x (included via CDN)
- **Tailwind CSS**: 3.x (included via CDN)

📦 Installation
--------------

[](#-installation)

### Production Installation

[](#production-installation)

For production projects, install via Composer:

```
composer require laravelplus/commander
```

### Development Installation

[](#development-installation)

For development or local projects, add to your `composer.json`:

```
{
    "repositories": [
        {
            "type": "path",
            "url": "packages/laravelplus/commander"
        }
    ],
    "require": {
        "laravelplus/commander": "*"
    }
}
```

Then run:

```
composer install
```

### Setup Steps

[](#setup-steps)

1. **Publish migrations and config:**

```
php artisan vendor:publish --tag=commander-migrations
php artisan vendor:publish --tag=commander-config
```

2. **Run migrations:**

```
php artisan migrate
```

3. **Access the interface:**
    - Visit: `http://your-app.com/admin/commander`
    - Default URL can be configured in `config/commander.php`

⚙️ Configuration
----------------

[](#️-configuration)

The package is highly configurable through the `config/commander.php` file:

### Basic Configuration

[](#basic-configuration)

```
return [
    'enabled' => env('COMMANDER_ENABLED', true),

    // Interface Configuration
    'url' => env('COMMANDER_URL', 'admin/commander'),
    'route_prefix' => env('COMMANDER_ROUTE_PREFIX', 'admin'),
    'route_name_prefix' => env('COMMANDER_ROUTE_NAME_PREFIX', 'commander'),
    'middleware' => env('COMMANDER_MIDDLEWARE', ['auth', 'web']),

    // Tracking Configuration
    'track_output' => env('COMMANDER_TRACK_OUTPUT', true),
    'track_arguments' => env('COMMANDER_TRACK_ARGUMENTS', true),
    'track_options' => env('COMMANDER_TRACK_OPTIONS', true),
    'track_execution_time' => env('COMMANDER_TRACK_EXECUTION_TIME', true),
    'track_user' => env('COMMANDER_TRACK_USER', true),

    // Storage Configuration
    'max_output_length' => env('COMMANDER_MAX_OUTPUT_LENGTH', 10000),
    'retention_days' => env('COMMANDER_RETENTION_DAYS', 90),
];
```

### Command Management Configuration

[](#command-management-configuration)

```
// Commands to ignore from tracking (still appear in interface)
'ignored_commands' => [
    'schedule:run',
    'queue:work',
    'queue:listen',
    'migrate:*',
    'db:seed',
    'config:cache',
    'route:cache',
    'view:cache',
],

// Commands to exclude from interface (completely hidden)
'excluded_commands' => [
    'vendor:*',
    'package:*',
    'tinker',
    'serve',
    'test:*',
    'dusk:*',
    'make:*',
    'stub:*',
    'clear-compiled',
    'down',
    'up',
    'env',
    'key:generate',
    'optimize',
    'optimize:clear',
    'config:clear',
    'route:clear',
    'view:clear',
    'cache:clear',
    'cache:forget',
    'cache:table',
    'session:table',
    'queue:table',
    'queue:failed-table',
    'queue:batches-table',
    'notifications:table',
    'event:generate',
    'listener:generate',
    'mail:make',
    'middleware:make',
    'provider:make',
    'request:make',
    'resource:make',
    'rule:make',
    'seeder:make',
    'test:make',
    'channel:make',
    'command:make',
    'component:make',
    'controller:make',
    'event:make',
    'exception:make',
    'factory:make',
    'job:make',
    'listener:make',
    'mail:make',
    'middleware:make',
    'model:make',
    'notification:make',
    'observer:make',
    'policy:make',
    'provider:make',
    'request:make',
    'resource:make',
    'rule:make',
    'seeder:make',
    'test:make',
],

// Commands that appear but cannot be executed (read-only)
'disabled_commands' => [
    'migrate:fresh',
    'migrate:refresh',
    'migrate:reset',
    'db:wipe',
    'config:clear',
    'route:clear',
    'view:clear',
    'cache:clear',
    'optimize:clear',
    'event:clear',
    'queue:restart',
    'queue:flush',
    'queue:forget',
    'queue:retry',
    'queue:retry-batch',
    'queue:work',
    'queue:listen',
    'schedule:run',
    'schedule:list',
    'schedule:test',
    'schedule:work',
    'vendor:publish',
    'vendor:install',
    'vendor:update',
    'package:discover',
    'package:clear-cache',
    'package:optimize',
    'package:cache',
    'package:config',
    'package:route',
    'package:view',
    'package:lang',
    'package:migrate',
    'package:seed',
    'package:publish',
    'package:install',
    'package:update',
    'package:uninstall',
    'package:list',
    'package:show',
    'package:outdated',
    'package:update',
    'package:install',
    'package:remove',
    'package:require',
    'package:require-dev',
    'package:update',
    'package:install',
    'package:remove',
    'package:require',
    'package:require-dev',
],
```

🧪 Testing
---------

[](#-testing)

The package includes comprehensive test coverage with 54 tests and 166 assertions:

```
# Run all tests
php vendor/bin/phpunit

# Run specific test suites
php vendor/bin/phpunit --testsuite=Unit
php vendor/bin/phpunit --testsuite=Feature

# Run with coverage report
php vendor/bin/phpunit --coverage-html coverage/
```

### Test Coverage

[](#test-coverage)

- ✅ **Unit Tests**: 51 tests covering all action classes, controllers, and services
- ✅ **Feature Tests**: 3 tests covering API endpoints and dashboard functionality
- ✅ **Database Tests**: Full database testing with SQLite in-memory database
- ✅ **Mock Testing**: Comprehensive mocking of dependencies
- ✅ **Error Handling**: Tests for all error scenarios and edge cases
- ✅ **PHPUnit 11**: Latest testing framework with improved performance

### Test Structure

[](#test-structure)

```
tests/
├── Feature/
│   └── DashboardTest.php          # API endpoint tests
├── Unit/
│   ├── Http/
│   │   ├── Actions/
│   │   │   ├── BaseActionTest.php
│   │   │   ├── GetCommandsActionTest.php
│   │   │   ├── RunCommandActionTest.php
│   │   │   ├── GetDashboardStatsActionTest.php
│   │   │   ├── RetryCommandActionTest.php
│   │   │   ├── ShowDashboardActionTest.php
│   │   │   ├── GetRecentExecutionsActionTest.php
│   │   │   └── SearchCommandsActionTest.php
│   │   └── Controllers/
│   │       └── CommandsControllerTest.php
│   └── TestCase.php               # Base test case
└── phpunit.xml                    # Test configuration

```

�� URL Configuration
--------------------

[](#-url-configuration)

You can customize the commander interface URL by setting the `COMMANDER_URL` environment variable:

```
# Default: http://127.0.0.1:8000/admin/commander
COMMANDER_URL=admin/commander

# Custom URL examples:
COMMANDER_URL=admin/tools/commands
COMMANDER_URL=management/command-center
COMMANDER_URL=system/command-executor
```

✨ Features
----------

[](#-features)

### 🎯 Core Functionality

[](#-core-functionality)

- ✅ **Command Execution Tracking**: Track when commands were last run with detailed metrics
- ✅ **Execution History**: View detailed history of all command executions with search and filtering
- ✅ **Performance Analytics**: Track execution times, success rates, and performance trends
- ✅ **User Tracking**: Track which user executed each command with audit trail
- ✅ **Real-time Interface**: Modern Vue 3 powered interface with real-time updates

### 🎨 User Interface

[](#-user-interface)

- ✅ **Beautiful Modern UI**: Clean, responsive design with Tailwind CSS
- ✅ **Command Arguments Support**: Dynamic forms for commands with arguments and options
- ✅ **Confirmation Dialogs**: Safety-first approach with confirmation before execution
- ✅ **Improved Modals**: Better modal design that doesn't get cut off
- ✅ **Visual Indicators**: Clear status indicators for command states
- ✅ **Responsive Design**: Works perfectly on desktop, tablet, and mobile

### 🔧 Command Management

[](#-command-management)

- ✅ **Disabled Commands**: Mark commands as disabled (read-only) in the interface
- ✅ **Excluded Commands**: Completely hide commands from the interface
- ✅ **Pattern Matching**: Support for wildcard patterns in command filtering
- ✅ **Command Categories**: Organize commands by namespace/category
- ✅ **Search &amp; Filter**: Powerful search and filtering capabilities

### 📊 Analytics &amp; Monitoring

[](#-analytics--monitoring)

- ✅ **Dashboard Statistics**: Overview of command execution metrics
- ✅ **Activity Monitoring**: Real-time activity feed with filtering
- ✅ **Failed Command Tracking**: Dedicated interface for failed commands
- ✅ **Retry Functionality**: Retry failed commands with original parameters
- ✅ **Schedule Management**: Interface for managing scheduled commands

### ⚙️ Configuration &amp; Security

[](#️-configuration--security)

- ✅ **Highly Configurable**: Extensive configuration options
- ✅ **Security Features**: CSRF protection, user authentication
- ✅ **Output Storage**: Store command output with configurable limits
- ✅ **Retention Policy**: Automatic cleanup of old execution records
- ✅ **Environment Support**: Different settings for different environments

🎯 Usage
-------

[](#-usage)

### Accessing the Interface

[](#accessing-the-interface)

Once installed, you can access the commander interface at:

```
http://your-app.com/admin/commander

```

### Interface Features

[](#interface-features)

#### 📋 Command List

[](#-command-list)

- View all available commands with their descriptions
- See last execution time and status
- Filter by category or search by name
- Execute commands with confirmation dialog

#### ⚙️ Command Arguments

[](#️-command-arguments)

- Dynamic forms for commands with arguments
- Support for required and optional arguments
- Default value handling
- Option flags and values

#### 🔄 Execution History

[](#-execution-history)

- Detailed execution history for each command
- Success/failure status tracking
- Execution time and output storage
- User tracking for audit purposes

#### 📊 Analytics Dashboard

[](#-analytics-dashboard)

- Overview of command execution metrics
- Success rate statistics
- Popular commands tracking
- Recent activity feed

#### ❌ Failed Commands

[](#-failed-commands)

- Dedicated interface for failed commands
- Retry functionality with original parameters
- Error analysis and debugging
- Bulk retry operations

#### ⏰ Schedule Management

[](#-schedule-management)

- Interface for managing scheduled commands
- Next run time calculations
- Schedule status monitoring
- Manual execution of scheduled commands

### Helper Functions

[](#helper-functions)

The package provides helper functions for easy access:

```
// Generate commander URL
$url = commander_url(); // http://127.0.0.1:8000/admin/commander
$url = commander_url('list'); // http://127.0.0.1:8000/admin/commander/list

// Generate commander routes
$route = commander_route('index'); // commander.index
$route = commander_route('run', ['command' => 'test']); // commander.run

// Check if commander is enabled
if (commander_enabled()) {
    // Commander functionality is available
}
```

### Manual Tracking

[](#manual-tracking)

You can also manually track command executions:

```
use LaravelPlus\Commander\Traits\TracksCommandExecution;

class YourController extends Controller
{
    use TracksCommandExecution;

    public function runCommand(Request $request)
    {
        $commandName = 'check:password-expiry';
        $arguments = ['--batch-size=10'];
        $options = ['--delay=2'];

        // Start tracking
        $this->startTracking($commandName, $arguments, $options);

        try {
            // Execute your command
            $result = $this->executeCommand($commandName, $arguments, $options);

            // Complete tracking with success
            $this->completeTracking(true, 0, $result['output']);

            return response()->json($result);
        } catch (Exception $e) {
            // Complete tracking with failure
            $this->completeTracking(false, 1, $e->getMessage());
            throw $e;
        }
    }
}
```

### Querying Execution Data

[](#querying-execution-data)

```
use LaravelPlus\Commander\Models\CommandExecution;

// Get last execution time for a command
$lastExecution = CommandExecution::getLastExecutionTime('check:password-expiry');

// Get execution statistics
$stats = CommandExecution::getCommandStats('check:password-expiry', 30);

// Get recent executions
$recentExecutions = CommandExecution::recent(7)->get();

// Get failed executions
$failedExecutions = CommandExecution::failed()->get();
```

🔌 API Endpoints
---------------

[](#-api-endpoints)

The package provides several API endpoints for managing command executions:

### Get Commands with History

[](#get-commands-with-history)

```
GET /admin/commander/api/list
```

Returns all commands with their last execution time and statistics.

### Get Command History

[](#get-command-history)

```
GET /admin/commander/api/{commandName}/history
```

Returns paginated history of executions for a specific command.

### Get Command Statistics

[](#get-command-statistics)

```
GET /admin/commander/api/{commandName}/stats
```

🤝 Contributing
--------------

[](#-contributing)

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.

### Development Setup

[](#development-setup)

```
# Clone the repository
git clone https://github.com/laravelplus/commander.git

# Install dependencies
composer install

# Run tests
php vendor/bin/phpunit

# Run code style checks
./vendor/bin/pint
```

### Pull Request Process

[](#pull-request-process)

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Make your changes
4. Add tests for new functionality
5. Ensure all tests pass (`php vendor/bin/phpunit`)
6. Commit your changes (`git commit -m 'Add some amazing feature'`)
7. Push to the branch (`git push origin feature/amazing-feature`)
8. Open a Pull Request

📄 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

🙏 Acknowledgments
-----------------

[](#-acknowledgments)

- Built with [Laravel 12+](https://laravel.com)
- UI powered by [Vue 3](https://vuejs.org)
- Styled with [Tailwind CSS](https://tailwindcss.com)
- Testing with [PHPUnit](https://phpunit.de)
- Requires [PHP 8.4+](https://php.net)

📞 Support
---------

[](#-support)

- **Issues**: [GitHub Issues](https://github.com/laravelplus/commander/issues)
- **Discussions**: [GitHub Discussions](https://github.com/laravelplus/commander/discussions)
- **Documentation**: [Wiki](https://github.com/laravelplus/commander/wiki)

---

**Made with ❤️ by the LaravelPlus Team**

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance65

Regular maintenance activity

Popularity14

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

297d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e4629de002c40aef796e5b320091892f0b7b35b62497260c52cef3eb721eed1?d=identicon)[Nejcc](/maintainers/Nejcc)

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/laravelplus-commander/health.svg)

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

###  Alternatives

[bestmomo/nice-artisan

Web interface for Laravel Artisan

215149.3k](/packages/bestmomo-nice-artisan)[christophrumpel/laravel-command-file-picker

This package lets a user pick a file or class from a list during a Laravel command.

1077.1k2](/packages/christophrumpel-laravel-command-file-picker)[sunaoka/laravel-facade-generator

Provide command line generation of facade layer files.

171.9k](/packages/sunaoka-laravel-facade-generator)

PHPackages © 2026

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