Skip to content

v0.6.0

Choose a tag to compare

@mmkal mmkal released this 14 May 03:00
· 102 commits to main since this release

0.5.x -> 0.6.0 is a big release - while the basic createCli({router}).run() usage is unchanged, a lot was rewritten and the actual CLI program created is different both superficially and under the hood.

There are changes and fixes still to come but the core functionality is working better than 0.5.x - just be aware that some like input prompts and trpc-cli binscript usage have some improvements still to come.

New features:

  1. valibot, arktype, effect and zod v4 can now all be used to define inputs (note: valibot requires installing an additional (official valibot) library)
  2. automatic input prompting via enquirer, @inquirer/prompts or prompts
  3. shell completion generation via omelette

Significant refactors (affects you if you were messing around with internals):

  1. Input parsers are now converted to json-schema as a common language, so they can be mapped to CLI arguments/options

Arguably breaking changes (affect user behaviour):

  1. commander is now used instead of cleye under the hood (so helptext formatting etc. is marginally different)
  2. the above enables proper subcommand support. So nested rooters are called like mycli search by-name instead of mycli search.byName. Also mycli search will list all of its subcommands (search router's procedures) along with helptext, etc.
  3. commands and option names are still kebab-cased but no longer aliased to camel-case (alias was a built-in feature of cleye, but doesn't seem worth mimicking since this is still on 0.x.x)

Other breaking changes (could affect some developers)

  1. built-in trpc version is v11. v10 support still exists but the module must be passed in. v10 support might be removed fairly soon
  2. FailedToExitError thrown when you pass an exit function that exits successfully - this actually makes it easier to run as a promise and get the return value, but requires try/catch
  3. aliases are defined on the procedure's meta, not globally. Though this might change again with zod 4's meta method

What's Changed

Full Changelog: v0.5.1...v0.6.0