mainfunctionfunction main(argv: readonly string[], deps?: MainDeps): Promise<number>Runs repoctl with the words after its name; returns the exit status.
repoctl, the operations program of a repository (commons repoctl 0006-repoctl-surfaces; 0010-repoctl-host): a generic host on Headless driven by the typed configuration repoctl.config.ts at the root of the repository it operates (or the file --config FILE names). Its verbs are declared with the facts of their actions and Headless runs them: it parses the words, decides whether a run proceeds, previews, asks or is refused, draws the output (the report on standard output; the problems, the verdict and the one next: command on standard error), explains the problem codes (repoctl explain <code>) and generates its help, completions and man page. The tier the program holds is the host's (the configuration names the variable, REPOCTL_TIER by default: public, contributor, releaser; contributor where it says nothing).
repoctl check # at the root of a repository that has a repoctl.config.ts
repoctl --config ci/repoctl.config.ts sync --checkA run ends in Headless' statuses: 0 ok, 1 findings, 2 a command line that does not fit, 3 a host that cannot do it (a repository with no usable configuration is one), 4 where a check finds something pending. The repository's root is the folder of the configuration file. help, explain and doctor run where there is no configuration, and say so.
import { main } from "./repoctl.ts";
const status = await main(["help"], { cwd: "/tmp", out: () => undefined, err: () => undefined });
status; // 0mainfunctionfunction main(argv: readonly string[], deps?: MainDeps): Promise<number>Runs repoctl with the words after its name; returns the exit status.
MainDepstypeno test imports ittype MainDeps = {
readonly env?: Readonly<Record<string, string | undefined>>;
readonly cwd?: string;
/** Where the report goes (standard output by default). */
readonly out?: (text: string) => void;
/** Where the problems and the verdict go (standard error by default). */
readonly err?: (text: string) => void;
};What main is given besides the command line; each is read from this process where it is not.