mmkal / mmkal/trpc-cli

Global config options

Open
#95 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
373
Forks
13
PR merge metrics
No merged PRs in 30d

Description

It would be really nice to configure some global config options - perhaps like this

const cli = createCli({
  router,
  globalOpts: z.object(...)
});

This would be stuff like global log levels etc

I'd want the global opts to be listed at the bottom of --help for any command. I'm just not sure what a nice API to process the parsed global options would be. Perhaps just merge them in the trpc root context?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the createCli API and trace how command options are parsed and rendered in --help. Decide how globalOpts should be processed and exposed, including whether they belong in the tRPC root context. Done means a documented API supports global options and lists them at the bottom of --help for every command.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.