[{"data":1,"prerenderedAt":1043,"buildId":1044},["ShallowReactive",2],{"docs:\u002Fguide\u002Fformats":3},{"page":4,"section":16,"document":17,"credits":10,"prev":1037,"next":1039},{"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},"formats","\u002Fguide\u002Fformats","guide\u002Fformats.md","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.",null,[],"i-lucide-file-text","article",true,5,"guide",{"nodes":18,"toc":1026},[19,36,137,145,177,184,244,250,258,291,303,309,339,594,600,616,655,662,668,681,740,749,758,769,777,786,800,818,824,834,964,1000,1006],[20,21,22,23,27,28,35],"p",{},"A format is how a command's output is written. readerly has four built in, and a tool can add its own. This page shows the ",[24,25,26],"code",{},"acme check"," example from ",[29,30,32],"a",{"href":31},"https:\u002F\u002Fgithub.com\u002Floadsheet\u002Freaderly\u002Fblob\u002Fmain\u002Ftest\u002Fgolden",[24,33,34],{},"test\u002Fgolden"," in each.",[37,38,39,58],"table",{},[40,41,42],"thead",{},[43,44,45,49,52,55],"tr",{},[46,47,48],"th",{},"Format",[46,50,51],{},"Picked for",[46,53,54],{},"Color",[46,56,57],{},"Writes",[59,60,61,83,99,120],"tbody",{},[43,62,63,69,72,80],{},[64,65,66],"td",{},[24,67,68],{},"text",[64,70,71],{},"A person at a terminal, CI, a pipe",[64,73,74,75,79],{},"When the ",[29,76,78],{"href":77},"\u002Fguide\u002Fcolor","color rule"," allows",[64,81,82],{},"Findings on stdout; prompts, progress and failures on stderr",[43,84,85,90,93,96],{},[64,86,87],{},[24,88,89],{},"agent",[64,91,92],{},"A coding agent",[64,94,95],{},"Never",[64,97,98],{},"The report and failures on stdout, 8,000 characters by default",[43,100,101,106,115,117],{},[64,102,103],{},[24,104,105],{},"json",[64,107,108,111,112],{},[24,109,110],{},"--format json"," or ",[24,113,114],{},"--json",[64,116,95],{},[64,118,119],{},"One document on stdout, also on failure",[43,121,122,127,132,134],{},[64,123,124],{},[24,125,126],{},"jsonl",[64,128,129],{},[24,130,131],{},"--format jsonl",[64,133,95],{},[64,135,136],{},"One JSON record per line on stdout, as entries happen",[138,139,143],"h2",{"id":68,"anchor":140},{"label":141,"icon":142},"Section titled \"text\"","#",[24,144,68],{},[20,146,147,148,151,152,155,156,159,160,163,164,167,168,171,172,176],{},"A verdict line, the diagnostics with a ",[24,149,150],{},"├▶ ╰▶"," tree for ",[24,153,154],{},"why"," and ",[24,157,158],{},"fix",", then the ",[24,161,162],{},"next:"," lines. Errors print before warnings and infos. At a terminal it shows 50 rows by default and hides the rest behind a ",[24,165,166],{},"… N more"," line; CI, pipes and ",[24,169,170],{},"--full"," get every row. ",[29,173,175],{"href":174},"\u002Fguide\u002Fdiagnostics","Diagnostics"," covers the layout.",[20,178,179,180,183],{},"A person at a terminal gets this on stdout, with the prompt ",[24,181,182],{},"? Apply 2 safe fixes? (y\u002FN) "," on stderr between the warning and the blank line:",[185,186,188],"pre",{"language":68,"class":187,"wrap":14},"shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[24,189,191,199,200,199,205,199,210,199,215,199,220,199,225,199,230,199,235,199,239],{"class":190},"language-text",[192,193,196],"span",{"class":194,"style":195},"line","display: inline",[192,197,198],{},"✖ 2 errors, 1 warning in 212 files (0.8s)","\n",[192,201,202],{"class":194,"style":195},[192,203,204],{},"",[192,206,207],{"class":194,"style":195},[192,208,209],{},"error ACME001  src\u002Fapp.ts:14:3  Route handler reads process.env at module scope",[192,211,212],{"class":194,"style":195},[192,213,214],{},"├▶ why: The value is fixed at build time",[192,216,217],{"class":194,"style":195},[192,218,219],{},"╰▶ fix: Read it inside the handler",[192,221,222],{"class":194,"style":195},[192,223,224],{},"error ACME004  src\u002Fdb.ts:3:1  Top-level await in a server entry",[192,226,227],{"class":194,"style":195},[192,228,229],{},"╰▶ fix: Move the call into the plugin setup",[192,231,232],{"class":194,"style":195},[192,233,234],{},"warn  ACME010  vite.config.ts:8:5  Alias shadows a workspace package",[192,236,237],{"class":194,"style":195},[192,238,204],{},[192,240,241],{"class":194,"style":195},[192,242,243],{},"next: acme explain \u003Ccode>   (explains one code)",[138,245,248],{"id":89,"anchor":246},{"label":247,"icon":142},"Section titled \"agent\"",[24,249,89],{},[20,251,252,253,257],{},"The verdict on line 1, one line per diagnostic, no color, no glyphs and no prompts, under a ",[29,254,256],{"href":255},"\u002Fguide\u002Fbudget","budget",". A coding agent gets:",[185,259,260],{"language":68,"class":187,"wrap":14},[24,261,262,199,267,199,272,199,277,199,282,199,287],{"class":190},[192,263,264],{"class":194,"style":195},[192,265,266],{},"acme check: failed. 2 errors, 1 warning in 212 files (0.8s).",[192,268,269],{"class":194,"style":195},[192,270,271],{},"error ACME001 src\u002Fapp.ts:14:3 Route handler reads process.env at module scope. fix: Read it inside the handler",[192,273,274],{"class":194,"style":195},[192,275,276],{},"error ACME004 src\u002Fdb.ts:3:1 Top-level await in a server entry. fix: Move the call into the plugin setup",[192,278,279],{"class":194,"style":195},[192,280,281],{},"warn ACME010 vite.config.ts:8:5 Alias shadows a workspace package",[192,283,284],{"class":194,"style":195},[192,285,286],{},"next: acme check --fix   (applies 2 safe fixes)",[192,288,289],{"class":194,"style":195},[192,290,243],{},[20,292,293,294,297,298,302],{},"The prompt it couldn't ask became ",[24,295,296],{},"next: acme check --fix",". ",[29,299,301],{"href":300},"\u002Fguide\u002Fagents","Coding agents"," explains each part.",[138,304,307],{"id":105,"anchor":305},{"label":306,"icon":142},"Section titled \"json\"",[24,308,105],{},[20,310,311,312,315,316,315,319,315,322,315,325,155,328,297,331,334,335,338],{},"One document with ",[24,313,314],{},"schema",", ",[24,317,318],{},"status",[24,320,321],{},"summary",[24,323,324],{},"diagnostics",[24,326,327],{},"result",[24,329,330],{},"next",[24,332,333],{},"out.log()"," lines are left out. ",[24,336,337],{},"acme check --format json"," prints:",[185,340,341],{"language":68,"class":187,"wrap":14},[24,342,343,199,348,199,353,199,358,199,363,199,368,199,373,199,378,199,383,199,388,199,393,199,398,199,403,199,408,199,413,199,418,199,423,199,428,199,433,199,438,199,442,199,446,199,451,199,456,199,461,199,466,199,471,199,476,199,480,199,484,199,489,199,494,199,499,199,504,199,509,199,514,199,519,199,524,199,529,199,534,199,539,199,543,199,548,199,552,199,557,199,562,199,566,199,570,199,575,199,580,199,584,199,589],{"class":190},[192,344,345],{"class":194,"style":195},[192,346,347],{},"{",[192,349,350],{"class":194,"style":195},[192,351,352],{},"  \"schema\": \"acme.check\u002Fv1\",",[192,354,355],{"class":194,"style":195},[192,356,357],{},"  \"status\": \"failed\",",[192,359,360],{"class":194,"style":195},[192,361,362],{},"  \"summary\": {",[192,364,365],{"class":194,"style":195},[192,366,367],{},"    \"error\": 2,",[192,369,370],{"class":194,"style":195},[192,371,372],{},"    \"warn\": 1,",[192,374,375],{"class":194,"style":195},[192,376,377],{},"    \"info\": 0",[192,379,380],{"class":194,"style":195},[192,381,382],{},"  },",[192,384,385],{"class":194,"style":195},[192,386,387],{},"  \"diagnostics\": [",[192,389,390],{"class":194,"style":195},[192,391,392],{},"    {",[192,394,395],{"class":194,"style":195},[192,396,397],{},"      \"severity\": \"error\",",[192,399,400],{"class":194,"style":195},[192,401,402],{},"      \"code\": \"ACME001\",",[192,404,405],{"class":194,"style":195},[192,406,407],{},"      \"message\": \"Route handler reads process.env at module scope\",",[192,409,410],{"class":194,"style":195},[192,411,412],{},"      \"why\": \"The value is fixed at build time\",",[192,414,415],{"class":194,"style":195},[192,416,417],{},"      \"fix\": \"Read it inside the handler\",",[192,419,420],{"class":194,"style":195},[192,421,422],{},"      \"file\": \"src\u002Fapp.ts\",",[192,424,425],{"class":194,"style":195},[192,426,427],{},"      \"line\": 14,",[192,429,430],{"class":194,"style":195},[192,431,432],{},"      \"column\": 3",[192,434,435],{"class":194,"style":195},[192,436,437],{},"    },",[192,439,440],{"class":194,"style":195},[192,441,392],{},[192,443,444],{"class":194,"style":195},[192,445,397],{},[192,447,448],{"class":194,"style":195},[192,449,450],{},"      \"code\": \"ACME004\",",[192,452,453],{"class":194,"style":195},[192,454,455],{},"      \"message\": \"Top-level await in a server entry\",",[192,457,458],{"class":194,"style":195},[192,459,460],{},"      \"fix\": \"Move the call into the plugin setup\",",[192,462,463],{"class":194,"style":195},[192,464,465],{},"      \"file\": \"src\u002Fdb.ts\",",[192,467,468],{"class":194,"style":195},[192,469,470],{},"      \"line\": 3,",[192,472,473],{"class":194,"style":195},[192,474,475],{},"      \"column\": 1",[192,477,478],{"class":194,"style":195},[192,479,437],{},[192,481,482],{"class":194,"style":195},[192,483,392],{},[192,485,486],{"class":194,"style":195},[192,487,488],{},"      \"severity\": \"warn\",",[192,490,491],{"class":194,"style":195},[192,492,493],{},"      \"code\": \"ACME010\",",[192,495,496],{"class":194,"style":195},[192,497,498],{},"      \"message\": \"Alias shadows a workspace package\",",[192,500,501],{"class":194,"style":195},[192,502,503],{},"      \"file\": \"vite.config.ts\",",[192,505,506],{"class":194,"style":195},[192,507,508],{},"      \"line\": 8,",[192,510,511],{"class":194,"style":195},[192,512,513],{},"      \"column\": 5",[192,515,516],{"class":194,"style":195},[192,517,518],{},"    }",[192,520,521],{"class":194,"style":195},[192,522,523],{},"  ],",[192,525,526],{"class":194,"style":195},[192,527,528],{},"  \"result\": {",[192,530,531],{"class":194,"style":195},[192,532,533],{},"    \"files\": 212,",[192,535,536],{"class":194,"style":195},[192,537,538],{},"    \"durationMs\": 840",[192,540,541],{"class":194,"style":195},[192,542,382],{},[192,544,545],{"class":194,"style":195},[192,546,547],{},"  \"next\": [",[192,549,550],{"class":194,"style":195},[192,551,392],{},[192,553,554],{"class":194,"style":195},[192,555,556],{},"      \"command\": \"acme check --fix\",",[192,558,559],{"class":194,"style":195},[192,560,561],{},"      \"reason\": \"applies 2 safe fixes\"",[192,563,564],{"class":194,"style":195},[192,565,437],{},[192,567,568],{"class":194,"style":195},[192,569,392],{},[192,571,572],{"class":194,"style":195},[192,573,574],{},"      \"command\": \"acme explain \u003Ccode>\",",[192,576,577],{"class":194,"style":195},[192,578,579],{},"      \"reason\": \"explains one code\"",[192,581,582],{"class":194,"style":195},[192,583,518],{},[192,585,586],{"class":194,"style":195},[192,587,588],{},"  ]",[192,590,591],{"class":194,"style":195},[192,592,593],{},"}",[138,595,598],{"id":126,"anchor":596},{"label":597,"icon":142},"Section titled \"jsonl\"",[24,599,126],{},[20,601,602,603,606,607,609,610,297,613,338],{},"A ",[24,604,605],{},"version"," record first, one record per diagnostic, log or next step as the command reports it, and a ",[24,608,327],{}," record last. Every record has a ",[24,611,612],{},"type",[24,614,615],{},"acme check --format jsonl",[185,617,618],{"language":68,"class":187,"wrap":14},[24,619,620,199,625,199,630,199,635,199,640,199,645,199,650],{"class":190},[192,621,622],{"class":194,"style":195},[192,623,624],{},"{\"type\":\"version\",\"schema\":\"acme.check\u002Fv1\",\"tool\":\"acme@1.2.0\"}",[192,626,627],{"class":194,"style":195},[192,628,629],{},"{\"type\":\"diagnostic\",\"severity\":\"error\",\"code\":\"ACME001\",\"message\":\"Route handler reads process.env at module scope\",\"why\":\"The value is fixed at build time\",\"fix\":\"Read it inside the handler\",\"file\":\"src\u002Fapp.ts\",\"line\":14,\"column\":3}",[192,631,632],{"class":194,"style":195},[192,633,634],{},"{\"type\":\"diagnostic\",\"severity\":\"error\",\"code\":\"ACME004\",\"message\":\"Top-level await in a server entry\",\"fix\":\"Move the call into the plugin setup\",\"file\":\"src\u002Fdb.ts\",\"line\":3,\"column\":1}",[192,636,637],{"class":194,"style":195},[192,638,639],{},"{\"type\":\"diagnostic\",\"severity\":\"warn\",\"code\":\"ACME010\",\"message\":\"Alias shadows a workspace package\",\"file\":\"vite.config.ts\",\"line\":8,\"column\":5}",[192,641,642],{"class":194,"style":195},[192,643,644],{},"{\"type\":\"next\",\"message\":\"acme check --fix\",\"reason\":\"applies 2 safe fixes\"}",[192,646,647],{"class":194,"style":195},[192,648,649],{},"{\"type\":\"next\",\"message\":\"acme explain \u003Ccode>\",\"reason\":\"explains one code\"}",[192,651,652],{"class":194,"style":195},[192,653,654],{},"{\"type\":\"result\",\"status\":\"failed\",\"message\":\"2 errors, 1 warning in 212 files (0.8s)\",\"data\":{\"files\":212,\"durationMs\":840}}",[20,656,657,661],{},[29,658,660],{"href":659},"\u002Fguide\u002Fjson","JSON and JSONL"," documents every field.",[138,663,667],{"id":664,"anchor":665},"how-readerly-picks-the-format",{"label":666,"icon":142},"Section titled \"How readerly picks the format\"","How readerly picks the format",[20,669,670,673,674,680],{},[24,671,672],{},"resolveProfile()"," in ",[29,675,677],{"href":676},"https:\u002F\u002Fgithub.com\u002Floadsheet\u002Freaderly\u002Fblob\u002Fmain\u002Fsrc\u002Fprofile.ts",[24,678,679],{},"src\u002Fprofile.ts"," takes the first of these that is set:",[682,683,684,691,703,731],"ol",{},[685,686,687,690],"li",{},[24,688,689],{},"--format \u003Cname>",".",[685,692,693,695,696,698,699,702],{},[24,694,114],{},", the same as ",[24,697,110],{},". When both are given, ",[24,700,701],{},"--format"," wins.",[685,704,705,706,709,710,713,714,297,717,720,721,724,725,720,728,690],{},"The ",[24,707,708],{},"\u003CTOOL>_FORMAT"," environment variable. ",[24,711,712],{},"formatEnvName(tool)"," gives its name: the tool name in upper case, with every character other than a letter or digit turned into ",[24,715,716],{},"_",[24,718,719],{},"acme"," reads ",[24,722,723],{},"ACME_FORMAT",", and ",[24,726,727],{},"vite-doctor",[24,729,730],{},"VITE_DOCTOR_FORMAT",[685,732,733,734,736,737,739],{},"Detection: ",[24,735,89],{}," when the reader is an agent, ",[24,738,68],{}," for every other reader.",[20,741,602,742,744,745,748],{},[24,743,708],{}," value that is not a format is ignored, and ",[24,746,747],{},"--verbose"," says so:",[185,750,751],{"language":68,"class":187,"wrap":14},[24,752,753],{"class":190},[192,754,755],{"class":194,"style":195},[192,756,757],{},"format: text (ACME_FORMAT=yaml ignored, not one of text, agent, json, jsonl; detected pipe (stdout not a TTY))",[20,759,760,761,764,765,690],{},"The format never changes who the reader is. ",[24,762,763],{},"--format text"," under an agent still prints no prompt. See ",[29,766,768],{"href":767},"\u002Fguide\u002Freaders","Readers",[138,770,774,775],{"id":771,"anchor":772},"a-bad-format",{"label":773,"icon":142},"Section titled \"A bad --format\"","A bad ",[24,776,701],{},[20,778,779,780,782,783,785],{},"An unknown ",[24,781,701],{}," value is a usage failure with exit code 2. readerly sets the bad flag aside, picks the format from the other flags and detection, and prints the failure in that format. In ",[24,784,68],{}," it goes to stderr:",[185,787,788],{"language":68,"class":187,"wrap":14},[24,789,790,199,795],{"class":190},[192,791,792],{"class":194,"style":195},[192,793,794],{},"✖ --format yaml is not a format. Use one of: text, agent, json, jsonl.",[192,796,797],{"class":194,"style":195},[192,798,799],{},"╰▶ fix: Pass --format with one of: text, agent, json, jsonl.",[20,801,802,804,805,808,809,811,812,814,815,690],{},[24,803,701],{}," with no value prints the same failure, starting with ",[24,806,807],{},"--format needs a value.",". Under an agent, the failure is the ",[24,810,89],{}," report on stdout, and with ",[24,813,114],{}," it is a JSON document with ",[24,816,817],{},"\"status\": \"failed\"",[138,819,823],{"id":820,"anchor":821},"your-own-formats",{"label":822,"icon":142},"Section titled \"Your own formats\"","Your own formats",[20,825,826,827,829,830,833],{},"A tool adds a format with ",[24,828,5],{},", and renders it with ",[24,831,832],{},"renderers",":",[185,835,838],{"language":836,"filename":837,"class":187,"wrap":14},"ts","check.ts",[24,839,841,199,862,199,874,199,884,199,889,199,900,199,905,199,955,199,959],{"class":840},"language-ts",[192,842,843,847,851,854,858],{"class":194,"style":195},[192,844,846],{"style":845},"color:#CF222E;--shiki-dark:#FF7B72","const",[192,848,850],{"style":849},"color:#0550AE;--shiki-dark:#79C0FF"," out",[192,852,853],{"style":845}," =",[192,855,857],{"style":856},"color:#8250DF;--shiki-dark:#D2A8FF"," createOut",[192,859,861],{"style":860},"color:#1F2328;--shiki-dark:#E6EDF3","({",[192,863,864,867,871],{"class":194,"style":195},[192,865,866],{"style":860},"  tool: ",[192,868,870],{"style":869},"color:#0A3069;--shiki-dark:#A5D6FF","\"acme\"",[192,872,873],{"style":860},",",[192,875,876,879,882],{"class":194,"style":195},[192,877,878],{"style":860},"  command: ",[192,880,881],{"style":869},"\"check\"",[192,883,873],{"style":860},[192,885,886],{"class":194,"style":195},[192,887,888],{"style":860},"  argv,",[192,890,891,894,897],{"class":194,"style":195},[192,892,893],{"style":860},"  formats: [",[192,895,896],{"style":869},"\"count\"",[192,898,899],{"style":860},"],",[192,901,902],{"class":194,"style":195},[192,903,904],{"style":860},"  renderers: {",[192,906,907,910,913,916,920,923,926,929,932,934,936,939,941,944,946,949,952],{"class":194,"style":195},[192,908,909],{"style":860},"    count: { ",[192,911,912],{"style":856},"render",[192,914,915],{"style":860},": (",[192,917,919],{"style":918},"color:#953800;--shiki-dark:#FFA657","run",[192,921,922],{"style":860},") ",[192,924,925],{"style":845},"=>",[192,927,928],{"style":860}," ({ stdout: ",[192,930,931],{"style":869},"`${",[192,933,919],{"style":860},[192,935,690],{"style":869},[192,937,938],{"style":860},"counts",[192,940,690],{"style":869},[192,942,943],{"style":860},"error",[192,945,593],{"style":869},[192,947,948],{"style":845},"\\n",[192,950,951],{"style":869},"`",[192,953,954],{"style":860}," }) },",[192,956,957],{"class":194,"style":195},[192,958,382],{"style":860},[192,960,961],{"class":194,"style":195},[192,962,963],{"style":860},"});",[20,965,966,155,969,972,973,975,976,979,980,982,983,986,987,990,991,995,996,155,998,690],{},[24,967,968],{},"acme check --format count",[24,970,971],{},"ACME_FORMAT=count acme check"," both print the error count. The new name joins the list in the ",[24,974,701],{}," error, as in ",[24,977,978],{},"Use one of: text, agent, json, jsonl, count.",". A format in ",[24,981,5],{}," without a renderer makes ",[24,984,985],{},"createOut"," throw ",[24,988,989],{},"No renderer for format count."," when that format is picked. ",[29,992,994],{"href":993},"\u002Fguide\u002Frenderers","Custom renderers"," covers ",[24,997,832],{},[24,999,912],{},[138,1001,1005],{"id":1002,"anchor":1003},"github-annotations-are-not-a-format",{"label":1004,"icon":142},"Section titled \"GitHub annotations are not a format\"","GitHub annotations are not a format",[20,1007,1008,1009,1011,1012,155,1015,1018,1019,1021,1022,690],{},"On GitHub Actions, the ",[24,1010,68],{}," format also writes ",[24,1013,1014],{},"::error",[24,1016,1017],{},"::warning"," workflow commands to stderr, and the runner shows them on the diff. They sit next to ",[24,1020,68],{},", not in place of it, and no flag selects them. See ",[29,1023,1025],{"href":1024},"\u002Fintegrations\u002Fgithub-actions","GitHub Actions",[1027,1029,1030,1031,1032,1033,1035,1036],{"id":68,"depth":1028,"text":68},2,{"id":89,"depth":1028,"text":89},{"id":105,"depth":1028,"text":105},{"id":126,"depth":1028,"text":126},{"id":664,"depth":1028,"text":667},{"id":771,"depth":1028,"text":1034},"A bad --format",{"id":820,"depth":1028,"text":823},{"id":1002,"depth":1028,"text":1005},{"path":300,"title":301,"description":1038},"What a coding agent gets from a readerly command, which harnesses readerly knows by their env vars, and how a tool declares itself with AI_AGENT.",{"path":1040,"title":1041,"description":1042},"\u002Fguide\u002Fflags","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.",1795985392914,"22ea5d7b-bce0-4e3b-bca3-1fbe3722fcf7"]