Skip to content

illusionaireal/opencode-plugin-selector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

opencode-plugin-selector

Interactive plugin selector for OpenCode - easily manage your plugins with a beautiful TUI

npm version License: MIT

Features

  • ๐ŸŽจ Beautiful TUI - Interactive multiselect interface powered by @clack/prompts
  • โšก Fast - Instant loading with known plugins list
  • โœ“ Status indicators - See which plugins are installed/active at a glance
  • ๐Ÿ’พ Auto-sync - Automatically updates your opencode.json configuration
  • ๐Ÿ”„ Preserves versions - Maintains version specifiers for existing plugins
  • ๐ŸŒ Cross-platform - Works on Windows, macOS, and Linux

Installation

From npm (Recommended)

Add to your OpenCode configuration:

{
  "plugin": ["opencode-plugin-selector"]
}

OpenCode will automatically install it on startup.

Manual Installation

npm install -g opencode-plugin-selector

Or add to your project:

npm install opencode-plugin-selector

Usage

In OpenCode

Just type the command:

/plugins

This opens an interactive menu where you can:

  • โ†‘โ†“ - Navigate through plugins
  • Space - Toggle plugin selection
  • Enter - Confirm selection
  • Esc - Cancel

Example

โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ OpenCode Plugin Selector            โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ โ—‰ opencode-firecrawl โœ“              โ”‚
โ”‚   Web scraping via Firecrawl        โ”‚
โ”‚                                     โ”‚
โ”‚ โ—ฏ oh-my-opencode โœ“                  โ”‚
โ”‚   Background agents, LSP tools      โ”‚
โ”‚                                     โ”‚
โ”‚ โ—ฏ opencode-wakatime โœ—               โ”‚
โ”‚   Track usage with Wakatime         โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

[โ†‘โ†“ Navigate] [Space Toggle] [Enter Confirm]

How It Works

  1. Plugin Discovery - Loads known plugins from the OpenCode ecosystem
  2. Status Check - Scans ~/.cache/opencode/node_modules/ for installed plugins
  3. Config Sync - Reads ~/.config/opencode/opencode.json for active plugins
  4. Interactive Selection - Presents a multiselect TUI
  5. Config Update - Saves your selection back to opencode.json
  6. Restart Required - Restart OpenCode to apply changes

Supported Plugins

The selector includes all known plugins from the OpenCode ecosystem:

  • Auth plugins: opencode-antigravity-auth, opencode-openai-codex-auth, opencode-gemini-auth
  • Development: opencode-daytona, opencode-devcontainers, opencode-worktree
  • Monitoring: opencode-helicone-session, opencode-wakatime, opencode-sentry-monitor
  • Utilities: opencode-firecrawl, opencode-pty, opencode-scheduler
  • Agents: oh-my-opencode, opencode-background-agents, opencode-workspace
  • And many more...

Configuration

The plugin respects your existing opencode.json configuration:

{
  "plugin": [
    "opencode-plugin-selector",
    "opencode-firecrawl@1.2.0",
    "oh-my-opencode@latest"
  ]
}

Version specifiers are preserved when you update your selection.

Development

Prerequisites

  • Node.js 18+
  • Bun (for running OpenCode)

Setup

git clone https://github.com/yourusername/opencode-plugin-selector.git
cd opencode-plugin-selector
npm install

Build

npm run build

Test Locally

Add to your opencode.json:

{
  "plugin": ["./path/to/opencode-plugin-selector"]
}

API Reference

Plugin Hook

The plugin implements the tui.command.execute hook:

{
  'tui.command.execute': async (input, output) => {
    if (input.command === 'plugins') {
      // Show interactive selector
    }
  }
}

Functions

  • getAllPlugins() - Get all available plugins with status
  • getActivePlugins() - Get currently enabled plugins
  • updatePlugins(plugins: string[]) - Update configuration
  • getInstalledPlugins() - Get plugins installed in cache

Troubleshooting

Plugin not loading?

  1. Check your opencode.json syntax
  2. Ensure the plugin is in the plugin array
  3. Restart OpenCode

Config not updating?

  1. Check file permissions on ~/.config/opencode/opencode.json
  2. Ensure the file is valid JSON
  3. Check OpenCode logs for errors

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Related


Made with โค๏ธ for the OpenCode community

About

Interactive plugin selector for OpenCode

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors