Skip to content

[M2] Plugin Management #413

@jpshackelford

Description

@jpshackelford

Parent: OpenHands/OpenHands-CLI#407 ([PRD] OpenHands CLI Plugin Support)

Summary

Implement CLI commands for installing, uninstalling, enabling, and disabling plugins from registered marketplaces. This provides persistent plugin management so users don't need to specify --plugin flags every time.

Background

With M1 providing explicit plugin loading and M2-Marketplace providing marketplace registration, users need commands to:

  • Install plugins from marketplaces for persistent use
  • Enable/disable plugins without removing them
  • Search for plugins across registered marketplaces
  • View installed plugin status

Requirements

Plugin Commands

# Search for plugins
oh plugin search formatter
oh plugin search --marketplace company-tools

# Install a plugin
oh plugin install code-formatter@company-tools
oh plugin install code-formatter  # Uses default/only marketplace

# List installed plugins
oh plugin list
oh plugin list --enabled
oh plugin list --disabled

# Enable/disable plugins
oh plugin disable code-formatter@company-tools
oh plugin enable code-formatter@company-tools

# Uninstall a plugin
oh plugin uninstall code-formatter@company-tools

# Show plugin details
oh plugin info code-formatter@company-tools

Plugin Identification

Plugins are identified as plugin-name@marketplace-name:

  • code-formatter@company-tools - Fully qualified
  • code-formatter - Shorthand (if unambiguous)

Storage

Installed plugins are stored in ~/.openhands/plugins.json:

{
  "installed": {
    "code-formatter@company-tools": {
      "enabled": true,
      "installed_at": "2024-01-15T10:30:00Z",
      "version": "1.2.0",
      "resolved_ref": "abc123def456"
    },
    "linter@community": {
      "enabled": false,
      "installed_at": "2024-01-14T09:00:00Z",
      "version": "2.0.1"
    }
  }
}

CLI Output Examples

Searching for plugins:

$ oh plugin search formatter
Searching marketplaces...

  code-formatter (v1.2.0) @ company-tools
    Format code using team standards
    Commands: format, check

  pretty-print (v0.5.0) @ community
    Pretty print JSON, YAML, and XML
    Commands: format, validate

Use 'oh plugin install <name>@<marketplace>' to install.

Installing a plugin:

$ oh plugin install code-formatter@company-tools
Installing 'code-formatter' from company-tools...

Plugin 'code-formatter@company-tools' installed!
  Version: 1.2.0
  Commands: format, check

The plugin is enabled and will be loaded in new conversations.

Listing plugins:

$ oh plugin list
Installed plugins:

  code-formatter@company-tools (v1.2.0) [enabled]
    Installed: 2 days ago
    Commands: format, check

  linter@community (v2.0.1) [disabled]
    Installed: 3 days ago
    Commands: lint, fix

2 plugins installed (1 enabled, 1 disabled)

Plugin info:

$ oh plugin info code-formatter@company-tools
Plugin: code-formatter
Marketplace: company-tools
Version: 1.2.0
Status: enabled
Installed: 2024-01-15T10:30:00Z

Description:
  Format code using team standards and best practices.

Commands:
  /code-formatter:format - Format code in specified path
  /code-formatter:check  - Check formatting without changes

Skills: 2
Hooks: 1
MCP Servers: 0

Behavior

  • Installed & enabled plugins are automatically loaded on oh run
  • Disabled plugins remain installed but are not loaded
  • Uninstalling removes the plugin from storage
  • Version conflicts across marketplaces warn the user

Acceptance Criteria

  • oh plugin search QUERY searches across marketplaces
  • oh plugin install NAME@MARKETPLACE installs a plugin
  • oh plugin list shows installed plugins with status
  • oh plugin enable/disable toggles plugin loading
  • oh plugin uninstall removes a plugin
  • oh plugin info shows detailed plugin information
  • Enabled plugins auto-load on oh run
  • Plugins persist in ~/.openhands/plugins.json
  • Ambiguous plugin names produce helpful errors
  • Installing non-existent plugins produces clear errors

Dependencies

References

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Now

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions