Skip to content

[FEATURE]: plugins/ folder only auto-discovers flat files, not plugin directories #33390

Description

@licat2023

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

A local plugin declared in opencode.jsonc can point at a directory (one that holds a package.json or an index.*) and it resolves fine. But the zero-config plugins/ (and plugin/) folder convention only scans {plugin,plugins}/*.{ts,js}, so a plugin shipped as a directory is silently never discovered. You are forced to list it explicitly in config, even though the directory-resolution machinery already exists.

Proposed approach: in the plugins/ scan, also match immediate subdirectories that contain a package.json or an index file, and hand the directory to the same entrypoint resolver that config-declared directory plugins already use. Keeping it to a single level means a package's own src/ or node_modules/ are never mistaken for plugins.

Benefit: removes a surprising inconsistency between explicit-config and folder-convention plugins, and lets you drop a real plugin package into plugins/ with no config at all.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions