Your Plugin in 3 Steps
- Scaffold -
elizaos create my-plugin --type plugin - Build - Add actions, providers, or services
- Test - Run locally, then publish
This guide uses
bun as the package manager, which is the preferred tool for elizaOS development. Bun provides faster installation times and built-in TypeScript support.Quick Start: Scaffolding Plugins with CLI
The easiest way to create a new plugin is using the elizaOS CLI, which provides interactive scaffolding with pre-configured templates.Using elizaos create
The CLI offers two plugin templates to get you started quickly:
-
Quick Plugin (Backend Only) - Simple backend-only plugin without frontend
- Perfect for: API integrations, blockchain actions, data providers
- Includes: Basic plugin structure, actions, providers, services
- No frontend components or UI routes
-
Full Plugin (with Frontend) - Complete plugin with React frontend and API routes
- Perfect for: Plugins that need web UI, dashboards, or visual components
- Includes: Everything from Quick Plugin + React frontend, Vite setup, API routes
- Tailwind CSS pre-configured for styling
Quick Plugin Structure
After runningelizaos create and selecting “Quick Plugin”, you’ll get:
Full Plugin Structure
Selecting “Full Plugin” adds frontend capabilities:After Scaffolding
Once your plugin is created:- ✅ Proper TypeScript configuration
- ✅ Build setup with tsup (and Vite for full plugins)
- ✅ Example action and provider to extend
- ✅ Integration with
@elizaos/core - ✅ Development scripts ready to use
- ✅ Basic tests structure
Manual Plugin Creation
If you prefer to create a plugin manually or need custom configuration:1. Initialize the Project
2. Install Dependencies
3. Configure TypeScript
Createtsconfig.json:
4. Configure Build
Createtsup.config.ts:
5. Create Plugin Structure
Createsrc/index.ts:
6. Update package.json
Using Your Plugin in Projects
Option 1: Plugin Inside the Monorepo
If developing within the elizaOS monorepo:- Add your plugin to the root
package.jsonas a workspace dependency:
-
Run
bun installin the root directory - Use the plugin in your project:
Option 2: Plugin Outside the Monorepo
For plugins outside the elizaOS monorepo:- In your plugin directory, build and link it:
- In your project directory, link the plugin:
- Add to your project’s
package.json:
When using
bun link, remember to rebuild your plugin (bun run build) after making changes for them to be reflected in your project.Testing Plugins
Test Environment Setup
Directory Structure
Base Test Imports
Creating Test Utilities
Create atest-utils.ts file with reusable mocks:
Testing Actions
Testing Providers
Testing Services
E2E Testing
For integration testing with a live runtime:Running Tests
Test Best Practices
- Test in Isolation: Use mocks to isolate components
- Test Happy Path and Errors: Cover both success and failure cases
- Test Validation Logic: Ensure actions validate correctly
- Test Examples: Verify example structures are valid
- Test Side Effects: Verify database writes, API calls, etc.
- Use Descriptive Names: Make test purposes clear
- Keep Tests Fast: Mock external dependencies
- Test Public API: Focus on what users interact with
Development Workflow
1. Development Mode
2. Building for Production
3. Publishing
To npm
To GitHub Packages
Updatepackage.json:
4. Version Management
Debugging
Enable Debug Logging
VS Code Debug Configuration
Create.vscode/launch.json:
Common Issues and Solutions
Issue: Plugin not loading
Solution: Check that your plugin is properly exported and added to the agent’s plugin array.Issue: TypeScript errors
Solution: Ensure@elizaos/core is installed and TypeScript is configured correctly.
Issue: Service not available
Solution: Verify the service is registered in the plugin and started properly.Issue: Tests failing with module errors
Solution: Make sure yourtsconfig.json has proper module resolution settings for Bun.
See Also
Plugin Components
Deep dive into Actions, Providers, Evaluators, and Services
Common Patterns
Learn proven plugin development patterns
Plugin Schemas
Understand plugin configuration and validation
Plugin Reference
Complete API reference for all interfaces
Publish a Plugin
Share your plugin with the community
Deploy to Cloud
Ship your agent with plugins to production

