Publish Command
Publish a plugin to npm, create a GitHub repository, and submit to the ElizaOS registry
Publish Command
The elizaos publish
command is the all-in-one tool for releasing your plugin. It handles packaging, publishing to npm, creating a source repository, and submitting your plugin to the official ElizaOS registry for discovery.
What It Does
The publish
command automates the entire release process:
- Validates Your Plugin: Checks your
package.json
and directory structure against registry requirements - Publishes Your Package: Pushes your plugin to npm
- Creates GitHub Repository: Initializes a public GitHub repository for your plugin’s source code
- Submits to Registry: Opens a Pull Request to the official ElizaOS Plugin Registry
Usage
Options
Option | Description |
---|---|
--npm | Publish to npm only (skip GitHub and registry) |
-t, --test | Test publish process without making changes |
-d, --dry-run | Generate registry files locally without publishing |
--skip-registry | Skip publishing to the registry |
What It Does
The publish
command automates the entire release process:
- Validates Your Plugin: Checks your
package.json
and directory structure against registry requirements - Publishes Your Package: Pushes your plugin to npm
- Creates GitHub Repository: Initializes a public GitHub repository for your plugin’s source code
- Submits to Registry: Opens a Pull Request to the official ElizaOS Plugin Registry
Usage
Options
Option | Description |
---|---|
--npm | Publish to npm only (skip GitHub and registry) |
-t, --test | Test publish process without making changes |
-d, --dry-run | Generate registry files locally without publishing |
--skip-registry | Skip publishing to the registry |
Standard Publishing
This is the most common workflow. It publishes your package to npm, creates a GitHub repository, and opens a PR to the registry.
Testing and Dry Runs
Use these options to validate your plugin before a real publish.
Advanced Publishing
Use these for specific scenarios, like managing a private plugin or handling the registry submission manually.
Development Lifecycle
A typical journey from creation to publishing:
1. Create & Develop
2. Test & Validate
3. Publish
Process Steps
When you run elizaos publish
, the CLI performs these actions:
- Validation: Checks CLI version, plugin structure, and
package.json
- Authentication: Prompts for npm and GitHub credentials if needed
- Build: Compiles TypeScript by running
bun run build
- Publish Package: Pushes to npm
- Create GitHub Repo: Creates public repository (if it doesn’t exist)
- Submit to Registry: Opens a Pull Request for discovery
Post-Publishing Updates
The elizaos publish
command is for initial release only. Use standard tools for updates.
For subsequent updates:
The ElizaOS registry automatically detects new npm versions.
Authentication
npm Authentication
You must be logged in to npm:
GitHub Authentication
A Personal Access Token (PAT) is required. You can either:
- Set environment variable:
export GITHUB_TOKEN=your_pat_here
- Enter when prompted by the CLI
Required PAT scopes: repo
, read:org
, workflow
Plugin Structure
The CLI validates these requirements before publishing:
Requirement | Description | Fix |
---|---|---|
Plugin Name | Must start with plugin- | Auto-checked |
Images Directory | Must have images/ directory | Auto-created |
Logo Image | images/logo.jpg (400x400px, max 500KB) | Manual |
Banner Image | images/banner.jpg (1280x640px, max 1MB) | Manual |
Description | Meaningful description | Prompted |
Repository URL | Format: github:username/repo | Auto-fixed |
agentConfig | Required in package.json | Auto-fixed |
Sample package.json
The agentConfig
section tells ElizaOS agents how to load your plugin.
Authentication Errors
npm Login Issues
GitHub Token Issues
Generate a new PAT with repo
, read:org
, and workflow
scopes:
Validation Failures
Use --test
to identify issues:
Common problems:
- Plugin name doesn’t start with
plugin-
- Missing or incorrectly sized images
- Invalid repository URL format
Build Failures
Debug TypeScript errors:
Version Conflicts
Cannot publish over existing versions:
GitHub Repository Exists
If repository already exists:
Registry Submission Issues
CI/CD Integration
Example GitHub Actions workflow:
Related Commands
create
: Create a new pluginplugins
: Manage pluginstest
: Test before publishing- Plugin Publishing Guide: Complete walkthrough