[{"data":1,"prerenderedAt":794,"buildId":795},["ShallowReactive",2],{"docs:\u002Fguide\u002Fflags":3},{"page":4,"section":16,"document":17,"credits":10,"prev":788,"next":791},{"id":5,"path":6,"file":7,"title":8,"sourceTitle":8,"description":9,"tagline":9,"eyebrow":10,"credits":10,"keywords":11,"icon":12,"layout":13,"sidebar":14,"toc":14,"kind":10,"group":10,"navigation":14,"order":15},"flags","\u002Fguide\u002Fflags","guide\u002Fflags.md","Shared flags","The reader flags every readerly command accepts, such as --format, --full, --no-input and --verbose, what each changes, and how the rest reach your parser.",null,[],"i-lucide-flag","article",true,6,"guide",{"nodes":18,"toc":782},[19,44,267,288,296,322,345,425,443,467,473,499,697,705,721,746,752,776],[20,21,22,23,27,28,35,36,39,40,43],"p",{},"Every command built on readerly accepts the same reader flags. ",[24,25,26],"code",{},"readerFlags(argv)"," in ",[29,30,32],"a",{"href":31},"https:\u002F\u002Fgithub.com\u002Floadsheet\u002Freaderly\u002Fblob\u002Fmain\u002Fsrc\u002Fflags.ts",[24,33,34],{},"src\u002Fflags.ts"," scans for them, and ",[24,37,38],{},"createOut"," calls it with the ",[24,41,42],{},"argv"," you pass.",[45,46,47,60],"table",{},[48,49,50],"thead",{},[51,52,53,57],"tr",{},[54,55,56],"th",{},"Flag",[54,58,59],{},"What it changes",[61,62,63,93,111,145,165,185,201,222,236,253],"tbody",{},[51,64,65,71],{},[66,67,68],"td",{},[24,69,70],{},"--format \u003Cname>",[66,72,73,74,78,79,82,83,82,86,82,89,92],{},"The ",[29,75,77],{"href":76},"\u002Fguide\u002Fformats","format",": ",[24,80,81],{},"text",", ",[24,84,85],{},"agent",[24,87,88],{},"json",[24,90,91],{},"jsonl",", or one the tool adds. An unknown name is a usage failure, exit code 2.",[51,94,95,100],{},[66,96,97],{},[24,98,99],{},"--json",[66,101,102,103,106,107,110],{},"The same as ",[24,104,105],{},"--format json",". ",[24,108,109],{},"--format"," wins when both are given.",[51,112,113,118],{},[66,114,115],{},[24,116,117],{},"--full",[66,119,120,121,125,126,129,130,27,133,135,136,139,140,27,142,144],{},"Turns the agent ",[29,122,124],{"href":123},"\u002Fguide\u002Fbudget","budget"," and the terminal's row cap off. Adds each diagnostic's ",[24,127,128],{},"why"," and ",[24,131,132],{},"docs",[24,134,85],{},", and a ",[24,137,138],{},"see:"," branch with its ",[24,141,132],{},[24,143,81],{},".",[51,146,147,152],{},[66,148,149],{},[24,150,151],{},"--max-chars \u003Cn>",[66,153,154,155,158,159,161,162,164],{},"Sets the budget to ",[24,156,157],{},"n"," characters. ",[24,160,157],{}," must be a positive integer, or the run is a usage failure. ",[24,163,117],{}," wins over it.",[51,166,167,175],{},[66,168,169,82,172],{},[24,170,171],{},"--color",[24,173,174],{},"--no-color",[66,176,177,178,180,181,144],{},"Turns color on or off in ",[24,179,81],{},". The last one given wins. See ",[29,182,184],{"href":183},"\u002Fguide\u002Fcolor","Color",[51,186,187,195],{},[66,188,189,82,192],{},[24,190,191],{},"--no-input",[24,193,194],{},"--non-interactive",[66,196,197,198,144],{},"Turns prompts off. A prompt with a default uses it, and one without fails with ",[24,199,200],{},"action_required",[51,202,203,211],{},[66,204,205,82,208],{},[24,206,207],{},"--yes",[24,209,210],{},"-y",[66,212,213,214,217,218,221],{},"Answers yes to an ",[24,215,216],{},"out.confirm"," that no flag, ",[24,219,220],{},"--input"," or env value answered, except one that asks for a typed name.",[51,223,224,229],{},[66,225,226],{},[24,227,228],{},"--verbose",[66,230,231,232,235],{},"Prints the profile's reasons and ",[24,233,234],{},"out.debug()"," lines on stderr.",[51,237,238,243],{},[66,239,240],{},[24,241,242],{},"--quiet",[66,244,245,246,248,249,252],{},"In ",[24,247,81],{},", drops ",[24,250,251],{},"out.log()"," lines, info rows and the progress line. The verdict still counts the infos.",[51,254,255,260],{},[66,256,257],{},[24,258,259],{},"--input \u003Cjson|@file|@->",[66,261,262,263,144],{},"Passes answers to prompts as a JSON object, a file, or stdin. See ",[29,264,266],{"href":265},"\u002Fguide\u002Fprompts","Prompts and input",[20,268,269,129,271,273,274,277,278,106,281,283,284,287],{},[24,270,228],{},[24,272,242],{}," cancel each other, and the last one given wins. There is no ",[24,275,276],{},"-v"," or ",[24,279,280],{},"-q",[24,282,276],{}," usually means ",[24,285,286],{},"--version",", so readerly leaves both to your tool.",[289,290,295],"h2",{"id":291,"anchor":292},"how-the-scan-works",{"label":293,"icon":294},"Section titled \"How the scan works\"","#","How the scan works",[20,297,298,301,302,277,304,307,308,311,312,315,316,277,319,144],{},[24,299,300],{},"readerFlags"," never throws, and it doesn't change the array you pass. A flag that takes a value accepts ",[24,303,105],{},[24,305,306],{},"--format=json",". When the value is missing, or the next argument starts with ",[24,309,310],{},"--",", the value is empty, and ",[24,313,314],{},"resolveProfile"," reports ",[24,317,318],{},"--format needs a value.",[24,320,321],{},"--max-chars needs a value.",[20,323,324,325,328,329,331,332,334,335,337,338,341,342,344],{},"Everything else goes to ",[24,326,327],{},"rest",", in order: positional arguments, your tool's own flags, ",[24,330,276],{},". The scan stops at ",[24,333,310],{},", which goes to ",[24,336,327],{}," with every argument after it, so ",[24,339,340],{},"acme lint -- --json"," passes ",[24,343,99],{}," to your tool.",[346,347,351],"pre",{"language":348,"filename":349,"class":350,"wrap":14},"ts","flags.ts","shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[24,352,354,377,378,377,380,377,419],{"class":353},"language-ts",[355,356,359,363,367,370,374],"span",{"class":357,"style":358},"line","display: inline",[355,360,362],{"style":361},"color:#CF222E;--shiki-dark:#FF7B72","import",[355,364,366],{"style":365},"color:#1F2328;--shiki-dark:#E6EDF3"," { readerFlags } ",[355,368,369],{"style":361},"from",[355,371,373],{"style":372},"color:#0A3069;--shiki-dark:#A5D6FF"," \"readerly\u002Fprofile\"",[355,375,376],{"style":365},";","\n",[355,379],{"class":357,"style":358},[355,381,382,385,388,391,393,396,398,401,403,406,408,411,413,416],{"class":357,"style":358},[355,383,300],{"style":384},"color:#8250DF;--shiki-dark:#D2A8FF",[355,386,387],{"style":365},"([",[355,389,390],{"style":372},"\"check\"",[355,392,82],{"style":365},[355,394,395],{"style":372},"\"--json\"",[355,397,82],{"style":365},[355,399,400],{"style":372},"\"src\"",[355,402,82],{"style":365},[355,404,405],{"style":372},"\"--fix\"",[355,407,82],{"style":365},[355,409,410],{"style":372},"\"--max-chars\"",[355,412,82],{"style":365},[355,414,415],{"style":372},"\"10\"",[355,417,418],{"style":365},"]);",[355,420,421],{"class":357,"style":358},[355,422,424],{"style":423},"color:#6E7781;--shiki-dark:#8B949E","\u002F\u002F { json: true, maxChars: \"10\", rest: [\"check\", \"src\", \"--fix\"], full: false, … }",[20,426,427,428,430,431,435,436,439,440,144],{},"Hand ",[24,429,327],{}," to your argument parser. ",[29,432,434],{"href":433},"\u002Fintegrations\u002Fargument-parsers","Argument parsers"," has examples with ",[24,437,438],{},"node:util"," ",[24,441,442],{},"parseArgs",[20,444,445,447,448,450,451,454,455,277,458,461,462,277,464,466],{},[24,446,38],{}," also builds the rerun command from ",[24,449,327],{},", such as ",[24,452,453],{},"acme check src"," in a ",[24,456,457],{},"next:",[24,459,460],{},"hidden:"," line. Reader flags never appear in it, and readerly adds ",[24,463,117],{},[24,465,105],{}," where a line needs them.",[289,468,472],{"id":469,"anchor":470},"what-the-flags-set-in-the-profile",{"label":471,"icon":294},"Section titled \"What the flags set in the profile\"","What the flags set in the profile",[20,474,475,27,478,484,485,489,490,106,493,495,496,144],{},[24,476,477],{},"resolveProfile()",[29,479,481],{"href":480},"https:\u002F\u002Fgithub.com\u002Floadsheet\u002Freaderly\u002Fblob\u002Fmain\u002Fsrc\u002Fprofile.ts",[24,482,483],{},"src\u002Fprofile.ts"," combines the flags with the environment and ",[29,486,488],{"href":487},"\u002Fguide\u002Freaders","detection"," into one ",[24,491,492],{},"Profile",[24,494,38],{}," exposes it as ",[24,497,498],{},"out.profile",[45,500,501,513],{},[48,502,503],{},[51,504,505,510],{},[54,506,507,509],{},[24,508,492],{}," field",[54,511,512],{},"Set by",[61,514,515,531,558,581,602,613,626,644,664,680],{},[51,516,517,521],{},[66,518,519],{},[24,520,77],{},[66,522,523,82,525,82,527,530],{},[24,524,109],{},[24,526,99],{},[24,528,529],{},"\u003CTOOL>_FORMAT",", then detection",[51,532,533,538],{},[66,534,535],{},[24,536,537],{},"color",[66,539,540,82,542,544,545,548,549,27,552,82,554,129,556],{},[24,541,171],{},[24,543,174],{},", then the ",[29,546,547],{"href":183},"color rule","; always ",[24,550,551],{},"false",[24,553,85],{},[24,555,88],{},[24,557,91],{},[51,559,560,565],{},[66,561,562],{},[24,563,564],{},"interactive",[66,566,567,570,571,574,575,577,578,580],{},[24,568,569],{},"true"," only for the ",[24,572,573],{},"terminal"," reader on ",[24,576,81],{},", without ",[24,579,191],{},", with stdin and stderr on a TTY",[51,582,583,587],{},[66,584,585],{},[24,586,124],{},[66,588,589,591,592,595,596,598,599,601],{},[24,590,117],{}," (no limit), ",[24,593,594],{},"--max-chars",", then 8,000 for the ",[24,597,85],{}," format or an agent reading ",[24,600,81],{},"; no limit otherwise",[51,603,604,609],{},[66,605,606],{},[24,607,608],{},"full",[66,610,611],{},[24,612,117],{},[51,614,615,620],{},[66,616,617],{},[24,618,619],{},"yes",[66,621,622,82,624],{},[24,623,207],{},[24,625,210],{},[51,627,628,633],{},[66,629,630],{},[24,631,632],{},"verbosity",[66,634,635,82,638,277,641],{},[24,636,637],{},"verbose",[24,639,640],{},"quiet",[24,642,643],{},"normal",[51,645,646,651],{},[66,647,648],{},[24,649,650],{},"annotations",[66,652,653,656,657,660,661,663],{},[24,654,655],{},"\"github\""," for the ",[24,658,659],{},"ci"," reader on GitHub Actions with ",[24,662,81],{},"; not set otherwise",[51,665,666,670],{},[66,667,668],{},[24,669,488],{},[66,671,73,672,675,676,679],{},[24,673,674],{},"Detection"," from ",[24,677,678],{},"detect()",", or the one you passed",[51,681,682,686],{},[66,683,684],{},[24,685,128],{},[66,687,688,689,82,691,82,693,129,695],{},"One reason each for ",[24,690,77],{},[24,692,537],{},[24,694,564],{},[24,696,124],{},[289,698,702,703],{"id":699,"anchor":700},"seeing-why-with-verbose",{"label":701,"icon":294},"Section titled \"Seeing why with --verbose\"","Seeing why with ",[24,704,228],{},[20,706,707,708,82,710,712,713,716,717,720],{},"With ",[24,709,228],{},[24,711,38],{}," writes ",[24,714,715],{},"profile.why"," to stderr once, the first time the command prints anything, one line per decision. A coding agent running ",[24,718,719],{},"acme check --verbose"," gets this on stderr:",[346,722,723],{"language":81,"class":350,"wrap":14},[24,724,726,377,731,377,736,377,741],{"class":725},"language-text",[355,727,728],{"class":357,"style":358},[355,729,730],{},"format: agent (detected agent (AI_AGENT))",[355,732,733],{"class":357,"style":358},[355,734,735],{},"color: false (format agent)",[355,737,738],{"class":357,"style":358},[355,739,740],{},"interactive: false (reader is agent)",[355,742,743],{"class":357,"style":358},[355,744,745],{},"budget: 8000 (format agent)",[20,747,748,749,751],{},"The same run with ",[24,750,99],{}," in a pipe:",[346,753,754],{"language":81,"class":350,"wrap":14},[24,755,756,377,761,377,766,377,771],{"class":725},[355,757,758],{"class":357,"style":358},[355,759,760],{},"format: json (--json)",[355,762,763],{"class":357,"style":358},[355,764,765],{},"color: false (format json)",[355,767,768],{"class":357,"style":358},[355,769,770],{},"interactive: false (reader is pipe)",[355,772,773],{"class":357,"style":358},[355,774,775],{},"budget: Infinity (no budget for pipe on json)",[20,777,778,779,781],{},"When a command prints something different from what you expected, run it with ",[24,780,228],{}," first. Each line names the flag, variable or detection result that decided it.",[783,785,786],{"id":291,"depth":784,"text":295},2,{"id":469,"depth":784,"text":472},{"id":699,"depth":784,"text":787},"Seeing why with --verbose",{"path":76,"title":789,"description":790},"Formats","The four output formats readerly prints, text, agent, json and jsonl, with the exact output of one command in each, and how readerly picks one.",{"path":183,"title":792,"description":793},"Color and glyphs","The one rule readerly uses to turn color on or off, which formats never print escape codes, and the glyphs and colors the text format uses.",1795985393203,"22ea5d7b-bce0-4e3b-bca3-1fbe3722fcf7"]