/** Render argv as a POSIX shell command line, quoting where needed. */ export const shellCommand = (argv: readonly string[]) => argv .map((arg) => /^[A-Za-z0-9_./:=+@%-]+$/.test(arg) ? arg : `'${arg.replaceAll("'", `'\\''`)}'`, ) .join(" ") /** * Base options that all commands accept */ export interface BaseCommandOptions { readonly silent?: boolean readonly verbose?: boolean readonly json?: boolean readonly dryRun?: boolean /** Whether this invocation may open prompts or selectors. */ readonly inputAllowed?: boolean /** * Working directory to use instead of process.cwd(). * Primarily used for testing to enable concurrent test execution. */ readonly cwd?: string }