binarybuilds/filament-command-runner

filament-command-runner is a Filament plugin that allows users to run artisan and shell commands directly from the Filament admin panel. All commands are executed in the background so users don't have to wait for them to finish. They can return later to view the output or optionally terminate a runn

Fund package maintenance!
srinathreddydudi

Installs: 60

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 1

pkg:composer/binarybuilds/filament-command-runner

v1.1.0 2025-10-11 04:09 UTC

This package is auto-updated.

Last update: 2025-10-13 10:51:21 UTC


README

Run artisan and shell commands in the background from your Filament admin panel.

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Overview

filament-command-runner is a Filament plugin that allows users to run artisan and shell commands directly from the Filament admin panel. All commands are executed in the background so users don't have to wait for them to finish. They can return later to view the output or optionally terminate a running command midway.

The plugin also keeps a detailed history of past runs including:

  • Command executed
  • User who initiated the run
  • Start time
  • Duration
  • Exit code
  • Command output

Screenshots

Command Index Command Run Command Running Kill Command Command Output

Installation

You can install the plugin via composer:

composer require binarybuilds/filament-command-runner

Usage

Register the plugin in your Filament panel service provider:

use BinaryBuilds\CommandRunner\CommandRunnerPlugin;

$panel->plugin(CommandRunnerPlugin::make());

Customizations

  1. Command Validation

You can define custom validation logic using the validateCommand() method. This is useful for restricting which commands can be run:

use Illuminate\Support\Str;

$panel->plugin(
    CommandRunnerPlugin::make()->validateCommand(function (string $attribute, string $value, \Closure $fail) {
        if (!Str::startsWith($value, 'php artisan')) {
            $fail("You can only run artisan commands");
        }
    })
);
  1. Delete Command History

Control who can delete command history entries using a boolean or closure with canDeleteCommandHistory():

$panel->plugin(
    CommandRunnerPlugin::make()->canDeleteCommandHistory(fn ($user) => $user->isAdmin())
);
  1. Purge Old Command History

Schedule the following artisan command to purge command history entries daily:

php artisan command-runner:purge-history

By default, it removes command runs older than 30 days. You can specify a custom duration like this:

php artisan command-runner:purge-history 7

This example will purge command runs older than 7 days.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.