Skip to content

Add script-based plugin system#37

Draft
Niaobu wants to merge 1 commit intomainfrom
plugin-system
Draft

Add script-based plugin system#37
Niaobu wants to merge 1 commit intomainfrom
plugin-system

Conversation

@Niaobu
Copy link
Contributor

@Niaobu Niaobu commented Mar 13, 2026

Summary

  • Adds a plugin system that lets users extend the CLI with custom commands backed by C# scripts executed via script.execute
  • Plugins live in .unityctl/plugins/ (project-level, shareable via git) or ~/.unityctl/plugins/ (user-level, personal tools)
  • Each plugin is a directory with a plugin.json manifest declaring commands, arguments, options, and script handlers
  • The CLI dynamically creates System.CommandLine commands from discovered plugin manifests at startup
  • Adds plugin list, plugin create <name>, and plugin remove <name> management commands
  • Adds skill rebuild command and composes SKILL.md from three sources: base embedded skill + auto-generated plugin sections + user-provided .unityctl/skill-extra.md

Design

  • No bridge or Unity plugin changes — plugin commands piggyback on existing script.execute RPC
  • Project-level plugins take precedence over user-level plugins with the same name
  • Plugins can provide a custom SKILL-SECTION.md for richer AI documentation, or get auto-generated docs from the manifest
  • With no plugins and no skill-extra.md, behavior is identical to before

Test plan

  • dotnet build succeeds
  • All 261 existing tests pass
  • plugin create scaffolds valid plugin with manifest + example script
  • plugin list discovers and displays plugins from both sources
  • Dynamic plugin commands appear in --help and accept declared args/options
  • plugin remove cleans up plugin directory
  • skill rebuild produces composed SKILL.md with plugin sections appended
  • JSON output mode works for all new commands
  • End-to-end: plugin command executes script in Unity via bridge

Plugins are directories in .unityctl/plugins/ (project) or ~/.unityctl/plugins/ (user)
containing a plugin.json manifest and .cs scripts. The CLI dynamically creates
System.CommandLine commands from manifests and executes handlers via script.execute.

- Plugin discovery with project-level precedence over user-level
- plugin list/create/remove management commands
- Dynamic CLI command generation from plugin.json manifests
- Composed SKILL.md: base + plugin sections + .unityctl/skill-extra.md
- skill rebuild command to regenerate composed skill
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.

1 participant