helpText

tcmts.cli.help.helpText · #ufdfr5pi · term · runs on the server

uses tcmts.cli.style.bold, which uses node:util

Help for a command (path from its name down, e.g. ["data", "migrate"]), or for tcm itself.

import { lookup, rootHelp, usageOf } from "#codebase/tcmts/cli/help";
import { bold, dim } from "#codebase/tcmts/cli/style";

export function helpText(path: string[]): string {
  if (!path.length) return rootHelp();
  const r = lookup(path);
  return [
    `${bold(`tcm ${path.join(" ")}`)} ${dim("—")} ${r.description ?? ""}`,
    "",
    ...usageOf(path),
  ].join("\n");
}

uses

used by