Skip to content

Alma Plugin Development Documentation ​

Welcome to the official documentation for developing plugins for Alma.

DocumentDescription
Getting StartedCreate your first plugin
API ReferenceComplete API documentation
Hooks & EventsReact to application events
UI API GuideBuild user interfaces
ExamplesReal-world plugin examples

Overview ​

Alma plugins extend the functionality of the AI assistant with custom tools, UI components, themes, and integrations. Plugins are written in TypeScript/JavaScript and have access to a rich set of APIs.

Plugin Types ​

TypeDescriptionExample Use Cases
toolRegister tools for the AIWeather lookup, code execution, file operations
uiAdd UI componentsStatus bar items, sidebars, custom panels
themeProvide color themesDark themes, brand colors
providerAdd AI providersCustom model backends, local LLMs
transformTransform dataPrompt enhancement, response formatting
compositeMultiple typesFull-featured integrations

Core Concepts ​

  1. Activation: Plugins export an activate function that receives a PluginContext
  2. Disposables: Resources must be cleaned up when the plugin deactivates
  3. Hooks: Subscribe to lifecycle events to react to application state changes
  4. Settings: Persist configuration across sessions

Minimal Example ​

typescript
import type { PluginContext, PluginActivation } from 'alma-plugin-api';

export async function activate(context: PluginContext): Promise<PluginActivation> {
    context.logger.info('Plugin activated!');

    return {
        dispose: () => {
            context.logger.info('Plugin deactivated');
        },
    };
}

Installation ​

For Users ​

Copy plugins to:

  • macOS: ~/Library/Application Support/Alma/plugins/
  • Windows: %APPDATA%/Alma/plugins/
  • Linux: ~/.config/Alma/plugins/

For Developers ​

bash
npm install alma-plugin-api

API Summary ​

APIDescription
loggerLogging (info, warn, error, debug)
storagePersistent key-value storage
toolsRegister AI tools
commandsRegister command palette commands
eventsSubscribe to lifecycle hooks
uiNotifications, dialogs, status bar
chatAccess threads and messages
providersManage AI providers
workspaceFile system operations
settingsRead/write plugin settings
i18nInternationalization

Available Hooks ​

HookDescription
chat.message.willSendBefore sending a message
chat.message.didReceiveAfter receiving a response
thread.activatedWhen switching threads
tool.willExecuteBefore tool execution
tool.didExecuteAfter tool completion
tool.onErrorWhen a tool fails
app.readyApplication startup
app.willQuitBefore closing

Contributing ​

Plugins can be submitted to the Alma Plugin Registry for distribution through the marketplace.

Submission Requirements ​

  1. Valid manifest.json with all required fields
  2. Compiled JavaScript entry point
  3. README with usage instructions
  4. MIT or compatible license
  5. No malicious code or security vulnerabilities

Resources ​

License ​

MIT