Releases: mmkal/trpc-cli
v0.10.0
- rewrite readme; more organized, less repetitive, clearer (#133) 1650b41
- define positional arguments via
.meta(#132) 62965c7 - alias options via zod meta (#129) 7df0c8b
- opt-in negatable booleans (#128) 41fbb3e
- fix tsdown output warnings (#122) fc29cd6
- fix json input (#121) 9b3e1e0
- rm limitations that aren't true anymore 623fe14
v0.9.2
fix: missed another bundler confusion spot
Full Changelog: v0.9.1...v0.9.2
v0.9.1
v0.9.0
You can now also pass an oRPC router (thanks @unnoq)! Much like tRPC, just pass a router:
import {os} from '@orpc/server'
import {z, createCli} from 'trpc-cli'
export const router = os.router({
add: os.procedure
.input(z.object({left: z.number(), right: z.number()}))
.handler(({input}) => input.left + input.right),
})
const cli = createCli({router})
cli.run()Commits in this release:
- add post-release job 73fd9f3
- support @clack/prompts (#109) 35a6b91
- support orpc routers (#105) 11350cb
- refactor: clean up parseRouter implementation (#104) 71f5f9f
v0.8.0
v0.7.1
v0.7.0
What's Changed
- standard-schema error prettifier by @mmkal in #87
- use zod/v4 by @mmkal in #85 - note that zod/v4 already worked, but now we can take advantage of
.meta(...)and get nicer messages when users pass invalid commands (nicer messages for valibot, arktype and effect too!) - sync tests for all validation libraries, bump arktype and valibot by @mmkal in #80
Full Changelog: v0.6.0...v0.7.0
v0.6.0
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:
- valibot, arktype, effect and zod v4 can now all be used to define inputs (note: valibot requires installing an additional (official valibot) library)
- automatic input prompting via
enquirer,@inquirer/promptsorprompts - shell completion generation via
omelette
Significant refactors (affects you if you were messing around with internals):
- 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):
commanderis now used instead ofcleyeunder the hood (so helptext formatting etc. is marginally different)- the above enables proper subcommand support. So nested rooters are called like
mycli search by-nameinstead ofmycli search.byName. Alsomycli searchwill list all of its subcommands (searchrouter's procedures) along with helptext, etc. - 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)
- built-in trpc version is v11. v10 support still exists but the module must be passed in. v10 support might be removed fairly soon
FailedToExitErrorthrown when you pass anexitfunction that exits successfully - this actually makes it easier to run as a promise and get the return value, but requires try/catch- aliases are defined on the procedure's meta, not globally. Though this might change again with zod 4's
metamethod
What's Changed
- switch to
commander, enable sub-commands, completion by @mmkal in #56 - support arktype (generalise json-schemable validation libraries) by @mmkal in #59
- Valibot support by @mmkal in #62
- Support
effectby @mmkal in #68 - Bin script by @mmkal in #71 (actually this doesn't fully work yet)
- kebab case command names by @mmkal in #72
- Zod4 by @mmkal in #75
- allow customising program by @mmkal in #74
- Prompts by @mmkal in #76
- parseRouter fn by @mmkal in #81
Full Changelog: v0.5.1...v0.6.0