[{"data":1,"prerenderedAt":1817,"buildId":1818},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate":3},{"id":4,"title":5,"body":6,"description":1801,"extension":1802,"frontmatter":1803,"heading":15,"meta":1808,"navigation":1810,"order":1780,"path":1811,"seo":1812,"sitemap":1813,"source":1814,"stem":1815,"__hash__":1816},"docs\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate.md","kubb generate - Generate code from your API spec",{"type":7,"value":8,"toc":1775},"minimark",[9,29,67,72,113,117,389,394,414,417,425,450,466,469,482,551,592,610,633,640,643,702,705,709,712,732,802,809,828,833,851,854,857,876,888,899,942,955,971,1022,1042,1050,1103,1113,1118,1158,1162,1176,1183,1227,1230,1266,1274,1288,1293,1308,1315,1475,1583,1608,1614,1624,1636,1673,1676,1685,1701,1766],[10,11,12,16,17,24,25,28],"p",{},[13,14,15],"code",{},"kubb generate"," turns your spec into code with the plugins in your ",[18,19,21],"a",{"href":20},"\u002Fdocs\u002F5.x\u002Freference\u002Fconfiguration",[13,22,23],{},"kubb.config.ts",". It is the default command: ",[13,26,27],{},"kubb"," alone runs it.",[30,31,36],"pre",{"language":32,"filename":33,"code":34,"class":35},"shell","Terminal","kubb generate # input from the config\nkubb generate .\u002FpetStore.yaml # this spec instead","highlights",[13,37,39,56,57],{"class":38},"language-shell",[40,41,44,48,52],"span",{"class":42,"style":43},"line","display: inline",[40,45,47],{"style":46},"color:#6f42c1;--hls-dark:#b392f0","kubb ",[40,49,51],{"style":50},"color:#24292e;--hls-dark:#e1e4e8","generate ",[40,53,55],{"style":54},"color:#6a737d;--hls-dark:#6a737d","# input from the config","\n",[40,58,59,61,64],{"class":42,"style":43},[40,60,47],{"style":46},[40,62,63],{"style":50},"generate .\u002FpetStore.yaml ",[40,65,66],{"style":54},"# this spec instead",[68,69,71],"h2",{"id":70},"arguments","Arguments",[73,74,75,88],"table",{},[76,77,78],"thead",{},[79,80,81,85],"tr",{},[82,83,84],"th",{},"Argument",[82,86,87],{},"What it does",[89,90,91],"tbody",{},[79,92,93,99],{},[94,95,96],"td",{},[13,97,98],{},"[input]",[94,100,101,102,105,106,112],{},"Path, URL, or git input (",[13,103,104],{},"git+\u003Crepo>#\u003Cref>:\u003Cpath>",") of a Swagger or OpenAPI document. Overrides the config's ",[18,107,109],{"href":108},"\u002Fdocs\u002F5.x\u002Freference\u002Fconfiguration#input",[13,110,111],{},"input",".",[68,114,116],{"id":115},"options","Options",[73,118,119,134],{},[76,120,121],{},[79,122,123,126,129,132],{},[82,124,125],{},"Flag",[82,127,128],{},"Alias",[82,130,131],{},"Default",[82,133,87],{},[89,135,136,156,189,212,230,263,285,304,328,347,367],{},[79,137,138,143,148,150],{},[94,139,140],{},[13,141,142],{},"--config \u003Cpath>",[94,144,145],{},[13,146,147],{},"-c",[94,149],{},[94,151,152,153,112],{},"Path to a config file, such as ",[13,154,155],{},".\u002Fkubb.staging.ts",[79,157,158,163,168,173],{},[94,159,160],{},[13,161,162],{},"--log-level \u003Clevel>",[94,164,165],{},[13,166,167],{},"-l",[94,169,170],{},[13,171,172],{},"info",[94,174,175,178,179,181,182,185,186,188],{},[13,176,177],{},"silent",", ",[13,180,172],{},", or ",[13,183,184],{},"verbose",". ",[13,187,184],{}," shows plugin timings.",[79,190,191,196,201,206],{},[94,192,193],{},[13,194,195],{},"--silent",[94,197,198],{},[13,199,200],{},"-s",[94,202,203],{},[13,204,205],{},"false",[94,207,208,209,112],{},"Same as ",[13,210,211],{},"--log-level silent",[79,213,214,219,221,225],{},[94,215,216],{},[13,217,218],{},"--verbose",[94,220],{},[94,222,223],{},[13,224,205],{},[94,226,208,227,112],{},[13,228,229],{},"--log-level verbose",[79,231,232,237,239,244],{},[94,233,234],{},[13,235,236],{},"--reporter \u003Cnames>",[94,238],{},[94,240,241],{},[13,242,243],{},"cli",[94,245,246,247,251,252,178,254,178,257,178,260,112],{},"Comma-separated ",[18,248,250],{"href":249},"#reporters","reporters"," to run: ",[13,253,243],{},[13,255,256],{},"json",[13,258,259],{},"file",[13,261,262],{},"html",[79,264,265,270,275,279],{},[94,266,267],{},[13,268,269],{},"--watch",[94,271,272],{},[13,273,274],{},"-w",[94,276,277],{},[13,278,205],{},[94,280,281,282,284],{},"Generate again when the local ",[13,283,111],{}," file changes.",[79,286,287,292,294,298],{},[94,288,289],{},[13,290,291],{},"--dry-run",[94,293],{},[94,295,296],{},[13,297,205],{},[94,299,300,301,112],{},"Preview the run. Writes no files and skips formatting, linting, and ",[13,302,303],{},"output.postGenerate",[79,305,306,311,313,317],{},[94,307,308],{},[13,309,310],{},"--check",[94,312],{},[94,314,315],{},[13,316,205],{},[94,318,319,320,323,324,112],{},"Compare the output with the files on disk and write nothing. Exits with ",[13,321,322],{},"1"," when a file is out of date. See ",[18,325,327],{"href":326},"#check-mode","Check mode",[79,329,330,335,337,341],{},[94,331,332],{},[13,333,334],{},"--diff",[94,336],{},[94,338,339],{},[13,340,205],{},[94,342,343,344,346],{},"Print a diff for each out-of-date file. Turns ",[13,345,310],{}," on.",[79,348,349,354,356,360],{},[94,350,351],{},[13,352,353],{},"--force",[94,355],{},[94,357,358],{},[13,359,205],{},[94,361,362,363,112],{},"Generate, format, and lint even when the run is ",[18,364,366],{"href":365},"#up-to-date-runs","up to date",[79,368,369,374,376,380],{},[94,370,371],{},[13,372,373],{},"--no-lockfile",[94,375],{},[94,377,378],{},[13,379,205],{},[94,381,382,383,112],{},"Generate without reading or writing ",[18,384,386],{"href":385},"#no-lockfile",[13,387,388],{},"kubb-lock.json",[390,391,393],"h3",{"id":392},"watch-mode","Watch mode",[10,395,396,398,399,401,402,405,406,409,410,112],{},[13,397,269],{}," watches only a local ",[13,400,111],{}," file. A URL or git input generates once, so run Kubb again when the remote spec changes. In an interactive terminal, press ",[13,403,404],{},"r"," to rebuild and ",[13,407,408],{},"q"," to quit. See ",[18,411,413],{"href":412},"#watch-mode-details","Watch mode details",[390,415,327],{"id":416},"check-mode",[10,418,419,421,422,424],{},[13,420,310],{}," tells you whether a run would change the generated files on disk, and writes nothing. Use it in CI to fail a pipeline when someone changed the spec or the config and did not commit the new output. ",[13,423,334],{}," also prints what would change.",[30,426,428],{"language":32,"filename":33,"code":427,"class":35},"kubb generate --check # exit 1 when a file is out of date\nkubb generate --check --diff # also print what would change",[13,429,430,56,440],{"class":38},[40,431,432,434,437],{"class":42,"style":43},[40,433,47],{"style":46},[40,435,436],{"style":50},"generate --check ",[40,438,439],{"style":54},"# exit 1 when a file is out of date",[40,441,442,444,447],{"class":42,"style":43},[40,443,47],{"style":46},[40,445,446],{"style":50},"generate --check --diff ",[40,448,449],{"style":54},"# also print what would change",[10,451,452,456,457,461,462,112],{},[18,453,455],{"href":454},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Frecipes#check-generated-code-in-ci","Check generated code in CI"," has the workflows. See ",[18,458,460],{"href":459},"#check-mode-details","Check mode details"," and ",[18,463,465],{"href":464},"#exit-codes","Exit codes",[68,467,468],{"id":250},"Reporters",[10,470,471,472,477,478,481],{},"A reporter decides how you see a run. The config's ",[18,473,475],{"href":474},"\u002Fdocs\u002F5.x\u002Freference\u002Fconfiguration#reporters",[13,476,250],{}," registers all four by default, and ",[13,479,480],{},"--reporter"," picks which ones run.",[73,483,484,494],{},[76,485,486],{},[79,487,488,491],{},[82,489,490],{},"Reporter",[82,492,493],{},"Output",[89,495,496,505,519,539],{},[79,497,498,502],{},[94,499,500],{},[13,501,243],{},[94,503,504],{},"The end-of-run summary in the terminal. Plain text in non-interactive terminals and AI agent sessions.",[79,506,507,511],{},[94,508,509],{},[13,510,256],{},[94,512,513,514,518],{},"A machine-readable report on stdout for CI. The run log goes to stderr. See ",[18,515,517],{"href":516},"\u002Fdocs\u002F5.x\u002Freference\u002Fdiagnostics#machine-readable-output","Machine-readable output"," for the shape.",[79,520,521,525],{},[94,522,523],{},[13,524,259],{},[94,526,527,528,185,531,534,535,538],{},"The summary, plugin timings, and problems in ",[13,529,530],{},".kubb\u002Fkubb[-\u003Cname>]-\u003Ctimestamp>.log",[13,532,533],{},"\u003Cname>"," is the config's ",[13,536,537],{},"name",", if set.",[79,540,541,545],{},[94,542,543],{},[13,544,262],{},[94,546,547,548,112],{},"A browsable report of the generated files and diagnostics in ",[13,549,550],{},".kubb\u002Fkubb[-\u003Cname>]-\u003Ctimestamp>\u002Findex.html",[30,552,554],{"language":32,"filename":33,"code":553,"class":35},"kubb generate --reporter file # write a log file\nkubb generate --reporter json # print a JSON report for CI\nkubb generate --reporter cli,html # run two reporters",[13,555,556,56,566,56,576],{"class":38},[40,557,558,560,563],{"class":42,"style":43},[40,559,47],{"style":46},[40,561,562],{"style":50},"generate --reporter file ",[40,564,565],{"style":54},"# write a log file",[40,567,568,570,573],{"class":42,"style":43},[40,569,47],{"style":46},[40,571,572],{"style":50},"generate --reporter json ",[40,574,575],{"style":54},"# print a JSON report for CI",[40,577,578,580,583,586,589],{"class":42,"style":43},[40,579,47],{"style":46},[40,581,582],{"style":50},"generate --reporter cli",[40,584,585],{"style":50},",",[40,587,588],{"style":50},"html ",[40,590,591],{"style":54},"# run two reporters",[10,593,594,595,597,598,601,602,605,606,609],{},"The ",[13,596,243],{}," summary ends like ",[13,599,600],{},"oxlint"," or ",[13,603,604],{},"pnpm",": the details first, then a verdict line with the file counts, the kinds of change, and a ",[13,607,608],{},"Finished in"," line with the duration, the output path, and the plugins:",[30,611,615],{"language":612,"filename":613,"code":614,"class":35},"text","Summary","✓ Generated 18 files · 54 unchanged (12 via kubb-lock.json)\n 14 added · 3 modified · 1 deleted · +312 −47\n Finished in 466ms · .\u002Fsrc\u002Fgen · 4 plugins",[13,616,618,56,623,56,628],{"class":617},"language-text",[40,619,620],{"class":42,"style":43},[40,621,622],{"style":50},"✓ Generated 18 files · 54 unchanged (12 via kubb-lock.json)",[40,624,625],{"class":42,"style":43},[40,626,627],{"style":50}," 14 added · 3 modified · 1 deleted · +312 −47",[40,629,630],{"class":42,"style":43},[40,631,632],{"style":50}," Finished in 466ms · .\u002Fsrc\u002Fgen · 4 plugins",[10,634,635,636,112],{},"See ",[18,637,639],{"href":638},"#run-summary","Run summary",[68,641,465],{"id":642},"exit-codes",[73,644,645,664],{},[76,646,647],{},[79,648,649,652,657],{},[82,650,651],{},"Code",[82,653,654,655],{},"Without ",[13,656,310],{},[82,658,659,660,601,662],{},"With ",[13,661,310],{},[13,663,334],{},[89,665,666,679,691],{},[79,667,668,673,676],{},[94,669,670],{},[13,671,672],{},"0",[94,674,675],{},"The run succeeds.",[94,677,678],{},"The files on disk are up to date.",[79,680,681,685,688],{},[94,682,683],{},[13,684,322],{},[94,686,687],{},"The config fails to load, or any config fails to generate.",[94,689,690],{},"A file would be added, modified, or deleted.",[79,692,693,698,700],{},[94,694,695],{},[13,696,697],{},"2",[94,699],{},[94,701,687],{},[10,703,704],{},"One failing config does not stop the others.",[68,706,708],{"id":707},"less-common-cases","Less common cases",[390,710,413],{"id":711},"watch-mode-details",[10,713,659,714,717,718,720,721,724,725,728,729,731],{},[13,715,716],{},"kubb generate --watch",", Kubb watches only a local ",[13,719,111],{}," file. A URL or git input generates once, so run Kubb again when the remote spec changes. Kubb does not watch the files the input references with ",[13,722,723],{},"$ref",", such as ",[13,726,727],{},"schemas\u002FPet.yaml",". After you edit one, press ",[13,730,404],{}," or run Kubb again.",[73,733,734,744],{},[76,735,736],{},[79,737,738,741],{},[82,739,740],{},"Event",[82,742,743],{},"What happens",[89,745,746,754,762,772,781,789],{},[79,747,748,751],{},[94,749,750],{},"The first build fails",[94,752,753],{},"Kubb keeps watching, so you can fix the input.",[79,755,756,759],{},[94,757,758],{},"A rebuild ends",[94,760,761],{},"A line shows the duration and the schemas and operations the spec gained or lost. The summary below it lists the files the rebuild added, modified, or removed.",[79,763,764,769],{},[94,765,766,767],{},"You press ",[13,768,404],{},[94,770,771],{},"Kubb rebuilds. Keys work in an interactive terminal.",[79,773,774,778],{},[94,775,766,776],{},[13,777,408],{},[94,779,780],{},"Kubb quits with exit code 0.",[79,782,783,786],{},[94,784,785],{},"You press Ctrl+C",[94,787,788],{},"Kubb quits with exit code 130.",[79,790,791,799],{},[94,792,793,601,796],{},[13,794,795],{},"SIGINT",[13,797,798],{},"SIGTERM",[94,800,801],{},"Kubb stops watching, writes the reports, and exits with code 130 or 143.",[10,803,804,805,808],{},"Reporters write once, when watching ends, so ",[13,806,807],{},"--watch --reporter json"," prints one JSON document that covers every build.",[10,810,811,812,815,816,819,820,823,824,112],{},"To keep ",[13,813,814],{},"clean"," off during incremental runs, pass a function to ",[13,817,818],{},"defineConfig"," and read ",[13,821,822],{},"watch",". See ",[18,825,827],{"href":826},"\u002Fdocs\u002F5.x\u002Freference\u002Fconfiguration#config-function","Config function",[829,830,832],"h4",{"id":831},"adapter-sources","Adapter sources",[10,834,835,836,839,840,843,844,846,847,112],{},"When you write an adapter, its ",[13,837,838],{},"sources"," member lists the files and URLs the last ",[13,841,842],{},"parse()"," read, even unreadable ones. A watcher can rebuild when one of them changes, but ",[13,845,716],{}," does not read them. See ",[18,848,850],{"href":849},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fadapters","Adapters",[390,852,460],{"id":853},"check-mode-details",[10,855,856],{},"Kubb generates in memory and compares each file with the one on disk. It writes nothing and runs no formatter or linter.",[10,858,859,860,865,866,178,869,872,873,875],{},"A formatter rewrites what Kubb generates, so the generated text and the file on disk often differ. ",[18,861,863],{"href":862},"#kubb-lock",[13,864,388],{}," records what each generated file became after ",[13,867,868],{},"output.format",[13,870,871],{},"output.lint",", and ",[13,874,303],{},". A file is up to date when:",[877,878,879,883],"ul",{},[880,881,882],"li",{},"the file on disk holds the generated text, or",[880,884,885,887],{},[13,886,388],{}," lists the file, and its two hashes equal the hash of the generated text and the hash of the file on disk.",[10,889,654,890,178,892,872,894,896,897,112],{},[13,891,868],{},[13,893,871],{},[13,895,303],{},", the check needs no ",[13,898,388],{},[30,900,903],{"language":612,"filename":901,"code":902,"class":35},"Out of date"," modified src\u002Fgen\u002Ftypes\u002FPet.ts +2 −1\n added src\u002Fgen\u002Ftypes\u002FOrder.ts +14 −0\n deleted src\u002Fgen\u002Ftypes\u002FTag.ts +0 −3\n\n✗ 3 files out of date · 70 up to date (68 via kubb-lock.json)\n 1 added · 1 modified · 1 deleted · +16 −4\n Run `kubb generate` to update them, or `kubb generate --diff` to see the changes.\n Finished in 412ms · .\u002Fsrc\u002Fgen · 4 plugins",[13,904,905,56,910,56,915,56,920,56,922,56,927,56,932,56,937],{"class":617},[40,906,907],{"class":42,"style":43},[40,908,909],{"style":50}," modified src\u002Fgen\u002Ftypes\u002FPet.ts +2 −1",[40,911,912],{"class":42,"style":43},[40,913,914],{"style":50}," added src\u002Fgen\u002Ftypes\u002FOrder.ts +14 −0",[40,916,917],{"class":42,"style":43},[40,918,919],{"style":50}," deleted src\u002Fgen\u002Ftypes\u002FTag.ts +0 −3",[40,921],{"class":42,"style":43},[40,923,924],{"class":42,"style":43},[40,925,926],{"style":50},"✗ 3 files out of date · 70 up to date (68 via kubb-lock.json)",[40,928,929],{"class":42,"style":43},[40,930,931],{"style":50}," 1 added · 1 modified · 1 deleted · +16 −4",[40,933,934],{"class":42,"style":43},[40,935,936],{"style":50}," Run `kubb generate` to update them, or `kubb generate --diff` to see the changes.",[40,938,939],{"class":42,"style":43},[40,940,941],{"style":50}," Finished in 412ms · .\u002Fsrc\u002Fgen · 4 plugins",[10,943,944,945,948,949,951,952,954],{},"Each row shows the status, the path from ",[13,946,947],{},"root",", and the lines a run would add and remove. With ",[13,950,334],{},", the hunks of each file follow its row. Warnings, such as a missing ",[13,953,388],{},", come before the verdict. When every file is up to date, the summary is two lines:",[30,956,959],{"language":612,"filename":957,"code":958,"class":35},"Up to date","✓ 71 files up to date · 68 via kubb-lock.json\n Finished in 407ms · .\u002Fsrc\u002Fgen · 4 plugins",[13,960,961,56,966],{"class":617},[40,962,963],{"class":42,"style":43},[40,964,965],{"style":50},"✓ 71 files up to date · 68 via kubb-lock.json",[40,967,968],{"class":42,"style":43},[40,969,970],{"style":50}," Finished in 407ms · .\u002Fsrc\u002Fgen · 4 plugins",[73,972,973,983],{},[76,974,975],{},[79,976,977,980],{},[82,978,979],{},"Status",[82,981,982],{},"What a run would do",[89,984,985,995,1005],{},[79,986,987,992],{},[94,988,989],{},[13,990,991],{},"added",[94,993,994],{},"Create the file. It is missing on disk.",[79,996,997,1002],{},[94,998,999],{},[13,1000,1001],{},"modified",[94,1003,1004],{},"Rewrite the file. Its content on disk differs.",[79,1006,1007,1012],{},[94,1008,1009],{},[13,1010,1011],{},"deleted",[94,1013,1014,1015,1021],{},"Remove the file. Only listed with ",[18,1016,1018],{"href":1017},"\u002Fdocs\u002F5.x\u002Freference\u002Fconfiguration#outputclean",[13,1019,1020],{},"output.clean",", which removes files Kubb no longer generates.",[10,1023,659,1024,1027,1028,178,1031,872,1034,185,1037,1039,1040,112],{},[13,1025,1026],{},"--reporter json",", each report holds ",[13,1029,1030],{},"check.changed",[13,1032,1033],{},"check.files",[13,1035,1036],{},"check.lockfile",[13,1038,334],{}," then prints the diffs to stderr. See ",[18,1041,517],{"href":516},[10,1043,1044,1046,1047,1049],{},[13,1045,310],{}," differs from ",[13,1048,291],{},":",[73,1051,1052,1066],{},[76,1053,1054],{},[79,1055,1056,1058,1062],{},[82,1057],{},[82,1059,1060],{},[13,1061,291],{},[82,1063,1064],{},[13,1065,310],{},[89,1067,1068,1081,1092],{},[79,1069,1070,1073,1077],{},[94,1071,1072],{},"Exit code when files would change",[94,1074,1075],{},[13,1076,672],{},[94,1078,1079],{},[13,1080,322],{},[79,1082,1083,1086,1089],{},[94,1084,1085],{},"Lists each out-of-date file with its path",[94,1087,1088],{},"No",[94,1090,1091],{},"Yes",[79,1093,1094,1099,1101],{},[94,1095,1096,1097],{},"Prints a diff with ",[13,1098,334],{},[94,1100,1088],{},[94,1102,1091],{},[10,1104,1105,461,1107,1109,1110,1112],{},[13,1106,291],{},[13,1108,310],{}," run no formatter or linter. Each reads ",[13,1111,388],{}," to recognize formatted output.",[10,1114,1115,1117],{},[13,1116,310],{}," has these limits:",[877,1119,1120,1132,1139,1151],{},[880,1121,1122,1123,1125,1126,1128,1129,1131],{},"It cannot run with ",[13,1124,269],{},". With ",[13,1127,291],{},", it behaves like ",[13,1130,310],{}," alone.",[880,1133,1134,1135,1138],{},"The config must use the default ",[13,1136,1137],{},"fs"," storage.",[880,1140,659,1141,178,1143,181,1145,1147,1148,1150],{},[13,1142,868],{},[13,1144,871],{},[13,1146,303],{},", the line counts and ",[13,1149,334],{}," compare the file on disk with the code before those steps ran. A changed file can show more changed lines than a run would write.",[880,1152,1153,1154,1157],{},"A new formatter version or formatter config does not make the check fail. Run ",[13,1155,1156],{},"kubb generate --force"," after you change one.",[390,1159,1161],{"id":1160},"up-to-date-runs","Up-to-date runs",[10,1163,1164,1166,1167,1169,1170,1172,1173,1175],{},[13,1165,15],{}," skips the build when nothing it reads has changed since the last run. Like ",[13,1168,604],{},", it prints \"kubb-lock.json is up to date, generation is skipped\" and exits with ",[13,1171,672],{},". Pass ",[13,1174,353],{}," to generate anyway.",[10,1177,1178,1179,1049],{},"A run is up to date when all of these match ",[18,1180,1181],{"href":862},[13,1182,388],{},[877,1184,1185,1188,1193,1224],{},[880,1186,1187],{},"The config, with the source of every function in it.",[880,1189,1190,1191,112],{},"The spec, and every local file it references with ",[13,1192,723],{},[880,1194,1195,1196,461,1199,1202,1203,1206,1207,1209,1210,1213,1214,1217,1218,1220,1221,112],{},"The version of Kubb and of every package in the ",[13,1197,1198],{},"dependencies",[13,1200,1201],{},"devDependencies"," of each ",[13,1204,1205],{},"package.json"," from ",[13,1208,947],{}," up to the workspace root. The workspace root is the first folder with a ",[13,1211,1212],{},"pnpm-workspace.yaml",", a ",[13,1215,1216],{},".git",", or a ",[13,1219,1205],{}," that sets ",[13,1222,1223],{},"workspaces",[880,1225,1226],{},"Every generated file on disk.",[10,1228,1229],{},"Kubb always generates in these cases:",[877,1231,1232,1235,1244,1249,1254],{},[880,1233,1234],{},"The input is a URL or a git input, or the spec references a URL. Kubb cannot compare those without fetching them.",[880,1236,1237,1238,1240,1241,1243],{},"The adapter does not list the files it read, or no ",[13,1239,1205],{}," exists in ",[13,1242,947],{}," or above it.",[880,1245,1246,1247,112],{},"The config sets ",[13,1248,303],{},[880,1250,1251,1252,112],{},"The config uses a storage other than ",[13,1253,1137],{},[880,1255,1256,1257,178,1259,178,1261,1263,1264,112],{},"You pass ",[13,1258,269],{},[13,1260,310],{},[13,1262,291],{},", or a reporter other than ",[13,1265,243],{},[1267,1268,1270,1271,1273],"blockquote",{"as":1269},"warning","Kubb does not see a change in a file that your config imports, such as a helper module or a plugin you develop locally under the same version. It also does not see a change in your formatter's or linter's config file. Run ",[13,1272,1156],{}," after you edit one.",[10,1275,1276,1277,1279,1280,461,1282,1284,1285,1287],{},"A run that still generates, such as one with ",[13,1278,1026],{},", skips ",[13,1281,868],{},[13,1283,871],{}," when nothing it reads changed and every file comes out unchanged. ",[13,1286,353],{}," runs them.",[390,1289,1291],{"id":1290},"kubb-lock",[13,1292,388],{},[10,1294,1295,1297,1298,1300,1301,1303,1304,112],{},[13,1296,15],{}," writes ",[13,1299,388],{}," to ",[13,1302,947],{}," on every run that writes files. It lists every generated file. Commit it with the generated files. To collapse it in pull requests, see ",[18,1305,1307],{"href":1306},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Frecipes#reviewable-diffs","Keep generated diffs reviewable",[10,1309,1310,461,1312,1314],{},[13,1311,310],{},[13,1313,291],{}," read it, so they work on a fresh checkout without running a formatter.",[30,1316,1318],{"language":256,"filename":388,"code":1317,"class":35},"{\n \"lockfileVersion\": 1,\n \"inputs\": {\n \"src\u002Fgen\": {\n \"hash\": \"0c3bf1dc…\",\n \"sources\": [\"openapi.yaml\"]\n }\n },\n \"files\": {\n \"src\u002Fgen\u002Ftypes\u002FPet.ts\": {\n \"source\": \"647596c2…\",\n \"output\": \"002220b7…\"\n }\n }\n}",[13,1319,1321,56,1327,56,1343,56,1354,56,1366,56,1382,56,1400,56,1405,56,1412,56,1423,56,1434,56,1448,56,1460,56,1467,56,1471],{"class":1320},"language-json",[40,1322,1323],{"class":42,"style":43},[40,1324,1326],{"style":1325},"color:#005cc5;--hls-dark:#79b8ff","{",[40,1328,1329,1332,1335,1339,1341],{"class":42,"style":43},[40,1330,1331],{"style":1325}," ",[40,1333,1334],{"style":1325},"\"lockfileVersion\"",[40,1336,1338],{"style":1337},"color:#d73a49;--hls-dark:#f97583",": ",[40,1340,322],{"style":1325},[40,1342,585],{"style":1337},[40,1344,1345,1347,1350,1352],{"class":42,"style":43},[40,1346,1331],{"style":1337},[40,1348,1349],{"style":1325},"\"inputs\"",[40,1351,1338],{"style":1337},[40,1353,1326],{"style":1325},[40,1355,1356,1359,1362,1364],{"class":42,"style":43},[40,1357,1358],{"style":1325}," ",[40,1360,1361],{"style":1325},"\"src\u002Fgen\"",[40,1363,1338],{"style":1337},[40,1365,1326],{"style":1325},[40,1367,1368,1371,1374,1376,1380],{"class":42,"style":43},[40,1369,1370],{"style":1325}," ",[40,1372,1373],{"style":1325},"\"hash\"",[40,1375,1338],{"style":1337},[40,1377,1379],{"style":1378},"color:#032f62;--hls-dark:#9ecbff","\"0c3bf1dc…\"",[40,1381,585],{"style":1337},[40,1383,1384,1386,1389,1391,1394,1397],{"class":42,"style":43},[40,1385,1370],{"style":1337},[40,1387,1388],{"style":1325},"\"sources\"",[40,1390,1338],{"style":1337},[40,1392,1393],{"style":1325},"[",[40,1395,1396],{"style":1378},"\"openapi.yaml\"",[40,1398,1399],{"style":1325},"]",[40,1401,1402],{"class":42,"style":43},[40,1403,1404],{"style":1325}," }",[40,1406,1407,1410],{"class":42,"style":43},[40,1408,1409],{"style":1325}," }",[40,1411,585],{"style":1337},[40,1413,1414,1416,1419,1421],{"class":42,"style":43},[40,1415,1331],{"style":1337},[40,1417,1418],{"style":1325},"\"files\"",[40,1420,1338],{"style":1337},[40,1422,1326],{"style":1325},[40,1424,1425,1427,1430,1432],{"class":42,"style":43},[40,1426,1358],{"style":1325},[40,1428,1429],{"style":1325},"\"src\u002Fgen\u002Ftypes\u002FPet.ts\"",[40,1431,1338],{"style":1337},[40,1433,1326],{"style":1325},[40,1435,1436,1438,1441,1443,1446],{"class":42,"style":43},[40,1437,1370],{"style":1325},[40,1439,1440],{"style":1325},"\"source\"",[40,1442,1338],{"style":1337},[40,1444,1445],{"style":1378},"\"647596c2…\"",[40,1447,585],{"style":1337},[40,1449,1450,1452,1455,1457],{"class":42,"style":43},[40,1451,1370],{"style":1337},[40,1453,1454],{"style":1325},"\"output\"",[40,1456,1338],{"style":1337},[40,1458,1459],{"style":1378},"\"002220b7…\"",[40,1461,1462,1464],{"class":42,"style":43},[40,1463,1358],{"style":1378},[40,1465,1466],{"style":1325},"}",[40,1468,1469],{"class":42,"style":43},[40,1470,1409],{"style":1325},[40,1472,1473],{"class":42,"style":43},[40,1474,1466],{"style":1325},[73,1476,1477,1487],{},[76,1478,1479],{},[79,1480,1481,1484],{},[82,1482,1483],{},"Field",[82,1485,1486],{},"Value",[89,1488,1489,1499,1516,1532,1543,1555,1565],{},[79,1490,1491,1496],{},[94,1492,1493],{},[13,1494,1495],{},"lockfileVersion",[94,1497,1498],{},"The format version. Kubb ignores a file with another version.",[79,1500,1501,1506],{},[94,1502,1503],{},[13,1504,1505],{},"inputs",[94,1507,1508,1509,1511,1512,1515],{},"What each config last generated from, keyed by the config's ",[13,1510,537],{},", or its ",[13,1513,1514],{},"output.path"," without one. Left out for an input Kubb cannot compare, such as a URL.",[79,1517,1518,1523],{},[94,1519,1520],{},[13,1521,1522],{},"hash",[94,1524,1525,1526,1528,1529,112],{},"SHA-256 hash of the config, the package versions, and the content of the ",[13,1527,838],{},". Line endings count as ",[13,1530,1531],{},"\\n",[79,1533,1534,1538],{},[94,1535,1536],{},[13,1537,838],{},[94,1539,1540,1541,112],{},"The spec and the local files it references, as paths from ",[13,1542,947],{},[79,1544,1545,1550],{},[94,1546,1547],{},[13,1548,1549],{},"files",[94,1551,1552,1553,112],{},"One entry per generated file, keyed by its path from ",[13,1554,947],{},[79,1556,1557,1562],{},[94,1558,1559],{},[13,1560,1561],{},"source",[94,1563,1564],{},"SHA-256 hash of the code Kubb generated.",[79,1566,1567,1572],{},[94,1568,1569],{},[13,1570,1571],{},"output",[94,1573,1574,1575,178,1577,872,1579,1528,1581,112],{},"SHA-256 hash of the file on disk after ",[13,1576,868],{},[13,1578,871],{},[13,1580,303],{},[13,1582,1531],{},[877,1584,1585,1594],{},[880,1586,1587,1588,1590,1591,1593],{},"Do not edit ",[13,1589,388],{},". After a merge conflict, run ",[13,1592,15],{}," and commit the result.",[880,1595,1596,1597,1599,1600,1602,1603,1605,1606,112],{},"When ",[13,1598,310],{}," finds formatted output and no ",[13,1601,388],{},", it exits with ",[13,1604,322],{}," and tells you to run ",[13,1607,15],{},[829,1609,1611,1612],{"id":1610},"no-lockfile","Generate without ",[13,1613,388],{},[10,1615,1616,1617,1619,1620,1623],{},"Pass ",[13,1618,373],{}," to generate without the lockfile, as ",[13,1621,1622],{},"pnpm install --no-lockfile"," does:",[30,1625,1627],{"language":32,"code":1626,"class":35},"kubb generate --no-lockfile",[13,1628,1629],{"class":38},[40,1630,1631,1633],{"class":42,"style":43},[40,1632,47],{"style":46},[40,1634,1635],{"style":50},"generate --no-lockfile",[877,1637,1638,1644,1649,1652],{},[880,1639,1640,1641,1643],{},"Kubb does not read ",[13,1642,388],{}," and does not write it. An existing file stays as it is.",[880,1645,1646,1647,112],{},"Every run generates, formats, and lints. No run is skipped as ",[18,1648,366],{"href":365},[880,1650,1651],{},"A formatted file is written again on each run, because Kubb cannot tell that the formatter produced it.",[880,1653,1654,461,1656,1658,1659,1662,1663,1665,1666,178,1668,181,1670,1672],{},[13,1655,310],{},[13,1657,291],{}," count a file as unchanged only when the file on disk holds the generated text. ",[13,1660,1661],{},"--check --no-lockfile"," exits with ",[13,1664,322],{}," when a file differs from that text, which ",[13,1667,868],{},[13,1669,871],{},[13,1671,303],{}," usually causes.",[390,1674,639],{"id":1675},"run-summary",[10,1677,1678,1679,1681,1682,1684],{},"When a run ends, the ",[13,1680,243],{}," reporter prints a summary. Warnings come first, then a verdict line, the kinds of change, what to run next, and a ",[13,1683,608],{}," line.",[30,1686,1687],{"language":612,"filename":613,"code":614,"class":35},[13,1688,1689,56,1693,56,1697],{"class":617},[40,1690,1691],{"class":42,"style":43},[40,1692,622],{"style":50},[40,1694,1695],{"class":42,"style":43},[40,1696,627],{"style":50},[40,1698,1699],{"class":42,"style":43},[40,1700,632],{"style":50},[73,1702,1703,1713],{},[76,1704,1705],{},[79,1706,1707,1710],{},[82,1708,1709],{},"Entry",[82,1711,1712],{},"What it counts",[89,1714,1715,1728,1743,1756],{},[79,1716,1717,1722],{},[94,1718,1719],{},[13,1720,1721],{},"unchanged",[94,1723,1724,1725,1727],{},"Files whose content did not change, also when ",[13,1726,1020],{}," rewrites the folder.",[79,1729,1730,1735],{},[94,1731,1732],{},[13,1733,1734],{},"via kubb-lock.json",[94,1736,1737,1738,1742],{},"Unchanged files that differ from the generated text but match through ",[18,1739,1740],{"href":862},[13,1741,388],{},", such as formatted files. Like the \"reused\" count of a package manager.",[79,1744,1745,1753],{},[94,1746,1747,178,1749,178,1751],{},[13,1748,991],{},[13,1750,1001],{},[13,1752,1011],{},[94,1754,1755],{},"The output on disk compared with its content before the run. Only the kinds that happened are listed. Custom storage drivers leave this line out.",[79,1757,1758,1763],{},[94,1759,1760],{},[13,1761,1762],{},"+312 −47",[94,1764,1765],{},"The count of each line, so moving a line inside a file is not a removal plus an addition.",[10,1767,659,1768,1770,1771,1774],{},[13,1769,291],{},", the verdict starts with ",[13,1772,1773],{},"◇ Dry run:"," and says how many files would change, followed by \"Nothing was written.\"",{"title":1776,"searchDepth":1777,"depth":1777,"links":1778},"",5,[1779,1781,1786,1787,1788],{"id":70,"depth":1780,"text":71},2,{"id":115,"depth":1780,"text":116,"children":1782},[1783,1785],{"id":392,"depth":1784,"text":393},3,{"id":416,"depth":1784,"text":327},{"id":250,"depth":1780,"text":468},{"id":642,"depth":1780,"text":465},{"id":707,"depth":1780,"text":708,"children":1789},[1790,1794,1795,1796,1800],{"id":711,"depth":1784,"text":413,"children":1791},[1792],{"id":831,"depth":1793,"text":832},4,{"id":853,"depth":1784,"text":460},{"id":1160,"depth":1784,"text":1161},{"id":1290,"depth":1784,"text":388,"children":1797},[1798],{"id":1610,"depth":1793,"text":1799},"Generate without kubb-lock.json",{"id":1675,"depth":1784,"text":639},"The generate command runs the Kubb code-generation pipeline from your kubb.config.ts, with watch mode, dry runs, a CI check, and cli, json, file, and html reporters.","md",{"layout":1804,"title":5,"description":1801,"outline":1805,"order":1780,"navigation":1806},"doc",[1780,1784],{"title":15,"icon":1807},"i-iconoir-play",{"layout":1804,"outline":1809},[1780,1784],{"title":15,"icon":1807},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate",{"title":5,"description":1801},{"loc":1811},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate.md","docs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate","9S8y6mK1-AVrtWHsSASp3yzORILGCGvS2nwSOYFcu_M",1795989036279,"2e8b4c62-5b8c-4587-97c0-530d08a9bd53"]