Conversation
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
|
@codex review |
There was a problem hiding this comment.
💡 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".
| process.on('exit', () => void cleanup()) | ||
| process.on('SIGINT', () => void cleanup()) | ||
| process.on('SIGTERM', () => void cleanup()) |
There was a problem hiding this comment.
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 👍 / 👎.
Implement a plugin system that allows projects to extend Argus CLI with custom commands by providing Commander.js Command instances.
Key features:
Architecture:
Examples included:
Documentation: