Hey all,
The CLI team has been pondering how plugins might work for v6. We had
a fairly successful github thread a month ago, as well as some discussions here on vcap dev. We recently took some time to discuss the pros and cons of the various approaches. I've distilled this discussion into a convenient list of priorities and proposed features / solutions so that we can share our plan moving forward.
- any executable can be a plugin (i.e.: written in any language)
- plugins can provide a new command for users to invoke
- plugins must provide help, usage, etc
- plugins cannot override any of the blessed, internal commands
- plugins will be invoked by the CLI shelling out an executable named 'cf-$PLUGIN', or something similar
- plugins will be able to invoke the CLI
- existing commands should be decomposed so plugin authors can use them more effectively
- plugins will not be forced to run on all supported architectures / platforms
- plugins can opt-in to having flags parsed by the CLI (similar to existing flags)
- some existing commands will be converted to plugins, to help drive this effort
- plugins should have an API to print messages to the user, to ensure consistent UX
- there will be some sort of machine readable output in the CLI
- no attempt at securing plugins will be made (since you're effectively executing untrusted code)
- pre/post hooks (with extreme limitations and user warning) are a stretch goal
Our next steps are to start writing stories and slating this work for our upcoming iterations, so if you feel strongly that we're making a mistake, please let us know. If you look in
our tracker project, you may even see some of these stories coming together now.
As always, thoughts, concerns, rants, and ideas are all welcome.
Thanks!
-Tim, Karen, Dan, Anand, Foley and Scott {{The CLI team}}