Publishing Plugins
Share your plugin with the Lokus community through the official marketplace.
Prerequisites
Before publishing, ensure you have:
- A completed, tested plugin
- A Lokus account at lokusmd.com
- An API token for publishing
Quick Start
# 1. Build your plugin
npm run build
# 2. Validate the manifest
npx lokus-plugin validate
# 3. Login (first time only)
npx lokus-plugin login
# 4. Publish
npx lokus-plugin publishStep-by-Step Guide
Step 1: Prepare Your Plugin
Update plugin.json:
{
"manifest": "2.0",
"id": "my-plugin",
"name": "my-plugin",
"displayName": "My Awesome Plugin",
"version": "1.0.0",
"description": "A detailed description of what your plugin does",
"author": "Your Name",
"license": "MIT",
"main": "./dist/index.js",
"lokusVersion": ">=1.0.0",
"keywords": ["productivity", "editor"],
"repository": {
"type": "git",
"url": "https://github.com/yourusername/my-plugin"
}
}Ensure you have:
- Clear, descriptive
displayNameanddescription - Correct
version(semantic versioning) - Valid
authorinformation - Appropriate
keywordsfor discoverability
Step 2: Build and Validate
# Build production bundle
npm run build
# Run tests
npm test
# Validate manifest
npx lokus-plugin validateExpected output:
✓ Plugin manifest is valid
Name: my-plugin
Version: 1.0.0
Description: A detailed description of what your plugin doesStep 3: Get Your API Token
- Go to lokusmd.com/marketplace
- Sign in to your account
- Navigate to Developer Settings
- Click Generate API Token
- Copy the token (starts with
lok_)
Important: Keep your token secure. Don’t commit it to version control.
Step 4: Login
npx lokus-plugin loginWhen prompted, paste your API token.
Alternatively, use environment variables:
export LOKUS_REGISTRY_TOKEN=lok_xxxxxxxxxxxxxxxxStep 5: Publish
npx lokus-plugin publishOutput:
Publishing my-plugin@1.0.0...
✓ Validated manifest
✓ Packaged plugin
✓ Uploaded to registry
Success! my-plugin@1.0.0 published
View at: https://lokusmd.com/marketplace/plugin/my-pluginVersion Management
Use semantic versioning (semver):
- Patch (
1.0.0→1.0.1): Bug fixes - Minor (
1.0.0→1.1.0): New features (backwards compatible) - Major (
1.0.0→2.0.0): Breaking changes
# Update version in package.json and plugin.json
npm version patch # 1.0.0 → 1.0.1
npm version minor # 1.0.0 → 1.1.0
npm version major # 1.0.0 → 2.0.0Note: Keep package.json and plugin.json versions in sync.
Publishing Options
Dry Run
Test the publish process without actually uploading:
npx lokus-plugin publish --dry-runBeta/Preview Releases
Publish to a specific tag:
npx lokus-plugin publish --tag betaUsers can install with:
# In Lokus marketplace, filter by "beta" releasesCustom Registry
For private registries:
npx lokus-plugin publish --registry https://your-registry.comPlugin Visibility
All published plugins are:
- Public by default
- Immediately available in the marketplace
- Searchable by name, description, and keywords
Best Practices
Documentation
Include a comprehensive README.md:
# My Plugin
Brief description of what your plugin does.
## Features
- Feature 1
- Feature 2
- Feature 3
## Installation
Available in the Lokus Marketplace.
## Usage
1. Open command palette (Cmd/Ctrl + Shift + P)
2. Type "My Plugin: Command Name"
3. Execute
## Configuration
| Setting | Default | Description |
|---------|---------|-------------|
| `myPlugin.option` | `true` | Description |
## License
MITChangelog
Maintain a CHANGELOG.md:
# Changelog
## [1.0.1] - 2024-01-15
### Fixed
- Bug fix description
## [1.0.0] - 2024-01-01
### Added
- Initial release
- Feature descriptionScreenshots
Include screenshots in your README to showcase your plugin’s UI.
Updating a Published Plugin
# 1. Make your changes
# 2. Update version
npm version patch
# 3. Build
npm run build
# 4. Publish update
npx lokus-plugin publishUnpublishing
To remove a plugin from the marketplace, contact support at lokusmd.com.
Note: Unpublishing may break users who depend on your plugin.
Troubleshooting
”Authentication failed"
# Re-authenticate
npx lokus-plugin login
# Or set environment variable
export LOKUS_REGISTRY_TOKEN=lok_xxxxxxxxxxxxxxxx"Version already exists”
You cannot overwrite an existing version. Bump your version:
npm version patch
npx lokus-plugin publish“Invalid manifest”
Run validation to see specific errors:
npx lokus-plugin validate“Network error”
Check your internet connection and try again:
npx lokus-plugin publishRegistry API
The registry is hosted at lokusmd.com/api/v1/registry/:
| Endpoint | Method | Description |
|---|---|---|
/publish | POST | Publish a plugin |
/search | GET | Search plugins |
/download/\{id\}/\\{version\\} | GET | Download plugin |
/plugin/\\\{id\\\} | GET | Plugin details |
Next Steps
- CLI Reference - Full CLI documentation
- API Reference - Plugin API documentation
- Marketplace - Browse published plugins