Comprehensive guide covering all aspects of plugin development in the elizaOS system
bun
as the package manager, which is the preferred tool for elizaOS development. Bun provides faster installation times and built-in TypeScript support.elizaos create
elizaos create
and selecting “Quick Plugin”, you’ll get:
@elizaos/core
packages/
directory), you need to add it as a workspace dependency:
package.json
as a workspace dependency:bun install
in the root directory to link the workspace dependency
bun link
:
package.json
dependencies:bun link
, remember to rebuild your plugin (bun run build
) after making changes for them to be reflected in your project.Plugin
interface:
Component | Purpose | Required | Returns |
---|---|---|---|
name | Unique identifier | ✅ | - |
description | Help LLM understand when to use | ✅ | - |
similes | Alternative names for fuzzy matching | ❌ | - |
validate | Check if action can run | ✅ | Promise<boolean> |
handler | Execute the action logic | ✅ | Promise<ActionResult> |
examples | Teach LLM through scenarios | ✅ | - |
ActionResult
with success
fieldActionResult
interface is crucial for action interoperability:
name
(required): Unique identifier for the providerdescription
(optional): Human-readable description of what the provider doesdynamic
(optional, default: false): If true, the provider is not included in default state composition and must be explicitly requestedposition
(optional, default: 0): Controls execution order. Lower numbers execute first. Can be negative for early executionprivate
(optional, default: false): If true, the provider is excluded from regular provider lists and must be explicitly includedruntime.composeState()
runtime.composeState()
alwaysRun: true
to run even without a responseRoute
type and exported as part of the plugin:
elizaos create
for instant plugin scaffolding with pre-configured TypeScript, build tools, and example componentsbun test
for running tests without additional setup (no vitest needed)bun.lockb
(binary format) for faster dependency resolutiondescribe
, it
, expect
, mock
)mock()
from ‘bun:test’--coverage
flag--watch
flag*.test.ts
or *.test.js
*.spec.ts
or *.spec.js
__tests__/
directoriestest/
or tests/
directoriespackages/