New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

nikolaynesov/laravel-command-assistant

Laravel plugin to allow GPT-triggered command execution with authorization and audit logging
2,141
Install
composer require nikolaynesov/laravel-command-assistant
Latest Version:0.1.1
PHP:^8.2
Laravel:11 · 12 · 13
Older releases:10
License:MIT
Last Updated:Jun 8, 2026
Links: GitHub  ·  Packagist
Maintainer: nikolaynesov

Laravel Command Assistant

A secure Laravel plugin that allows GPT-based interfaces to execute approved artisan commands only. All commands must define the --laravel-assistant option to be eligible.


✨ Features

  • ✅ Restricts GPT to safe, whitelisted commands
  • ✅ Only runs commands explicitly designed for GPT usage
  • ✅ Logs all executions with user/email
  • ✅ Supports GPT plugin metadata files for .well-known
  • ✅ No risk of overwriting host Laravel config or routes

🚀 Installation

In your Laravel project:

composer require nikolaynesov/laravel-command-assistant

🛠️ Publish Assets

To publish the config file and plugin metadata:

php artisan vendor:publish --tag=laravel-command-assistant

This will publish:

From (package) To (your app)
config/command-assistant.php config/command-assistant.php
public/.well-known/ai-plugin.command-assistant.json public/vendor/laravel-command-assistant/.well-known/ai-plugin.json
public/.well-known/openapi.command-assistant.yaml public/vendor/laravel-command-assistant/.well-known/openapi.yaml

📁 How to Enable GPT Plugin

To make your assistant plugin work with GPT:

  1. Create a .well-known/ folder in your app’s public/ directory if it doesn't exist.

  2. Copy files from the published vendor directory:

cp public/vendor/laravel-command-assistant/.well-known/* public/.well-known/

✅ This avoids overwriting any .well-known files from other plugins you may already have.

  1. Your plugin should now be reachable at:
https://your-domain.com/.well-known/ai-plugin.json
https://your-domain.com/.well-known/openapi.yaml

✏️ Making Commands GPT-Safe

To allow a Laravel command to be executed via the assistant, define this option:

protected $signature = 'your:command {--laravel-assistant}';

Or, using Symfony input directly:

$this->addOption('laravel-assistant', null, InputOption::VALUE_NONE, 'Assistant execution enabled');

🧠 The flag does nothing functionally — it’s a safety requirement for access.


🔐 Security

  • Requires valid Bearer token via Authorization: Bearer <key>
  • Command is rejected unless it:
    • Exists in the app
    • Defines the --laravel-assistant option

📝 License

MIT © Nikolay Nesov

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

407,699,310 4,663

Version History

Version Released PHP Laravel License
0.1.1 ^8.2 ^11.0|^12.0|^13.0 MIT
0.0.4 >=8.1 ^10.0|^11.0 MIT
0.0.2 >=8.1 ^10.0|^11.0 MIT
0.0.1 >=8.1 ^10.0|^11.0 MIT