-
Couldn't load subscription status.
- Fork 738
feat: Implement first-class CLI commands for plugins #6350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Add new extension point infrastructure to allow plugins to register top-level CLI commands that appear as first-class citizens alongside built-in commands. Changes: - Add CommandExtensionPoint interface for plugin command registration - Add PluginCommandBase abstract class with session management - Add PluginCommandDiscovery utility for dynamic command discovery - Support priority-based conflict resolution between plugin commands - Enable commands like 'nextflow wave' instead of 'nextflow plugin nf-wave:command' 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Modernize Launcher to dynamically discover and register plugin commands alongside built-in commands, with unified help system support. Changes: - Replace static command list with dynamic discovery system - Add plugin command integration with conflict detection - Update help system to display both built-in and plugin commands - Maintain full backward compatibility with existing plugin syntax - Add graceful error handling for plugin discovery failures 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Add new Wave command classes that enable 'nextflow wave' syntax while maintaining full backward compatibility with existing 'nextflow plugin nf-wave:command' syntax. Changes: - Add WaveCmd extending PluginCommandBase with subcommand routing - Add WaveCmdExtension implementing CommandExtensionPoint - Support all existing Wave commands: get-container, run-container, pack, debug-task - Enable clean syntax: 'nextflow wave get-container' vs 'nextflow plugin nf-wave:get-container' 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Configure Wave plugin to expose the new command extension alongside existing functionality, maintaining full backward compatibility. Changes: - Add WaveCmdExtension to plugin extensions registry - Import WaveCmd in WavePlugin for reference - Enable both 'nextflow wave' (new) and 'nextflow plugin nf-wave:command' (legacy) syntax 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
…tialization - Add comprehensive debug logging to track plugin command discovery process - Fix plugin initialization timing by ensuring all plugins are started before extension discovery - Add explicit plugin state checking and starting in ensurePluginsInitialized() - Enhance error logging in addPluginCommands() for better troubleshooting - Include test script for verifying CLI plugin command system functionality This completes the first-class plugin command system, enabling commands like 'nextflow wave' instead of the verbose 'nextflow plugin nf-wave:command' syntax. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Replace error message with helpful usage information when no subcommand provided. Add detailed help text showing available subcommands with descriptions and examples. Support 'help' subcommand and handle help flags gracefully. Maintain backward compatibility with existing Wave functionality. Users can now run 'nextflow wave' to see helpful usage information instead of an error. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add CommandExtensionPoint interface for plugin command registration - Add PluginCommandBase abstract class extending CmdBase - Add PluginCommandDiscovery for automatic command discovery and registration - Support priority-based conflict resolution for command names - Enable plugins to provide first-class CLI commands This system allows plugins to register commands that appear directly in the main Nextflow CLI help and can be executed as 'nextflow <command>' instead of the verbose 'nextflow plugin <plugin>:<command>' syntax. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Remove extension point interfaces moved to nextflow-plugin-gradle - Update imports in remaining files to use gradle plugin versions - Maintain backward compatibility for existing functionality Extension points are now provided by the nextflow-plugin gradle plugin to enable standalone plugin development while eliminating duplication in the main Nextflow codebase. Files removed: - PluginExtensionPoint.groovy - Factory.groovy - Function.groovy - Operator.groovy 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Remove CLI command classes moved to separate nf-wave-cli plugin - Clean up WavePlugin main class to focus on core Wave functionality - Update extensions.idx to remove CLI extension registrations This separation allows independent development of Wave CLI functionality while maintaining core Wave features in the main plugin. The CLI is now provided by the separate nf-wave-cli plugin for first-class command integration. Removed CLI classes: - WaveCmd.groovy - WaveCmdEntry.groovy - WaveCmdExtension.groovy - WaveDebugCmd.groovy - WaveRunCmd.groovy - Associated test files 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Update dependencies to use nextflow-plugin-gradle 1.0.0-beta.7 - Configure build system for new extension point architecture - Maintain compatibility with existing plugin ecosystem These changes support the new extension point system that enables standalone plugin development while maintaining full integration with the main Nextflow CLI system. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
I appreciate the ingenuity but I think this is too much dynamism My understanding is that you want to piggy-back on Nextflow's distribution mechanism to provide CLI tools as extensions. But I think that is really stretching the intended purpose of plugins If you need a new CLI tool, you should really just create a separate CLI tool that uses the Nextflow runtime as a library. I already went through this thought process with the language server. We ended up finding a suitable distribution mechanism for that (VS Code extension) and I'm sure we can do the same for your use case (e.g. DXT for MCP servers) |
|
Closing as not planned |
Summary
This PR implements a comprehensive system for Nextflow plugins to register first-class CLI commands that appear directly in the main Nextflow CLI, eliminating the need for verbose
nextflow plugin <plugin>:<command>syntax.🎯 Problem Solved
Before:
nextflow plugin nf-wave:command -- --helpAfter:
nextflow wave --helpUsers can now execute plugin commands as if they were built-in Nextflow commands.
🔧 Implementation
Core Components
Architecture Changes
📋 Changes
New Files
CommandExtensionPoint.groovy- Core interface for plugin command registrationPluginCommandBase.groovy- Abstract base class extending CmdBasePluginCommandDiscovery.groovy- Command discovery and registration systemModified Files
Launcher.groovy- Integrated plugin commands into main CLIRemoved Files
🧪 Testing
🔗 Related PRs
📖 Usage Example
🎉 Benefits
🤖 Generated with Claude Code