ask

tcmts.cli.ui.ask · #clpa3ruw · term · runs on the server

uses @clack/prompts's exports, which uses node:fs

Free text, asked for if a person can be.

import { answer, interactive, UsageError } from "#codebase/tcmts/cli/ui";
import * as p from "@clack/prompts";

export async function ask(usage: string, message: string, placeholder?: string): Promise<string> {
  if (!interactive()) throw new UsageError(`usage: tcm ${usage}`);
  return answer<string>(await p.text({ message, placeholder, validate: (v) => (v?.trim() ? undefined : "required") }));
}

uses

used by