❯ rotini --documentation█

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.StructuredReporter writes errors and other outcomes as JSON lines.
  • Roff man pages by default, with a section setting. ManPages() and MarkdownPages() return every page, ready to install.
  • Companion CLI adds rotini completion <shell> and rotini 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 now rtx.Inputs[T](), and ParseArgv, ParseEnv, ParseFiles and ParseStdin are now rtx.ArgvInputs, EnvInputs, FileInputs and StdinInputs.
  • Reporting: Program.WithFunnel is now Program.WithReporter.
  • Plugins: the spec keys remote_commands and remote_discovery are now plugins and plugin_discovery, the Remote* types are now Plugin*, and rotini.CobraCompletion is now rotini.PluginCompletion.
  • Input reading: Binder and BindMeta are now InputReader and InputSettings.
  • Dependencies: rotini.NewKey is now rotini.NewDependency.
  • Hooks: the Default* no-op embeds are now No*, such as rotini.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 300 for an int8, is now a usage error instead of a silently wrapped value.