You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Support for passthrough/arbitrary CLI flags #161
We're building Ultracite, a CLI wrapper around Biome (a linter/formatter). We want to allow users to pass any Biome CLI flag through our commands without having to explicitly define every possible flag in our tRPC schema.
Current Behavior
When using z.record(z.string(), z.unknown()) or z.object({}).passthrough(), trpc-cli doesn't accept unknown flags. For example:
This works but means we can't support new Biome flags without updating our CLI.
Related
I noticed allowUnknownOption() is called in the trpc-cli source, but it seems to only apply at the program level, not for individual commands with schemas.
Proposed Solution
Perhaps something like:
check: t.procedure.meta({description: 'Run linter',allowUnknownOptions: true,// new option}).input(z.tuple([z.array(z.string()).optional(),z.record(z.string(),z.unknown()),// would now accept any --flag]))
This would maintain type safety for known options while allowing flexibility for pass-through scenarios.
Would love to hear if this is something you'd consider adding, or if there's an existing pattern I'm missing!
Yes, I'd love to support this. I agree that better Record<string, unknown> support is a good first step. I've also opened this issue on commander which would make this easier: tj/commander.js#2424
Activity
mmkal commentedon Nov 23, 2025
Yes, I'd love to support this. I agree that better Record<string, unknown> support is a good first step. I've also opened this issue on commander which would make this easier: tj/commander.js#2424