[{"data":1,"prerenderedAt":1511,"buildId":1512},["ShallowReactive",2],{"docs:\u002Fguide\u002Fjson":3},{"page":4,"section":16,"document":17,"credits":10,"prev":1505,"next":1509},{"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},"json","\u002Fguide\u002Fjson","guide\u002Fjson.md","JSON and JSONL","The json document and the jsonl record stream a readerly command prints, their fields and schema name, failures in both, and how out.set fills result.",null,[],"i-lucide-braces","article",true,12,"guide",{"nodes":18,"toc":1497},[19,31,39,54,525,657,671,692,698,729,773,779,785,805,882,907,913,924,964,982,1135,1152,1163,1169,1188,1355,1376,1388,1407,1425,1431,1490],[20,21,22,26,27,30],"p",{},[23,24,25],"code",{},"--format json"," prints one document when the command ends. ",[23,28,29],{},"--format jsonl"," prints one record per line while it runs. Both are for programs, so neither has color, glyphs, prompts or a budget.",[32,33,38],"h2",{"id":34,"anchor":35},"the-json-document",{"label":36,"icon":37},"Section titled \"The json document\"","#","The json document",[20,40,41,42,45,46,53],{},"A program that runs the golden ",[23,43,44],{},"acme check --json"," gets ",[47,48,50],"a",{"href":49},"https:\u002F\u002Fgithub.com\u002Floadsheet\u002Freaderly\u002Fblob\u002Fmain\u002Ftest\u002Fgolden\u002Fjson.stdout.json",[23,51,52],{},"json.stdout.json"," on stdout:",[55,56,58],"pre",{"language":5,"class":57,"wrap":14},"shiki shiki-themes github-light-default github-dark-default dark:github-dark-default",[23,59,61,70,71,70,87,70,99,70,107,70,120,70,132,70,142,70,147,70,155,70,160,70,172,70,184,70,196,70,208,70,220,70,232,70,244,70,254,70,259,70,263,70,273,70,284,70,295,70,306,70,317,70,327,70,335,70,339,70,343,70,354,70,365,70,376,70,387,70,398,70,407,70,412,70,417,70,424,70,436,70,446,70,450,70,457,70,461,70,473,70,483,70,487,70,491,70,502,70,511,70,515,70,520],{"class":60},"language-json",[62,63,66],"span",{"class":64,"style":65},"line","display: inline",[62,67,69],{"style":68},"color:#1F2328;--shiki-dark:#E6EDF3","{","\n",[62,72,73,77,80,84],{"class":64,"style":65},[62,74,76],{"style":75},"color:#116329;--shiki-dark:#7EE787","  \"schema\"",[62,78,79],{"style":68},": ",[62,81,83],{"style":82},"color:#0A3069;--shiki-dark:#A5D6FF","\"acme.check\u002Fv1\"",[62,85,86],{"style":68},",",[62,88,89,92,94,97],{"class":64,"style":65},[62,90,91],{"style":75},"  \"status\"",[62,93,79],{"style":68},[62,95,96],{"style":82},"\"failed\"",[62,98,86],{"style":68},[62,100,101,104],{"class":64,"style":65},[62,102,103],{"style":75},"  \"summary\"",[62,105,106],{"style":68},": {",[62,108,109,112,114,118],{"class":64,"style":65},[62,110,111],{"style":75},"    \"error\"",[62,113,79],{"style":68},[62,115,117],{"style":116},"color:#0550AE;--shiki-dark:#79C0FF","2",[62,119,86],{"style":68},[62,121,122,125,127,130],{"class":64,"style":65},[62,123,124],{"style":75},"    \"warn\"",[62,126,79],{"style":68},[62,128,129],{"style":116},"1",[62,131,86],{"style":68},[62,133,134,137,139],{"class":64,"style":65},[62,135,136],{"style":75},"    \"info\"",[62,138,79],{"style":68},[62,140,141],{"style":116},"0",[62,143,144],{"class":64,"style":65},[62,145,146],{"style":68},"  },",[62,148,149,152],{"class":64,"style":65},[62,150,151],{"style":75},"  \"diagnostics\"",[62,153,154],{"style":68},": [",[62,156,157],{"class":64,"style":65},[62,158,159],{"style":68},"    {",[62,161,162,165,167,170],{"class":64,"style":65},[62,163,164],{"style":75},"      \"severity\"",[62,166,79],{"style":68},[62,168,169],{"style":82},"\"error\"",[62,171,86],{"style":68},[62,173,174,177,179,182],{"class":64,"style":65},[62,175,176],{"style":75},"      \"code\"",[62,178,79],{"style":68},[62,180,181],{"style":82},"\"ACME001\"",[62,183,86],{"style":68},[62,185,186,189,191,194],{"class":64,"style":65},[62,187,188],{"style":75},"      \"message\"",[62,190,79],{"style":68},[62,192,193],{"style":82},"\"Route handler reads process.env at module scope\"",[62,195,86],{"style":68},[62,197,198,201,203,206],{"class":64,"style":65},[62,199,200],{"style":75},"      \"why\"",[62,202,79],{"style":68},[62,204,205],{"style":82},"\"The value is fixed at build time\"",[62,207,86],{"style":68},[62,209,210,213,215,218],{"class":64,"style":65},[62,211,212],{"style":75},"      \"fix\"",[62,214,79],{"style":68},[62,216,217],{"style":82},"\"Read it inside the handler\"",[62,219,86],{"style":68},[62,221,222,225,227,230],{"class":64,"style":65},[62,223,224],{"style":75},"      \"file\"",[62,226,79],{"style":68},[62,228,229],{"style":82},"\"src\u002Fapp.ts\"",[62,231,86],{"style":68},[62,233,234,237,239,242],{"class":64,"style":65},[62,235,236],{"style":75},"      \"line\"",[62,238,79],{"style":68},[62,240,241],{"style":116},"14",[62,243,86],{"style":68},[62,245,246,249,251],{"class":64,"style":65},[62,247,248],{"style":75},"      \"column\"",[62,250,79],{"style":68},[62,252,253],{"style":116},"3",[62,255,256],{"class":64,"style":65},[62,257,258],{"style":68},"    },",[62,260,261],{"class":64,"style":65},[62,262,159],{"style":68},[62,264,265,267,269,271],{"class":64,"style":65},[62,266,164],{"style":75},[62,268,79],{"style":68},[62,270,169],{"style":82},[62,272,86],{"style":68},[62,274,275,277,279,282],{"class":64,"style":65},[62,276,176],{"style":75},[62,278,79],{"style":68},[62,280,281],{"style":82},"\"ACME004\"",[62,283,86],{"style":68},[62,285,286,288,290,293],{"class":64,"style":65},[62,287,188],{"style":75},[62,289,79],{"style":68},[62,291,292],{"style":82},"\"Top-level await in a server entry\"",[62,294,86],{"style":68},[62,296,297,299,301,304],{"class":64,"style":65},[62,298,212],{"style":75},[62,300,79],{"style":68},[62,302,303],{"style":82},"\"Move the call into the plugin setup\"",[62,305,86],{"style":68},[62,307,308,310,312,315],{"class":64,"style":65},[62,309,224],{"style":75},[62,311,79],{"style":68},[62,313,314],{"style":82},"\"src\u002Fdb.ts\"",[62,316,86],{"style":68},[62,318,319,321,323,325],{"class":64,"style":65},[62,320,236],{"style":75},[62,322,79],{"style":68},[62,324,253],{"style":116},[62,326,86],{"style":68},[62,328,329,331,333],{"class":64,"style":65},[62,330,248],{"style":75},[62,332,79],{"style":68},[62,334,129],{"style":116},[62,336,337],{"class":64,"style":65},[62,338,258],{"style":68},[62,340,341],{"class":64,"style":65},[62,342,159],{"style":68},[62,344,345,347,349,352],{"class":64,"style":65},[62,346,164],{"style":75},[62,348,79],{"style":68},[62,350,351],{"style":82},"\"warn\"",[62,353,86],{"style":68},[62,355,356,358,360,363],{"class":64,"style":65},[62,357,176],{"style":75},[62,359,79],{"style":68},[62,361,362],{"style":82},"\"ACME010\"",[62,364,86],{"style":68},[62,366,367,369,371,374],{"class":64,"style":65},[62,368,188],{"style":75},[62,370,79],{"style":68},[62,372,373],{"style":82},"\"Alias shadows a workspace package\"",[62,375,86],{"style":68},[62,377,378,380,382,385],{"class":64,"style":65},[62,379,224],{"style":75},[62,381,79],{"style":68},[62,383,384],{"style":82},"\"vite.config.ts\"",[62,386,86],{"style":68},[62,388,389,391,393,396],{"class":64,"style":65},[62,390,236],{"style":75},[62,392,79],{"style":68},[62,394,395],{"style":116},"8",[62,397,86],{"style":68},[62,399,400,402,404],{"class":64,"style":65},[62,401,248],{"style":75},[62,403,79],{"style":68},[62,405,406],{"style":116},"5",[62,408,409],{"class":64,"style":65},[62,410,411],{"style":68},"    }",[62,413,414],{"class":64,"style":65},[62,415,416],{"style":68},"  ],",[62,418,419,422],{"class":64,"style":65},[62,420,421],{"style":75},"  \"result\"",[62,423,106],{"style":68},[62,425,426,429,431,434],{"class":64,"style":65},[62,427,428],{"style":75},"    \"files\"",[62,430,79],{"style":68},[62,432,433],{"style":116},"212",[62,435,86],{"style":68},[62,437,438,441,443],{"class":64,"style":65},[62,439,440],{"style":75},"    \"durationMs\"",[62,442,79],{"style":68},[62,444,445],{"style":116},"840",[62,447,448],{"class":64,"style":65},[62,449,146],{"style":68},[62,451,452,455],{"class":64,"style":65},[62,453,454],{"style":75},"  \"next\"",[62,456,154],{"style":68},[62,458,459],{"class":64,"style":65},[62,460,159],{"style":68},[62,462,463,466,468,471],{"class":64,"style":65},[62,464,465],{"style":75},"      \"command\"",[62,467,79],{"style":68},[62,469,470],{"style":82},"\"acme check --fix\"",[62,472,86],{"style":68},[62,474,475,478,480],{"class":64,"style":65},[62,476,477],{"style":75},"      \"reason\"",[62,479,79],{"style":68},[62,481,482],{"style":82},"\"applies 2 safe fixes\"",[62,484,485],{"class":64,"style":65},[62,486,258],{"style":68},[62,488,489],{"class":64,"style":65},[62,490,159],{"style":68},[62,492,493,495,497,500],{"class":64,"style":65},[62,494,465],{"style":75},[62,496,79],{"style":68},[62,498,499],{"style":82},"\"acme explain \u003Ccode>\"",[62,501,86],{"style":68},[62,503,504,506,508],{"class":64,"style":65},[62,505,477],{"style":75},[62,507,79],{"style":68},[62,509,510],{"style":82},"\"explains one code\"",[62,512,513],{"class":64,"style":65},[62,514,411],{"style":68},[62,516,517],{"class":64,"style":65},[62,518,519],{"style":68},"  ]",[62,521,522],{"class":64,"style":65},[62,523,524],{"style":68},"}",[526,527,528,541],"table",{},[529,530,531],"thead",{},[532,533,534,538],"tr",{},[535,536,537],"th",{},"Field",[535,539,540],{},"What it holds",[542,543,544,555,575,588,609,622,644],"tbody",{},[532,545,546,552],{},[547,548,549],"td",{},[23,550,551],{},"schema",[547,553,554],{},"The document's name and version.",[532,556,557,562],{},[547,558,559],{},[23,560,561],{},"status",[547,563,564,567,568,570,571,574],{},[23,565,566],{},"\"ok\"",", ",[23,569,96],{}," or ",[23,572,573],{},"\"action_required\"",".",[532,576,577,582],{},[547,578,579],{},[23,580,581],{},"summary",[547,583,584,585,574],{},"The counts, as ",[23,586,587],{},"{ error, warn, info }",[532,589,590,595],{},[547,591,592],{},[23,593,594],{},"diagnostics",[547,596,597,598,604,605,608],{},"Every ",[47,599,601],{"href":600},"\u002Fguide\u002Fdiagnostics#the-record",[23,602,603],{},"DiagnosticRecord",", in the order you added them, with ",[23,606,607],{},"data"," if you set it.",[532,610,611,616],{},[547,612,613],{},[23,614,615],{},"result",[547,617,618,619,574],{},"What you passed to ",[23,620,621],{},"out.set()",[532,623,624,629],{},[547,625,626],{},[23,627,628],{},"next",[547,630,631,632,635,636,639,640,643],{},"Each ",[23,633,634],{},"out.next()"," as ",[23,637,638],{},"{ command, reason }",", plus the ",[23,641,642],{},"next:"," lines skipped prompts add.",[532,645,646,651],{},[547,647,648],{},[23,649,650],{},"answer",[547,652,653,654,574],{},"Only when the command called ",[23,655,656],{},"out.write()",[20,658,659,660,663,664,667,668,670],{},"The document is ",[23,661,662],{},"JSON.stringify"," with two-space indentation and a trailing newline. Logs from ",[23,665,666],{},"out.log()"," are dropped. There is no row cap and no budget, so ",[23,669,594],{}," holds every record.",[20,672,673,674,677,678,681,682,635,684,687,688,574],{},"The ",[23,675,676],{},"confirm"," that asks a person at a terminal ",[23,679,680],{},"? Apply 2 safe fixes? (y\u002FN) "," doesn't run here. Its default answers, and the flag that changes it shows up in ",[23,683,628],{},[23,685,686],{},"acme check --fix",". See ",[47,689,691],{"href":690},"\u002Fguide\u002Fprompts","Prompts and input",[32,693,697],{"id":694,"anchor":695},"the-schema-name",{"label":696,"icon":37},"Section titled \"The schema name\"","The schema name",[20,699,700,702,703,706,707,710,711,714,715,718,719,721,722,725,726,728],{},[23,701,551],{}," is ",[23,704,705],{},"\u003Ctool>.\u003Ccommand>\u002Fv1",", built from the ",[23,708,709],{},"tool"," and ",[23,712,713],{},"command"," you pass to ",[23,716,717],{},"createOut",". Without a ",[23,720,713],{}," it is ",[23,723,724],{},"\u003Ctool>.run\u002Fv1",". Pass ",[23,727,551],{}," to name it yourself:",[55,730,733],{"language":731,"filename":732,"class":57,"wrap":14},"ts","check.ts",[23,734,736],{"class":735},"language-ts",[62,737,738,742,745,748,752,755,758,761,764,767,770],{"class":64,"style":65},[62,739,741],{"style":740},"color:#CF222E;--shiki-dark:#FF7B72","const",[62,743,744],{"style":116}," out",[62,746,747],{"style":740}," =",[62,749,751],{"style":750},"color:#8250DF;--shiki-dark:#D2A8FF"," createOut",[62,753,754],{"style":68},"({ tool: ",[62,756,757],{"style":82},"\"acme\"",[62,759,760],{"style":68},", command: ",[62,762,763],{"style":82},"\"check\"",[62,765,766],{"style":68},", schema: ",[62,768,769],{"style":82},"\"acme.check\u002Fv2\"",[62,771,772],{"style":68},", argv });",[20,774,775,776,778],{},"Change the version when you change the shape of ",[23,777,615],{},", so programs that read it can tell.",[32,780,784],{"id":781,"anchor":782},"filling-result",{"label":783,"icon":37},"Section titled \"Filling result\"","Filling result",[20,786,787,790,791,794,795,797,798,801,802,804],{},[23,788,789],{},"out.set(fields)"," merges ",[23,792,793],{},"fields"," into ",[23,796,615],{}," with ",[23,799,800],{},"Object.assign",". Call it as often as you like. The generic on ",[23,803,717],{}," types the fields:",[55,806,807],{"language":731,"filename":732,"class":57,"wrap":14},[23,808,809,70,853,70,869],{"class":735},[62,810,811,813,815,817,819,822,826,829,832,835,838,840,842,845,847,849,851],{"class":64,"style":65},[62,812,741],{"style":740},[62,814,744],{"style":116},[62,816,747],{"style":740},[62,818,751],{"style":750},[62,820,821],{"style":68},"\u003C{ ",[62,823,825],{"style":824},"color:#953800;--shiki-dark:#FFA657","files",[62,827,828],{"style":740},":",[62,830,831],{"style":116}," number",[62,833,834],{"style":68},"; ",[62,836,837],{"style":824},"durationMs",[62,839,828],{"style":740},[62,841,831],{"style":116},[62,843,844],{"style":68}," }>({ tool: ",[62,846,757],{"style":82},[62,848,760],{"style":68},[62,850,763],{"style":82},[62,852,772],{"style":68},[62,854,855,858,861,864,866],{"class":64,"style":65},[62,856,857],{"style":68},"out.",[62,859,860],{"style":750},"set",[62,862,863],{"style":68},"({ files: ",[62,865,433],{"style":116},[62,867,868],{"style":68}," });",[62,870,871,873,875,878,880],{"class":64,"style":65},[62,872,857],{"style":68},[62,874,860],{"style":750},[62,876,877],{"style":68},"({ durationMs: ",[62,879,445],{"style":116},[62,881,868],{"style":68},[20,883,884,886,887,890,891,710,894,897,898,900,901,903,904,574],{},[23,885,615],{}," starts as ",[23,888,889],{},"{}",". ",[23,892,893],{},"text",[23,895,896],{},"agent"," print it only through the ",[23,899,581],{}," function you pass to ",[23,902,717],{},", such as ",[23,905,906],{},"in 212 files (0.8s)",[32,908,912],{"id":909,"anchor":910},"the-jsonl-stream",{"label":911,"icon":37},"Section titled \"The jsonl stream\"","The jsonl stream",[20,914,41,915,45,918,828],{},[23,916,917],{},"acme check --format jsonl",[47,919,921],{"href":920},"https:\u002F\u002Fgithub.com\u002Floadsheet\u002Freaderly\u002Fblob\u002Fmain\u002Ftest\u002Fgolden\u002Fjsonl.stdout.jsonl",[23,922,923],{},"jsonl.stdout.jsonl",[55,925,926],{"language":893,"class":57,"wrap":14},[23,927,929,70,934,70,939,70,944,70,949,70,954,70,959],{"class":928},"language-text",[62,930,931],{"class":64,"style":65},[62,932,933],{},"{\"type\":\"version\",\"schema\":\"acme.check\u002Fv1\",\"tool\":\"acme@1.2.0\"}",[62,935,936],{"class":64,"style":65},[62,937,938],{},"{\"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}",[62,940,941],{"class":64,"style":65},[62,942,943],{},"{\"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}",[62,945,946],{"class":64,"style":65},[62,947,948],{},"{\"type\":\"diagnostic\",\"severity\":\"warn\",\"code\":\"ACME010\",\"message\":\"Alias shadows a workspace package\",\"file\":\"vite.config.ts\",\"line\":8,\"column\":5}",[62,950,951],{"class":64,"style":65},[62,952,953],{},"{\"type\":\"next\",\"message\":\"acme check --fix\",\"reason\":\"applies 2 safe fixes\"}",[62,955,956],{"class":64,"style":65},[62,957,958],{},"{\"type\":\"next\",\"message\":\"acme explain \u003Ccode>\",\"reason\":\"explains one code\"}",[62,960,961],{"class":64,"style":65},[62,962,963],{},"{\"type\":\"result\",\"status\":\"failed\",\"message\":\"2 errors, 1 warning in 212 files (0.8s)\",\"data\":{\"files\":212,\"durationMs\":840}}",[20,965,966,967,970,971,974,975,977,978,981],{},"Every record is one line of JSON with ",[23,968,969],{},"type"," first. The rules follow Terraform's machine-readable UI: a ",[23,972,973],{},"version"," record first, a ",[23,976,969],{}," and a readable ",[23,979,980],{},"message"," on every record, and readers ignore types they don't know.",[526,983,984,998],{},[529,985,986],{},[532,987,988,992,995],{},[535,989,990],{},[23,991,969],{},[535,993,994],{},"When",[535,996,997],{},"Fields",[542,999,1000,1025,1048,1063,1081,1100,1118],{},[532,1001,1002,1006,1009],{},[547,1003,1004],{},[23,1005,973],{},[547,1007,1008],{},"First, with the first entry",[547,1010,1011,567,1013,635,1015,1018,1019,1022,1023],{},[23,1012,551],{},[23,1014,709],{},[23,1016,1017],{},"name@version",", or ",[23,1020,1021],{},"name"," when you pass no ",[23,1024,973],{},[532,1026,1027,1032,1045],{},[547,1028,1029],{},[23,1030,1031],{},"diagnostic",[547,1033,631,1034,567,1037,567,1040,570,1043],{},[23,1035,1036],{},"out.error",[23,1038,1039],{},"warn",[23,1041,1042],{},"info",[23,1044,1031],{},[547,1046,1047],{},"The record's fields",[532,1049,1050,1055,1059],{},[547,1051,1052],{},[23,1053,1054],{},"log",[547,1056,631,1057],{},[23,1058,666],{},[547,1060,1061],{},[23,1062,980],{},[532,1064,1065,1069,1073],{},[547,1066,1067],{},[23,1068,628],{},[547,1070,631,1071],{},[23,1072,634],{},[547,1074,1075,1077,1078],{},[23,1076,980],{}," (the command), ",[23,1079,1080],{},"reason",[532,1082,1083,1088,1091],{},[547,1084,1085],{},[23,1086,1087],{},"error",[547,1089,1090],{},"On a failure",[547,1092,1093,1094,567,1097],{},"The error fields, ",[23,1095,1096],{},"missing",[23,1098,1099],{},"rerun",[532,1101,1102,1106,1114],{},[547,1103,1104],{},[23,1105,650],{},[547,1107,1108,1109,1111,1112],{},"At the end, before ",[23,1110,615],{},", when the command called ",[23,1113,656],{},[547,1115,1116],{},[23,1117,980],{},[532,1119,1120,1124,1127],{},[547,1121,1122],{},[23,1123,615],{},[547,1125,1126],{},"Last",[547,1128,1129,567,1131,567,1133],{},[23,1130,561],{},[23,1132,980],{},[23,1134,607],{},[20,1136,1137,1138,1140,1141,1144,1145,1147,1148,702,1150,574],{},"readerly writes each entry record the moment you add it, so a program can show progress while the command runs. The ",[23,1139,615],{}," record comes at ",[23,1142,1143],{},"out.end()",". Its ",[23,1146,980],{}," is the verdict text, counts and summary, and ",[23,1149,607],{},[23,1151,615],{},[20,1153,1154,1155,567,1157,1160,1161,574],{},"Unlike ",[23,1156,5],{},[23,1158,1159],{},"jsonl"," keeps logs. A diagnostic's own fields never replace ",[23,1162,969],{},[32,1164,1168],{"id":1165,"anchor":1166},"failures",{"label":1167,"icon":37},"Section titled \"Failures\"","Failures",[20,1170,1171,1172,567,1174,567,1176,1178,1179,710,1181,1183,1184,1187],{},"On a failure, the json document drops the run fields and keeps what a caller needs to act: ",[23,1173,551],{},[23,1175,561],{},[23,1177,1087],{},", and ",[23,1180,1096],{},[23,1182,1099],{}," when the failure has them. It still goes to stdout, so a program reads one document whatever happened. A program that runs ",[23,1185,1186],{},"acme deploy --prod --json"," without an account gets this, with exit code 2:",[55,1189,1190],{"language":5,"class":57,"wrap":14},[23,1191,1192,70,1196,70,1207,70,1217,70,1224,70,1236,70,1248,70,1258,70,1262,70,1269,70,1273,70,1285,70,1297,70,1309,70,1316,70,1323,70,1328,70,1333,70,1337,70,1341,70,1351],{"class":60},[62,1193,1194],{"class":64,"style":65},[62,1195,69],{"style":68},[62,1197,1198,1200,1202,1205],{"class":64,"style":65},[62,1199,76],{"style":75},[62,1201,79],{"style":68},[62,1203,1204],{"style":82},"\"acme.deploy\u002Fv1\"",[62,1206,86],{"style":68},[62,1208,1209,1211,1213,1215],{"class":64,"style":65},[62,1210,91],{"style":75},[62,1212,79],{"style":68},[62,1214,573],{"style":82},[62,1216,86],{"style":68},[62,1218,1219,1222],{"class":64,"style":65},[62,1220,1221],{"style":75},"  \"error\"",[62,1223,106],{"style":68},[62,1225,1226,1229,1231,1234],{"class":64,"style":65},[62,1227,1228],{"style":75},"    \"code\"",[62,1230,79],{"style":68},[62,1232,1233],{"style":82},"\"ACME_INPUT\"",[62,1235,86],{"style":68},[62,1237,1238,1241,1243,1246],{"class":64,"style":65},[62,1239,1240],{"style":75},"    \"fix\"",[62,1242,79],{"style":68},[62,1244,1245],{"style":82},"\"Pass --account.\"",[62,1247,86],{"style":68},[62,1249,1250,1253,1255],{"class":64,"style":65},[62,1251,1252],{"style":75},"    \"message\"",[62,1254,79],{"style":68},[62,1256,1257],{"style":82},"\"Account is required.\"",[62,1259,1260],{"class":64,"style":65},[62,1261,146],{"style":68},[62,1263,1264,1267],{"class":64,"style":65},[62,1265,1266],{"style":75},"  \"missing\"",[62,1268,154],{"style":68},[62,1270,1271],{"class":64,"style":65},[62,1272,159],{"style":68},[62,1274,1275,1278,1280,1283],{"class":64,"style":65},[62,1276,1277],{"style":75},"      \"field\"",[62,1279,79],{"style":68},[62,1281,1282],{"style":82},"\"account\"",[62,1284,86],{"style":68},[62,1286,1287,1290,1292,1295],{"class":64,"style":65},[62,1288,1289],{"style":75},"      \"flag\"",[62,1291,79],{"style":68},[62,1293,1294],{"style":82},"\"--account\"",[62,1296,86],{"style":68},[62,1298,1299,1302,1304,1307],{"class":64,"style":65},[62,1300,1301],{"style":75},"      \"env\"",[62,1303,79],{"style":68},[62,1305,1306],{"style":82},"\"ACME_ACCOUNT\"",[62,1308,86],{"style":68},[62,1310,1311,1314],{"class":64,"style":65},[62,1312,1313],{"style":75},"      \"choices\"",[62,1315,154],{"style":68},[62,1317,1318,1321],{"class":64,"style":65},[62,1319,1320],{"style":82},"        \"personal\"",[62,1322,86],{"style":68},[62,1324,1325],{"class":64,"style":65},[62,1326,1327],{"style":82},"        \"team\"",[62,1329,1330],{"class":64,"style":65},[62,1331,1332],{"style":68},"      ]",[62,1334,1335],{"class":64,"style":65},[62,1336,411],{"style":68},[62,1338,1339],{"class":64,"style":65},[62,1340,416],{"style":68},[62,1342,1343,1346,1348],{"class":64,"style":65},[62,1344,1345],{"style":75},"  \"rerun\"",[62,1347,79],{"style":68},[62,1349,1350],{"style":82},"\"acme deploy --prod --account \u003Caccount>\"",[62,1352,1353],{"class":64,"style":65},[62,1354,524],{"style":68},[20,1356,1357,1358,1360,1361,1364,1365,1368,1369,1371,1372,1375],{},"A failure's own ",[23,1359,551],{},", set through ",[23,1362,1363],{},"failure()",", replaces the run's. A thrown ",[23,1366,1367],{},"Error(\"x\")"," from ",[23,1370,44],{}," prints ",[23,1373,1374],{},"{ \"schema\": \"acme.check\u002Fv1\", \"status\": \"failed\", \"error\": { \"message\": \"x\" } }",", pretty-printed, with exit code 1 and stderr empty.",[20,1377,1378,1379,1381,1382,1384,1385,1387],{},"In ",[23,1380,1159],{},", a failure adds an ",[23,1383,1087],{}," record before ",[23,1386,615],{},". A program that runs a command whose disk filled up gets:",[55,1389,1390],{"language":893,"class":57,"wrap":14},[23,1391,1392,70,1397,70,1402],{"class":928},[62,1393,1394],{"class":64,"style":65},[62,1395,1396],{},"{\"type\":\"version\",\"schema\":\"acme.run\u002Fv1\",\"tool\":\"acme\"}",[62,1398,1399],{"class":64,"style":65},[62,1400,1401],{},"{\"type\":\"error\",\"message\":\"disk full\"}",[62,1403,1404],{"class":64,"style":65},[62,1405,1406],{},"{\"type\":\"result\",\"status\":\"failed\",\"message\":\"disk full\",\"data\":{}}",[20,1408,673,1409,1411,1412,1414,1415,702,1417,1018,1419,1421,1422,1424],{},[23,1410,615],{}," record's ",[23,1413,980],{}," is the error message. ",[23,1416,607],{},[23,1418,615],{},[23,1420,889],{}," when ",[23,1423,615],{}," can't be serialized, so the error still goes out.",[32,1426,1430],{"id":1427,"anchor":1428},"what-a-parser-can-rely-on",{"label":1429,"icon":37},"Section titled \"What a parser can rely on\"","What a parser can rely on",[1432,1433,1434,1449,1464,1470],"ul",{},[1435,1436,1437,1438,1441,1442,710,1445,1448],"li",{},"Nothing but the document or the records on stdout. ",[23,1439,1440],{},"out.progress()"," prints nothing, and ",[23,1443,1444],{},"--verbose",[23,1446,1447],{},"out.debug()"," lines go to stderr.",[1435,1450,1451,1452,710,1454,1456,1457,570,1460,1463],{},"No ANSI escapes. Color is off for ",[23,1453,5],{},[23,1455,1159],{}," whatever ",[23,1458,1459],{},"--color",[23,1461,1462],{},"FORCE_COLOR"," say.",[1435,1465,1466,1467,574],{},"No prompts and no waiting on stdin, unless the caller passes ",[23,1468,1469],{},"--input @-",[1435,1471,1472,1474,1475,1478,1479,1482,1483,1486,1487,574],{},[23,1473,561],{}," and the exit code agree. ",[23,1476,1477],{},"ok"," is 0 and ",[23,1480,1481],{},"action_required"," is 2. ",[23,1484,1485],{},"failed"," is 1, or 2 for a usage failure, or a code the tool set with ",[23,1488,1489],{},"exitCode",[20,1491,1492,1493,574],{},"Next: ",[47,1494,1496],{"href":1495},"\u002Fguide\u002Frenderers","Custom renderers",[1498,1500,1501,1502,1503,1504],{"id":34,"depth":1499,"text":38},2,{"id":694,"depth":1499,"text":697},{"id":781,"depth":1499,"text":784},{"id":909,"depth":1499,"text":912},{"id":1165,"depth":1499,"text":1168},{"id":1427,"depth":1499,"text":1430},{"path":1506,"title":1507,"description":1508},"\u002Fguide\u002Ffailures","Failures and exit codes","The Failure envelope, failure(), actionRequired(), FailureError, toFailure and out.fail, readerly's exit codes, and how each format prints a failure.",{"path":1495,"title":1496,"description":1510},"Replace one format's output with renderers or every format's with render, using the Renderer interface, RunState, RenderContext and the head and tail parts.",1795985393572,"22ea5d7b-bce0-4e3b-bca3-1fbe3722fcf7"]