native:plugin:create
Create a new NativePHP Mobile plugin with scaffolding for Android, iOS, and PHP code.Syntax
Arguments
name - The plugin name (e.g.,haptics or vendor/plugin-haptics). Optional, will prompt if not provided.
Options
--namespace=NAME- The plugin namespace--path=PATH- Custom output path--force- Overwrite existing files--with-boost- Generate Boost AI guidelines
Examples
What it creates
composer.json- Composer package definitionnativephp.json- Plugin manifestsrc/- PHP service provider, facade, implementationresources/android/- Kotlin bridge functionsresources/ios/- Swift bridge functionsresources/js/- JavaScript client librarysrc/Events/- Example event classessrc/Commands/- Lifecycle hook commandstests/- Pest test suiteREADME.md- Documentation
native:plugin:register
Register a NativePHP plugin in NativeServiceProvider.Syntax
Arguments
plugin - The plugin package name (e.g.,vendor/plugin-name). Optional for interactive mode.
Options
--remove- Remove the plugin instead of adding it--force- Skip conflict warnings
Examples
What it does
- Adds plugin service provider to
app/Providers/NativeServiceProvider.php - Checks for conflicts (namespace/bridge function collisions)
- Validates plugin is installed via Composer
native:plugin:list
List all installed NativePHP Mobile plugins.Syntax
Options
--json- Output as JSON--all- Show all installed plugins, including unregistered ones
Examples
Output
Shows:- Package name and version
- Namespace
- Number of bridge functions
- Platform support (Android/iOS)
- Registration status
native:plugin:install-agent
Install AI agents for NativePHP plugin development.Syntax
Options
--force- Overwrite existing agent files--all- Install all agents without prompting
Available Agents
- kotlin-android-expert - Deep Android native development
- swift-ios-expert - Deep iOS native development
- js-bridge-expert - JavaScript client-side integration
- plugin-writer - General plugin scaffolding
- plugin-docs-writer - Documentation and Boost guidelines
Examples
native:plugin:uninstall
Uninstall a NativePHP Mobile plugin completely.Syntax
Arguments
plugin - The plugin package name (e.g.,vendor/plugin-name). Required.
Options
--force- Skip confirmation prompts--keep-files- Do not delete the plugin source directory
Examples
What it does
- Unregisters from NativeServiceProvider
- Runs
composer remove - Removes repository from composer.json (if path repository)
- Deletes source directory (unless
--keep-files)
native:plugin:validate
Validate installed NativePHP Mobile plugins or a specific plugin.Syntax
Arguments
path - Path to a specific plugin directory. Optional.Examples
Validation Checks
- composer.json: Valid JSON, correct type, required fields
- nativephp.json: Valid manifest, bridge functions, hooks
- Directory structure: Required directories present
- Bridge functions: Kotlin/Swift implementations exist
- Hooks: Valid hook types and commands
- Assets: Source files exist, correct destinations
- Platform requirements: Minimum version specified
Output
For each plugin:- ✅ OK - No issues
- ⚠️ WARN - Warnings (non-critical)
- ❌ FAIL - Errors (must fix)
native:plugin:make-hook
Create a lifecycle hook command for a NativePHP plugin.Syntax
Arguments
- plugin - Path to the plugin directory. Optional, will prompt.
- hook - Hook type. Optional, will prompt.
Hook Types
pre_compile- Runs before native code is compiledpost_compile- Runs after native code compilationcopy_assets- Copy assets to native projectpost_build- Runs after native build completes
Options
--force- Overwrite existing file
Examples
What it creates
- Command class in
src/Commands/ - Updates
nativephp.jsonwith hook registration - Updates ServiceProvider to register command
Available Helpers
Hook commands extendNativePluginHookCommand with helpers:
native:plugin:boost
Create Boost AI guidelines for a NativePHP plugin.Syntax
Arguments
plugin - The plugin name or path. Optional, will prompt.Options
--force- Overwrite existing guidelines
Examples
What it creates
Createsresources/boost/guidelines/core.blade.php with:
- Installation instructions
- PHP usage examples (Facade, Livewire)
- Available methods documentation
- Event listener examples
- JavaScript usage examples (Vue, React, Inertia)
Benefits
When users install your plugin and runphp artisan boost:install, your guidelines are automatically loaded and available to AI assistants.
Complete Plugin Workflow
1. Create a new plugin
2. Add to your project
Add tocomposer.json:
3. Register the plugin
4. Validate
5. Create hooks (optional)
6. List installed plugins
See also
- Creating Plugins - Plugin development guide
- Plugin Lifecycle - Hook system documentation