readerly exports everything below. Each subpath loads only its own layer.
readerly/out
Section titled "readerly/out"import { createOut } from "readerly/out";createOut, the console a command writes to. See Output.
readerly/detect
Section titled "readerly/detect"import { detect } from "readerly/detect";
const { reader, reason } = detect(); // "agent", "AI_AGENT"Who reads the output, and the signal that decided it. It also exports ciName and the harnesses registry. See Readers.
readerly/profile
Section titled "readerly/profile"import { resolveProfile } from "readerly/profile";
const profile = resolveProfile({ tool: "acme", argv: process.argv.slice(2) });The format, color, prompts and budget for a run, with why for each. readerFlags scans argv for the reader flags, and formatEnvName("acme") gives ACME_FORMAT.
readerly/color
Section titled "readerly/color"import { colorEnabled, createStyle } from "readerly/color";
const style = createStyle(colorEnabled({ env: process.env, isTTY: process.stdout.isTTY }));
console.log(style("red", "failed"));Whether to color, from --color, FORCE_COLOR, NO_COLOR and the TTY, and a styleText that returns plain text when color is off.
readerly/budget
Section titled "readerly/budget"import { DEFAULT_REPORT_BUDGET, planBudget } from "readerly/budget";Plans which groups and rows of a report fit a character budget, errors first. DEFAULT_REPORT_BUDGET is 8000.
readerly/github
Section titled "readerly/github"import { githubAnnotations } from "readerly/github";
process.stderr.write(githubAnnotations(diagnostics));GitHub Actions workflow commands for the errors and warnings that have a file, at most 10 of each by default.
readerly/progress
Section titled "readerly/progress"import { createProgress } from "readerly/progress";
const bar = createProgress("Scanning files");A progress line on stderr for a step that takes over two seconds. See Progress.
readerly/prompt
Section titled "readerly/prompt"import { ask, canPrompt, confirm, readInput } from "readerly/prompt";Answers from a flag, --input, a variable, a prompt or the default, else an action_required failure. See Prompts and input.
readerly/envelope
Section titled "readerly/envelope"import { actionRequired, failure, FailureError, toFailure } from "readerly/envelope";Failures with a kind, a status and an exit code. See Failures.
readerly/tree
Section titled "readerly/tree"import { tree } from "readerly/tree";
tree("✖ Account is required.", [["fix", "Pass --account."], ["rerun", "acme deploy --account <account>"]]);A headline and its ├▶ and ╰▶ branches, as the terminal prints a diagnostic.
readerly/nostics
Section titled "readerly/nostics"import { fromNostics, nosticsReporter } from "readerly/nostics";
const report = nosticsReporter(out);Turns nostics diagnostics into readerly's, without depending on nostics. nosticsReporter(out) sends each one to out.