Rotini v1.2.0 has been released.
New
- Structured output. Declare a command’s
output:shape in the spec. Rotini generates its Go type, documents it on the help, man and markdown pages, and can publish a JSON Schema per output and a contract document for the whole CLI. See structured output. - JSON errors for scripts.
rotini.StructuredReporterwrites errors and other outcomes as JSON lines. - Roff man pages by default, with a
sectionsetting.ManPages()andMarkdownPages()return every page, ready to install. - Companion CLI adds
rotini completion <shell>androtini man --dir. - A guide to building cli plugins with rotini. See plugins.
Changed (breaking)
The API was renamed to be more consistent before more programs depend on it. Regenerate, and the compiler finds every call site to update:
- Inputs are methods on
rtx:rotini.Collect[T](rtx)is nowrtx.Inputs[T](), andParseArgv,ParseEnv,ParseFilesandParseStdinare nowrtx.ArgvInputs,EnvInputs,FileInputsandStdinInputs. - Reporting:
Program.WithFunnelis nowProgram.WithReporter. - Plugins: the spec keys
remote_commandsandremote_discoveryare nowpluginsandplugin_discovery, theRemote*types are nowPlugin*, androtini.CobraCompletionis nowrotini.PluginCompletion. - Input reading:
BinderandBindMetaare nowInputReaderandInputSettings. - Dependencies:
rotini.NewKeyis nowrotini.NewDependency. - Hooks: the
Default*no-op embeds are nowNo*, such asrotini.NoPreRun.
I really should have released rotini under a 0.X.X to start, but I didn’t. I don’t want to immediately jump into a v2 of the package, and with so few (zero) projects likely depending on rotini I’m going to eat the breaking api surface changes without providing aliases. In the future, once rotini has had more time to bake-in and has more usage, this is the type of thing I would version appropriately.
Fixed
- A number too large for a narrow flag type, such as
300for anint8, is now a usage error instead of a silently wrapped value.