Search by

johwi-studio / artisan-ui

johwi-studio

A lightweight web UI to browse and run Laravel Artisan commands without the CLI.

Package info

github.com/johwi-studio/artisan-ui

pkg:composer/johwi-studio/artisan-ui

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.1.0 2026-11-28 22:12 UTC

This package is auto-updated.

Last update: 2026-11-28 22:21:18 UTC


README

A lightweight web UI for Laravel's Artisan commands. Browse every command grouped by purpose, fill in the arguments and options in a form, and run it from the browser without opening a terminal.

  • One Blade view with inline CSS and vanilla JS. No build step and no front-end dependencies.
  • Groups such as Database, Cache & Optimization, Code Generation and Queue & Jobs are set in the config, so you can rename or add them.
  • Forms are generated from each command's arguments and options, with a live preview of the equivalent php artisan … line.
  • Coloured output, exit code and duration, plus a per-browser history of recent runs.
  • Access is restricted by environment, IP allowlist, gate, or your own callback.
  • Long-running and interactive commands are excluded by default, and dangerous commands ask for confirmation first.
  • Each run is logged to your log channel with the command, parameters, exit code, user ID and IP.

Installation

composer require johwi-studio/artisan-ui
php artisan vendor:publish --tag=artisan-ui-config

Then open https://your-app.test/artisan-ui. By default the UI is only enabled in the local environment.

Configuration

All options live in config/artisan-ui.php.

Key Default Purpose
enabled true only when APP_ENV=local Registers the routes at all (ARTISAN_UI_ENABLED)
path artisan-ui URI prefix (ARTISAN_UI_PATH)
domain null Serve from a specific (sub)domain (ARTISAN_UI_DOMAIN)
middleware ['web'] Middleware for all routes. Add auth to require login
access.environments ['local'] Allowed app environments ([] = any)
access.ips [] IP / CIDR allowlist ([] = any)
access.gate viewArtisanUi Gate checked when it is defined
commands.only [] If set, only these commands are available (supports *)
commands.exclude tinker, serve, queue:work, … Never shown or runnable
commands.dangerous migrate, migrate:fresh, db:wipe, down, … Require confirmation before running (checked by the server too)
groups see config Group name → list of command patterns
fallback_to_namespace true Unmatched foo:bar commands go to group Foo
fallback_group Other Group for everything else
time_limit 300 set_time_limit() for each run (null = keep PHP's)
log.enabled / log.channel true / default channel Audit log of every run
log.redact *key*, *password*, *secret*, *token* Parameter names whose values are logged as ********
title Artisan UI Page title

Access control

A request has to pass all of the configured checks:

  1. The app environment is in access.environments.
  2. The client IP matches access.ips, if that list is set.
  3. If the viewArtisanUi gate is defined, the user must pass it. If no gate is defined, access is only granted in local.

To enable it on a staging server for admins only:

// .env
ARTISAN_UI_ENABLED=true

// config/artisan-ui.php
'middleware' => ['web', 'auth'],
'access' => [
    'environments' => ['local', 'staging'],
    'ips' => ['203.0.113.0/24'],
    'gate' => 'viewArtisanUi',
],

// AppServiceProvider::boot()
Gate::define('viewArtisanUi', fn ($user) => $user->is_admin);

Or replace the built-in rules with your own callback:

use JohwiStudio\ArtisanUi\ArtisanUi;

ArtisanUi::auth(fn ($request) => $request->user()?->hasRole('developer'));

Warning: anyone who can open this page can run migrations, clear caches or take the app down. Keep it disabled in production unless it's protected by authentication, a gate and, ideally, an IP allowlist.

Restricting commands

'commands' => [
    'only' => ['cache:*', 'config:*', 'route:*', 'view:*', 'optimize*', 'migrate:status', 'queue:retry'],
],

Custom groups

The first group with a matching pattern wins.

'groups' => [
    'Deploy' => ['optimize', 'migrate', 'storage:link'],
    'Billing' => ['billing:*', 'invoices:*'],
],

How commands are executed

Commands run in-process through Artisan::call(). --no-interaction is always added, so prompts get their default answer and never block. Laravel's "confirmable" commands (for example migrate in production) need the --force option, which you can tick in the form.

Because each run happens inside a single HTTP request, long-running or process-spawning commands (queue:work, schedule:work, serve, dev, install:*, …) are excluded by default.

Inputs that accept multiple values take one value per line, so a value can contain spaces or commas.

Customising the view

php artisan vendor:publish --tag=artisan-ui-views

This copies the view to resources/views/vendor/artisan-ui/index.blade.php.

Development

composer install
composer test
vendor/bin/testbench serve   # preview at http://127.0.0.1:8000/artisan-ui

License

MIT