Skip to content

Build dynamic plugin system#1

Open
vforsh wants to merge 1 commit intomainfrom
claude/dynamic-plugin-system-rQm5a
Open

Build dynamic plugin system#1
vforsh wants to merge 1 commit intomainfrom
claude/dynamic-plugin-system-rQm5a

Conversation

@vforsh
Copy link
Owner

@vforsh vforsh commented Jan 18, 2026

Implement a plugin system that allows projects to extend Argus CLI with custom commands by providing Commander.js Command instances.

Key features:

  • Plugin discovery via .argus/config.json configuration
  • Support for local file paths and npm packages
  • Full Commander.js feature parity (subcommands, options, aliases, help)
  • Plugin lifecycle hooks (setup/teardown)
  • Type-safe plugin API via @vforsh/argus-core
  • Comprehensive documentation and examples

Architecture:

  • PluginTypes.ts: Type definitions for plugin API
  • resolver.ts: Resolves plugin module paths (local/npm)
  • loader.ts: Loads and validates plugin modules
  • registry.ts: Orchestrates plugin loading and registration
  • bin.ts: Integrates plugin system into CLI lifecycle

Examples included:

  • JavaScript plugin (examples/plugin-gameX)
  • TypeScript plugin (examples/plugin-gameX-ts)

Documentation:

  • docs/plugins.md: Comprehensive plugin development guide

Implement a plugin system that allows projects to extend Argus CLI with custom commands by providing Commander.js Command instances.

Key features:
- Plugin discovery via .argus/config.json configuration
- Support for local file paths and npm packages
- Full Commander.js feature parity (subcommands, options, aliases, help)
- Plugin lifecycle hooks (setup/teardown)
- Type-safe plugin API via @vforsh/argus-core
- Comprehensive documentation and examples

Architecture:
- PluginTypes.ts: Type definitions for plugin API
- resolver.ts: Resolves plugin module paths (local/npm)
- loader.ts: Loads and validates plugin modules
- registry.ts: Orchestrates plugin loading and registration
- bin.ts: Integrates plugin system into CLI lifecycle

Examples included:
- JavaScript plugin (examples/plugin-gameX)
- TypeScript plugin (examples/plugin-gameX-ts)

Documentation:
- docs/plugins.md: Comprehensive plugin development guide
@vforsh
Copy link
Owner Author

vforsh commented Jan 18, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7233cfa1fd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +653 to +655
process.on('exit', () => void cleanup())
process.on('SIGINT', () => void cleanup())
process.on('SIGTERM', () => void cleanup())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Await plugin teardown before exit signals

cleanup() is async but these handlers invoke it without awaiting, and process.on('exit', …) cannot run async work at all. This means plugin teardown hooks will often never execute or will be cut off on normal exit or SIGINT/SIGTERM, which defeats the lifecycle guarantee for plugins that need to flush files/network. Consider awaiting cleanup() in SIGINT/SIGTERM handlers (then exiting) and avoid relying on the exit event for async teardown.

Useful? React with 👍 / 👎.

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.

2 participants