Skip to content

Implement Plugin Registry System with Environment Variable Control #171

@sirkitree

Description

@sirkitree

Overview

Add a plugin registry system that allows enabling/disabling plugins via environment variables. This will allow different deployments (Lullabot vs Tugboat) to control which features are active without code changes.

Approach: Environment Variable Registry

Use a single environment variable with comma-separated plugin names:

ENABLED_PLUGINS=karma,factoids,help,uptime,botsnack,hello,conversions,add-prompt

Current Plugins

Implementation Tasks

  1. Create src/services/plugin-registry.ts

    • Parse ENABLED_PLUGINS env var
    • Provide isPluginEnabled(pluginName: string) method
    • Default behavior if env var not set (all enabled or specific list?)
  2. Update src/bot.ts plugin loader

    • Check registry before loading each plugin
    • Log which plugins are enabled/disabled on startup
    • Maintain existing error handling
  3. Documentation

    • Update CLAUDE.md with plugin registry info
    • Update README with environment variable documentation
    • Add example .env entries
  4. Testing

    • Test with various combinations of enabled plugins
    • Verify default behavior when ENABLED_PLUGINS not set
    • Ensure disabled plugins don't load

Benefits

  • Per-deployment control (Lullabot vs Tugboat can have different configs)
  • Simple to understand and manage
  • No architecture changes needed
  • Future-proof for new plugins

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions