Features
Flag/Argument parsing
No CLI framework would be complete without a flag parser. We've built a custom one from years of experimentation that we feel consistently handles user input flexible enough for the user to be able to easily use the CLI in ways they expect, but without compromising strictness guarantees to the developer.
Configurable Topic Separators
By default topics will be separated with colons, e.g. my:awesome:command
. However, you have the option to use spaces if you prefer, e.g. my awesome command
.
Super Speed
The overhead for running an oclif CLI command is almost nothing. It requires very few dependencies (only 28 dependencies in a minimal setup—including all transitive dependencies). Also, only the command to be executed will be required with node. So large CLIs with many commands will load just as fast as a small one with a single command.
CLI Generator
Run a single command to scaffold out a fully functional CLI and get started quickly. See Generator Commands.
Testing Helpers
We've put a lot of work into making commands easily testable and easy to mock out stdout/stderr. The generator will automatically create scaffolded tests.
Auto-documentation
By default you can pass --help
to the CLI to get help such as flag options and argument information. This information is also automatically placed in the README whenever the npm package of the CLI is published. See the plugin-plugins as an example.
Plugins
Using plugins, users of the CLI can extend it with new functionality, a CLI can be split into modular components, and functionality can be shared amongst multiple CLIs. See Building your own plugin.
Hooks
Use lifecycle hooks to run functionality any time a CLI starts, or on custom triggers. Use this whenever custom functionality needs to be shared between various components of the CLI. See Hooks.