Skip to content

feat: Add /plugin command for managing installed plugins#502

Draft
xingyaoww wants to merge 10 commits intomainfrom
openhands/plugin-command
Draft

feat: Add /plugin command for managing installed plugins#502
xingyaoww wants to merge 10 commits intomainfrom
openhands/plugin-command

Conversation

@xingyaoww
Copy link
Contributor

@xingyaoww xingyaoww commented Feb 13, 2026

Summary

This PR adds support for the /plugin command to manage plugins installed in ~/.openhands/plugins/installed/, similar to Claude Code's plugin management system.

Closes #405

Changes

TUI Command (/plugin)

  • Shows list of installed plugins with their metadata
  • Displays usage instructions for CLI plugin management commands

CLI Subcommand (openhands plugin)

  • openhands plugin list [--json] - List installed plugins
  • openhands plugin install <source> [--ref] [--repo-path] [--force] - Install a plugin
  • openhands plugin uninstall <name> - Uninstall a plugin
  • openhands plugin update <name> - Update a plugin to the latest version

Supported Sources

  • github:owner/repo - GitHub repository shorthand
  • https://github.com/owner/repo - Full git URL
  • /local/path - Local directory path

Dependencies

This PR depends on the SDK changes in OpenHands/software-agent-sdk#2031 which adds the installed plugins management utilities:

  • install_plugin() - Install plugins from various sources
  • uninstall_plugin() - Remove installed plugins
  • list_installed_plugins() - List all installed plugins
  • update_plugin() - Update plugins to latest version

The pyproject.toml has been updated to use the latest SDK commit (d3f6e5cc) from PR #2031.

Usage Examples

# List installed plugins
openhands plugin list

# Install a plugin from GitHub
openhands plugin install github:owner/my-plugin

# Install a specific version
openhands plugin install github:owner/my-plugin --ref v1.0.0

# Uninstall a plugin
openhands plugin uninstall my-plugin

# Update a plugin
openhands plugin update my-plugin

In the TUI, type /plugin to see installed plugins and usage instructions.

Testing

  • Added 13 tests for the plugin CLI commands
  • All tests pass locally

🚀 Try this PR

uvx --python 3.12 git+https://github.com/OpenHands/OpenHands-CLI.git@openhands/plugin-command

Add support for managing plugins installed in ~/.openhands/skills/installed/:

TUI Command:
- /plugin - Shows installed plugins and usage instructions

CLI Subcommand:
- openhands plugin list [--json] - List installed plugins
- openhands plugin install <source> [--ref] [--repo-path] [--force] - Install plugin
- openhands plugin uninstall <name> - Uninstall plugin
- openhands plugin update <name> - Update plugin to latest version

Supported sources:
- github:owner/repo - GitHub repository shorthand
- https://github.com/owner/repo - Full git URL
- /local/path - Local directory path

This uses the new installed plugins management utilities from SDK PR #2031:
OpenHands/software-agent-sdk#2031

Closes #405

Co-authored-by: openhands <openhands@all-hands.dev>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 13, 2026

Coverage

Coverage Report •
FileStmtsMissCoverMissing
openhands_cli
   entrypoint.py1264762%32, 52–53, 56, 59, 61–62, 64–65, 68, 70, 72, 76, 81, 83–84, 133, 135–136, 139–143, 146–147, 149, 151, 161, 163–165, 167, 169–171, 174, 176, 179, 181, 185, 194, 196–198, 215, 262
openhands_cli/argparsers
   main_parser.py340100% 
   plugin_parser.py150100% 
openhands_cli/plugin
   __init__.py20100% 
   commands.py1143073%77–79, 81–85, 87–91, 98, 100–102, 145–150, 180–181, 213–215, 217–218
   installed.py14910827%38, 47, 55–56, 93, 116, 121–129, 133–136, 165, 168, 176–178, 181–183, 189–190, 193–194, 197, 206–208, 210, 226–227, 229–231, 233–235, 237–238, 240, 247–248, 250–256, 258–260, 262–263, 265, 272–273, 275–279, 281–284, 286–289, 291–292, 294, 302–304, 306, 320, 322–323, 325, 328–329, 333–334, 336, 352–353, 355–356, 359–362, 364, 383–384, 387–389, 392
openhands_cli/tui/core
   commands.py703550%45, 126, 131–132, 134, 137–139, 141–144, 148–153, 155, 157–158, 161–163, 167, 171–172, 175–179, 181–183
openhands_cli/tui/widgets
   input_area.py813062%74, 76–98, 108, 125–126, 142, 166–167
openhands_cli/tui/widgets/user_input
   models.py110100% 
TOTAL6935111183% 

@openhands-ai
Copy link

openhands-ai bot commented Feb 13, 2026

Looks like there are a few issues preventing this PR from being merged!

  • GitHub Actions are failing:
    • Tests
    • Pre-commit checks
    • Check Package Versions

If you'd like me to help, just leave a comment, like

@OpenHands please fix the failing actions on PR #502 at branch `openhands/plugin-command`

Feel free to include any additional details that might help me get this PR into a better state.

You can manage your notification settings

- Update openhands-sdk/tools to latest PR #2031 commit (d3f6e5cc)
- Update agent-client-protocol to >=0.8.1 (SDK requirement)
- Fix plugin directory path: ~/.openhands/plugins/installed/

Co-authored-by: openhands <openhands@all-hands.dev>
@xingyaoww
Copy link
Contributor Author

@OpenHands please fix the failing actions on PR #502 at branch openhands/plugin-command

@openhands-ai
Copy link

openhands-ai bot commented Mar 3, 2026

I'm on it! xingyaoww can track my progress at all-hands.dev

- Create openhands_cli/plugin/installed.py with local plugin management
  functions (install_plugin, uninstall_plugin, list_installed_plugins, etc.)
  mirroring the SDK PR #2031 functionality
- Update commands.py to import from local module instead of SDK
- Revert pyproject.toml to use released SDK version (v1.11.5) without
  rev fields that fail CI package version checks
- Update tests to use local module imports
- Fix test_commands.py to expect 10 commands (including /plugin)
- Fix StrEnum lint error in models.py (UP042)

This allows the /plugin command to work with the current released SDK
while waiting for SDK PR #2031 to be merged. Once merged, the local
implementation can be refactored to use SDK functions.

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Restoring the original uv.lock file to maintain compatibility with the
older pyright version (1.1.407) which doesn't have the stricter checks
that were causing CI failures.

Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: openhands <openhands@all-hands.dev>
@openhands-ai
Copy link

openhands-ai bot commented Mar 3, 2026

Final Summary

All CI failures on PR #502 (openhands/plugin-command) have been fixed. The changes were already committed and pushed to the remote branch in previous work.

Root Cause

The PR originally depended on unreleased SDK functions from PR #2031, which caused:

  • Import failures (functions didn't exist in released SDK)
  • Package version check failures (pyproject.toml pointed to unmerged commit)

Fixes Applied

Task Status
✅ Created local plugin management utilities (openhands_cli/plugin/installed.py) Done
✅ Updated imports to use local module instead of unreleased SDK Done
✅ Reverted pyproject.toml to released SDK v1.11.5 Done
✅ Fixed lint issues (StrEnum UP042, import ordering) Done
✅ Restored uv.lock to main's package versions Done
✅ Updated test expectations (10 commands instead of 9) Done

CI Status (All Passing)

  • ✅ Pre-commit checks
  • ✅ Check Package Versions
  • ✅ Unit tests (1274 tests)
  • ✅ Snapshot tests (59 tests)
  • ✅ All binary builds (4 platforms)

Latest Commit

c76c628 - "style: Fix import ordering in tests"

The PR is now ready for review and merge. Once SDK PR #2031 is merged, a follow-up PR can migrate from the local plugin utilities to the SDK functions.

Copy link
Collaborator

enyst commented Mar 4, 2026

Status + review note:

The SDK PR that introduced installed plugin utilities has now merged (OpenHands/software-agent-sdk#2031). This PR currently carries a local copy in openhands_cli/plugin/installed.py (and notes it’s temporary).

Once the CLI bumps to an SDK release containing those utilities, we should swap this module to import from openhands.sdk.plugin (or re-export) and drop the duplicated implementation to avoid divergence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CLI] Feature Request: Support /plugin command for installing skills

3 participants