-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[Feature] Custom CLI plugin commands #6901
base: master
Are you sure you want to change the base?
Conversation
Interesting... any reason why you have to define |
You're absolutely right... |
Ok, now the field library is optional. |
Seems like that build for commit b351997 fails for a misconfiguration |
Nothing sticks out to me now. When I get home I'm going to take one last look and try it out, then we'll merge it tomorrow probably. Thanks for sticking through all of my nit-picking! |
Has been a great pleasure. |
Suddenly with git style subcommands options are not parsed... |
Did you ever discover what if anything was wrong with the subcommands? |
With this feature, plugins can register their own cli commands (according to the 6th point of @Radiergummi feature request #5734).
You can call the plugin command by executing:
./nodebb cmd <plugin-name>:<custom-command> [options]
You can register your plugin command in plugin.json with the commands block
plugin.json
In this scenario, NodeBB will call your cmd.js script and will call the callMyMethod function.
The script file will be like this:
cmd.js
This feature uses the NodeBB embedded commander.js for registering custom command.
You can have the plugin commands list executing:
./nodebb cmd --help