Skip to content

Suppress Alias in help text option description? #154

Open

Description

@nbbaier

The program below prints help text that gives the user alias help text in two locations:

import { initTRPC } from "@trpc/server";
import { createCli } from "trpc-cli";
import { z } from "zod";

const t = initTRPC.create();

const router = t.router({
  add: t.procedure
    .meta({})
    .input(
      z.object({
        left: z.number().meta({ alias: "l", description: "Left number" }),
        right: z.number().meta({ alias: "r", description: "Right number" }),
      })
    )
    .query(({ input }) => input.left + input.right),
});

createCli({ router }).run();

The help text:

Usage: index add [options]

Options:
  -l, --left <number>   Left number; Alias: l
  -r, --right <number>  Right number; Alias: r
  -h, --help            display help for command

Is there a way to hide/not print the Alias: l and Alias: r. They're redundant, given that -l, --left/-r, --right is printed at the start of the line.

Activity

  1. mmkal commented on Oct 11, 2025

    @mmkal
    Owner

    Good catch. Yes we have a few cases like this where it's not helpful to include the property in the help text. Can fix soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions