Documentation

plugin Command

Manage Frame-Master plugins: list, inspect, validate, and create.

📖 Overview

The plugin command provides tools for managing your plugins.

frame-master plugin <subcommand>
 
Subcommands:
  list              List all installed plugins
  info <name>       Show detailed plugin information
  validate          Validate plugin configuration
  create <name>     Create a new plugin template

📋 plugin list

List all installed plugins in your project.

frame-master plugin list
 
# With verbose output (shows features)
frame-master --verbose plugin list

Example output:

📦 Installed Plugins:
 
1. frame-master-plugin-react-ssr v2.0.0
   Priority: 10
   Features: before_request, request, html_rewrite, serverStart
 
2. frame-master-plugin-session v1.2.0
   Priority: 5
   Features: before_request, after_request
 
3. my-custom-plugin v1.0.0
 
Total: 3 plugins

ℹ️ plugin info

Show detailed information about a specific plugin.

frame-master plugin info <plugin-name>

Example:

frame-master plugin info frame-master-plugin-react-ssr
📋 Plugin Information:
 
Name: frame-master-plugin-react-ssr
Version: 2.0.0
Priority: 10
 
Features:
  Router:
    ✓ before_request
    ✓ request
    ✓ html_rewrite
  Server Lifecycle:
    ✓ main
    ✓ dev_main
  Build Lifecycle:
    ✓ buildConfig (dynamic)
    ✓ afterBuild
 
Requirements:
  Frame-Master: ^2.0.0
  Bun: >=1.0.0

✅ plugin validate

Validate your plugin configuration and check for issues.

frame-master plugin validate

What it checks:

  • Duplicate plugin names
  • Frame-Master version requirements
  • Bun runtime version requirements
  • Required plugin dependencies
  • Missing version fields (warning)
  • Conflicting priorities (warning)

Example output (success):

🔍 Validating configuration...
 
✓ Configuration is valid!

Example output (errors):

🔍 Validating configuration...
 
✗ my-auth-plugin: requires plugin "frame-master-plugin-session" which is not installed
⚠ my-plugin: missing version field (recommended)
⚠ Multiple plugins share the same priority: plugin-a (50), plugin-b (50)
 
Found 1 error
Found 2 warnings

🔧 plugin create

Create a new plugin from a template.

frame-master plugin create <name> [options]
 
Options:
  -d, --dir <directory>    Output directory (default: "./")

Example:

# Create in current directory
frame-master plugin create my-awesome-plugin
 
# Create in specific directory
frame-master plugin create my-awesome-plugin --dir ./plugins
📦 Creating plugin "my-awesome-plugin"...
 
✓ Plugin created successfully!
 
Files created:
  my-awesome-plugin/index.ts
  my-awesome-plugin/package.json
  my-awesome-plugin/test/plugin.test.ts
  my-awesome-plugin/test/preload.ts
  my-awesome-plugin/bunfig.toml
  my-awesome-plugin/README.md
 
Next steps:
  cd my-awesome-plugin
  bun install
  # Edit index.ts to implement your plugin
  bun test
  # Add to your frame-master.config.ts when ready to use

Generated structure:

my-awesome-plugin/
├── index.ts             # Plugin implementation
├── package.json         # Package metadata and test script
├── bunfig.toml          # Configures Bun's test preload
├── test/
│   ├── plugin.test.ts   # Sample integration test
│   └── preload.ts       # Registers declared runtime plugins before tests load
└── README.md            # Documentation template

bunfig.toml preloads test/preload.ts before Bun evaluates test modules. The preload registers runtime plugins declared by the plugin, so tests exercise the same runtime plugin chain used in production. Keep this preload when adding tests that import modules depending on runtime plugins.

Tip: Use the format frame-master-plugin-[name] for consistency when publishing to npm.

Next Steps