Skip to main content

Your Plugin in 3 Steps

  1. Scaffold - elizaos create my-plugin --type plugin
  2. Build - Add actions, providers, or services
  3. Test - Run locally, then publish
That’s it. No complex setup, no boilerplate to maintain.
30 minutes to your first plugin. The CLI generates everything - TypeScript config, build setup, even a README. Focus on your logic, not infrastructure.
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:
When creating a plugin, you’ll be prompted to choose between:
  1. 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
  2. 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 running elizaos create and selecting “Quick Plugin”, you’ll get:

Full Plugin Structure

Selecting “Full Plugin” adds frontend capabilities:

After Scaffolding

Once your plugin is created:
The scaffolded plugin includes:
  • ✅ 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
The CLI templates follow all elizaOS conventions and best practices, making it easy to get started without worrying about configuration.

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

Create tsconfig.json:

4. Configure Build

Create tsup.config.ts:

5. Create Plugin Structure

Create src/index.ts:

6. Update package.json

Using Your Plugin in Projects

Option 1: Plugin Inside the Monorepo

If developing within the elizaOS monorepo:
  1. Add your plugin to the root package.json as a workspace dependency:
  1. Run bun install in the root directory
  2. Use the plugin in your project:

Option 2: Plugin Outside the Monorepo

For plugins outside the elizaOS monorepo:
  1. In your plugin directory, build and link it:
  1. In your project directory, link the plugin:
  1. 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 a test-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

  1. Test in Isolation: Use mocks to isolate components
  2. Test Happy Path and Errors: Cover both success and failure cases
  3. Test Validation Logic: Ensure actions validate correctly
  4. Test Examples: Verify example structures are valid
  5. Test Side Effects: Verify database writes, API calls, etc.
  6. Use Descriptive Names: Make test purposes clear
  7. Keep Tests Fast: Mock external dependencies
  8. 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

Update package.json:
Then publish:

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 your tsconfig.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