[{"data":1,"prerenderedAt":1783,"buildId":1784},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate":3},{"id":4,"title":5,"body":6,"description":1767,"extension":1768,"frontmatter":1769,"heading":15,"meta":1774,"navigation":1776,"order":1746,"path":1777,"seo":1778,"sitemap":1779,"source":1780,"stem":1781,"__hash__":1782},"docs\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate.md","kubb generate - Generate code from your API spec",{"type":7,"value":8,"toc":1741},"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,789,808,813,831,834,837,856,868,879,922,935,951,1002,1022,1030,1083,1093,1098,1138,1142,1156,1163,1193,1196,1232,1240,1254,1259,1274,1281,1441,1549,1574,1580,1590,1602,1639,1642,1651,1667,1732],[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],{},[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.",[10,790,791,792,795,796,799,800,803,804,112],{},"To keep ",[13,793,794],{},"clean"," off during incremental runs, pass a function to ",[13,797,798],{},"defineConfig"," and read ",[13,801,802],{},"watch",". See ",[18,805,807],{"href":806},"\u002Fdocs\u002F5.x\u002Freference\u002Fconfiguration#config-function","Config function",[809,810,812],"h4",{"id":811},"adapter-sources","Adapter sources",[10,814,815,816,819,820,823,824,826,827,112],{},"When you write an adapter, its ",[13,817,818],{},"sources"," member lists the files and URLs the last ",[13,821,822],{},"parse()"," read, even unreadable ones. A watcher can rebuild when one of them changes, but ",[13,825,716],{}," does not read them. See ",[18,828,830],{"href":829},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fadapters","Adapters",[390,832,460],{"id":833},"check-mode-details",[10,835,836],{},"Kubb generates in memory and compares each file with the one on disk. It writes nothing and runs no formatter or linter.",[10,838,839,840,845,846,178,849,852,853,855],{},"A formatter rewrites what Kubb generates, so the generated text and the file on disk often differ. ",[18,841,843],{"href":842},"#kubb-lock",[13,844,388],{}," records what each generated file became after ",[13,847,848],{},"output.format",[13,850,851],{},"output.lint",", and ",[13,854,303],{},". A file is up to date when:",[857,858,859,863],"ul",{},[860,861,862],"li",{},"the file on disk holds the generated text, or",[860,864,865,867],{},[13,866,388],{}," lists the file, and its two hashes equal the hash of the generated text and the hash of the file on disk.",[10,869,654,870,178,872,852,874,876,877,112],{},[13,871,848],{},[13,873,851],{},[13,875,303],{},", the check needs no ",[13,878,388],{},[30,880,883],{"language":612,"filename":881,"code":882,"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,884,885,56,890,56,895,56,900,56,902,56,907,56,912,56,917],{"class":617},[40,886,887],{"class":42,"style":43},[40,888,889],{"style":50}," modified src\u002Fgen\u002Ftypes\u002FPet.ts +2 −1",[40,891,892],{"class":42,"style":43},[40,893,894],{"style":50}," added src\u002Fgen\u002Ftypes\u002FOrder.ts +14 −0",[40,896,897],{"class":42,"style":43},[40,898,899],{"style":50}," deleted src\u002Fgen\u002Ftypes\u002FTag.ts +0 −3",[40,901],{"class":42,"style":43},[40,903,904],{"class":42,"style":43},[40,905,906],{"style":50},"✗ 3 files out of date · 70 up to date (68 via kubb-lock.json)",[40,908,909],{"class":42,"style":43},[40,910,911],{"style":50}," 1 added · 1 modified · 1 deleted · +16 −4",[40,913,914],{"class":42,"style":43},[40,915,916],{"style":50}," Run `kubb generate` to update them, or `kubb generate --diff` to see the changes.",[40,918,919],{"class":42,"style":43},[40,920,921],{"style":50}," Finished in 412ms · .\u002Fsrc\u002Fgen · 4 plugins",[10,923,924,925,928,929,931,932,934],{},"Each row shows the status, the path from ",[13,926,927],{},"root",", and the lines a run would add and remove. With ",[13,930,334],{},", the hunks of each file follow its row. Warnings, such as a missing ",[13,933,388],{},", come before the verdict. When every file is up to date, the summary is two lines:",[30,936,939],{"language":612,"filename":937,"code":938,"class":35},"Up to date","✓ 71 files up to date · 68 via kubb-lock.json\n Finished in 407ms · .\u002Fsrc\u002Fgen · 4 plugins",[13,940,941,56,946],{"class":617},[40,942,943],{"class":42,"style":43},[40,944,945],{"style":50},"✓ 71 files up to date · 68 via kubb-lock.json",[40,947,948],{"class":42,"style":43},[40,949,950],{"style":50}," Finished in 407ms · .\u002Fsrc\u002Fgen · 4 plugins",[73,952,953,963],{},[76,954,955],{},[79,956,957,960],{},[82,958,959],{},"Status",[82,961,962],{},"What a run would do",[89,964,965,975,985],{},[79,966,967,972],{},[94,968,969],{},[13,970,971],{},"added",[94,973,974],{},"Create the file. It is missing on disk.",[79,976,977,982],{},[94,978,979],{},[13,980,981],{},"modified",[94,983,984],{},"Rewrite the file. Its content on disk differs.",[79,986,987,992],{},[94,988,989],{},[13,990,991],{},"deleted",[94,993,994,995,1001],{},"Remove the file. Only listed with ",[18,996,998],{"href":997},"\u002Fdocs\u002F5.x\u002Freference\u002Fconfiguration#outputclean",[13,999,1000],{},"output.clean",", which removes files Kubb no longer generates.",[10,1003,659,1004,1007,1008,178,1011,852,1014,185,1017,1019,1020,112],{},[13,1005,1006],{},"--reporter json",", each report holds ",[13,1009,1010],{},"check.changed",[13,1012,1013],{},"check.files",[13,1015,1016],{},"check.lockfile",[13,1018,334],{}," then prints the diffs to stderr. See ",[18,1021,517],{"href":516},[10,1023,1024,1026,1027,1029],{},[13,1025,310],{}," differs from ",[13,1028,291],{},":",[73,1031,1032,1046],{},[76,1033,1034],{},[79,1035,1036,1038,1042],{},[82,1037],{},[82,1039,1040],{},[13,1041,291],{},[82,1043,1044],{},[13,1045,310],{},[89,1047,1048,1061,1072],{},[79,1049,1050,1053,1057],{},[94,1051,1052],{},"Exit code when files would change",[94,1054,1055],{},[13,1056,672],{},[94,1058,1059],{},[13,1060,322],{},[79,1062,1063,1066,1069],{},[94,1064,1065],{},"Lists each out-of-date file with its path",[94,1067,1068],{},"No",[94,1070,1071],{},"Yes",[79,1073,1074,1079,1081],{},[94,1075,1076,1077],{},"Prints a diff with ",[13,1078,334],{},[94,1080,1068],{},[94,1082,1071],{},[10,1084,1085,461,1087,1089,1090,1092],{},[13,1086,291],{},[13,1088,310],{}," run no formatter or linter. Each reads ",[13,1091,388],{}," to recognize formatted output.",[10,1094,1095,1097],{},[13,1096,310],{}," has these limits:",[857,1099,1100,1112,1119,1131],{},[860,1101,1102,1103,1105,1106,1108,1109,1111],{},"It cannot run with ",[13,1104,269],{},". With ",[13,1107,291],{},", it behaves like ",[13,1110,310],{}," alone.",[860,1113,1114,1115,1118],{},"The config must use the default ",[13,1116,1117],{},"fs"," storage.",[860,1120,659,1121,178,1123,181,1125,1127,1128,1130],{},[13,1122,848],{},[13,1124,851],{},[13,1126,303],{},", the line counts and ",[13,1129,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.",[860,1132,1133,1134,1137],{},"A new formatter version or formatter config does not make the check fail. Run ",[13,1135,1136],{},"kubb generate --force"," after you change one.",[390,1139,1141],{"id":1140},"up-to-date-runs","Up-to-date runs",[10,1143,1144,1146,1147,1149,1150,1152,1153,1155],{},[13,1145,15],{}," skips the build when nothing it reads has changed since the last run. Like ",[13,1148,604],{},", it prints \"kubb-lock.json is up to date, generation is skipped\" and exits with ",[13,1151,672],{},". Pass ",[13,1154,353],{}," to generate anyway.",[10,1157,1158,1159,1029],{},"A run is up to date when all of these match ",[18,1160,1161],{"href":842},[13,1162,388],{},[857,1164,1165,1168,1173,1190],{},[860,1166,1167],{},"The config, with the source of every function in it.",[860,1169,1170,1171,112],{},"The spec, and every local file it references with ",[13,1172,723],{},[860,1174,1175,1176,461,1179,1182,1183,1186,1187,1189],{},"The version of Kubb and of every package in the ",[13,1177,1178],{},"dependencies",[13,1180,1181],{},"devDependencies"," of each ",[13,1184,1185],{},"package.json"," from ",[13,1188,927],{}," up.",[860,1191,1192],{},"Every generated file on disk.",[10,1194,1195],{},"Kubb always generates in these cases:",[857,1197,1198,1201,1210,1215,1220],{},[860,1199,1200],{},"The input is a URL or a git input, or the spec references a URL. Kubb cannot compare those without fetching them.",[860,1202,1203,1204,1206,1207,1209],{},"The adapter does not list the files it read, or no ",[13,1205,1185],{}," exists in ",[13,1208,927],{}," or above it.",[860,1211,1212,1213,112],{},"The config sets ",[13,1214,303],{},[860,1216,1217,1218,112],{},"The config uses a storage other than ",[13,1219,1117],{},[860,1221,1222,1223,178,1225,178,1227,1229,1230,112],{},"You pass ",[13,1224,269],{},[13,1226,310],{},[13,1228,291],{},", or a reporter other than ",[13,1231,243],{},[1233,1234,1236,1237,1239],"blockquote",{"as":1235},"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,1238,1136],{}," after you edit one.",[10,1241,1242,1243,1245,1246,461,1248,1250,1251,1253],{},"A run that still generates, such as one with ",[13,1244,1006],{},", skips ",[13,1247,848],{},[13,1249,851],{}," when nothing it reads changed and every file comes out unchanged. ",[13,1252,353],{}," runs them.",[390,1255,1257],{"id":1256},"kubb-lock",[13,1258,388],{},[10,1260,1261,1263,1264,1266,1267,1269,1270,112],{},[13,1262,15],{}," writes ",[13,1265,388],{}," to ",[13,1268,927],{}," 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,1271,1273],{"href":1272},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Frecipes#reviewable-diffs","Keep generated diffs reviewable",[10,1275,1276,461,1278,1280],{},[13,1277,310],{},[13,1279,291],{}," read it, so they work on a fresh checkout without running a formatter.",[30,1282,1284],{"language":256,"filename":388,"code":1283,"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,1285,1287,56,1293,56,1309,56,1320,56,1332,56,1348,56,1366,56,1371,56,1378,56,1389,56,1400,56,1414,56,1426,56,1433,56,1437],{"class":1286},"language-json",[40,1288,1289],{"class":42,"style":43},[40,1290,1292],{"style":1291},"color:#005cc5;--hls-dark:#79b8ff","{",[40,1294,1295,1298,1301,1305,1307],{"class":42,"style":43},[40,1296,1297],{"style":1291}," ",[40,1299,1300],{"style":1291},"\"lockfileVersion\"",[40,1302,1304],{"style":1303},"color:#d73a49;--hls-dark:#f97583",": ",[40,1306,322],{"style":1291},[40,1308,585],{"style":1303},[40,1310,1311,1313,1316,1318],{"class":42,"style":43},[40,1312,1297],{"style":1303},[40,1314,1315],{"style":1291},"\"inputs\"",[40,1317,1304],{"style":1303},[40,1319,1292],{"style":1291},[40,1321,1322,1325,1328,1330],{"class":42,"style":43},[40,1323,1324],{"style":1291}," ",[40,1326,1327],{"style":1291},"\"src\u002Fgen\"",[40,1329,1304],{"style":1303},[40,1331,1292],{"style":1291},[40,1333,1334,1337,1340,1342,1346],{"class":42,"style":43},[40,1335,1336],{"style":1291}," ",[40,1338,1339],{"style":1291},"\"hash\"",[40,1341,1304],{"style":1303},[40,1343,1345],{"style":1344},"color:#032f62;--hls-dark:#9ecbff","\"0c3bf1dc…\"",[40,1347,585],{"style":1303},[40,1349,1350,1352,1355,1357,1360,1363],{"class":42,"style":43},[40,1351,1336],{"style":1303},[40,1353,1354],{"style":1291},"\"sources\"",[40,1356,1304],{"style":1303},[40,1358,1359],{"style":1291},"[",[40,1361,1362],{"style":1344},"\"openapi.yaml\"",[40,1364,1365],{"style":1291},"]",[40,1367,1368],{"class":42,"style":43},[40,1369,1370],{"style":1291}," }",[40,1372,1373,1376],{"class":42,"style":43},[40,1374,1375],{"style":1291}," }",[40,1377,585],{"style":1303},[40,1379,1380,1382,1385,1387],{"class":42,"style":43},[40,1381,1297],{"style":1303},[40,1383,1384],{"style":1291},"\"files\"",[40,1386,1304],{"style":1303},[40,1388,1292],{"style":1291},[40,1390,1391,1393,1396,1398],{"class":42,"style":43},[40,1392,1324],{"style":1291},[40,1394,1395],{"style":1291},"\"src\u002Fgen\u002Ftypes\u002FPet.ts\"",[40,1397,1304],{"style":1303},[40,1399,1292],{"style":1291},[40,1401,1402,1404,1407,1409,1412],{"class":42,"style":43},[40,1403,1336],{"style":1291},[40,1405,1406],{"style":1291},"\"source\"",[40,1408,1304],{"style":1303},[40,1410,1411],{"style":1344},"\"647596c2…\"",[40,1413,585],{"style":1303},[40,1415,1416,1418,1421,1423],{"class":42,"style":43},[40,1417,1336],{"style":1303},[40,1419,1420],{"style":1291},"\"output\"",[40,1422,1304],{"style":1303},[40,1424,1425],{"style":1344},"\"002220b7…\"",[40,1427,1428,1430],{"class":42,"style":43},[40,1429,1324],{"style":1344},[40,1431,1432],{"style":1291},"}",[40,1434,1435],{"class":42,"style":43},[40,1436,1375],{"style":1291},[40,1438,1439],{"class":42,"style":43},[40,1440,1432],{"style":1291},[73,1442,1443,1453],{},[76,1444,1445],{},[79,1446,1447,1450],{},[82,1448,1449],{},"Field",[82,1451,1452],{},"Value",[89,1454,1455,1465,1482,1498,1509,1521,1531],{},[79,1456,1457,1462],{},[94,1458,1459],{},[13,1460,1461],{},"lockfileVersion",[94,1463,1464],{},"The format version. Kubb ignores a file with another version.",[79,1466,1467,1472],{},[94,1468,1469],{},[13,1470,1471],{},"inputs",[94,1473,1474,1475,1477,1478,1481],{},"What each config last generated from, keyed by the config's ",[13,1476,537],{},", or its ",[13,1479,1480],{},"output.path"," without one. Left out for an input Kubb cannot compare, such as a URL.",[79,1483,1484,1489],{},[94,1485,1486],{},[13,1487,1488],{},"hash",[94,1490,1491,1492,1494,1495,112],{},"SHA-256 hash of the config, the package versions, and the content of the ",[13,1493,818],{},". Line endings count as ",[13,1496,1497],{},"\\n",[79,1499,1500,1504],{},[94,1501,1502],{},[13,1503,818],{},[94,1505,1506,1507,112],{},"The spec and the local files it references, as paths from ",[13,1508,927],{},[79,1510,1511,1516],{},[94,1512,1513],{},[13,1514,1515],{},"files",[94,1517,1518,1519,112],{},"One entry per generated file, keyed by its path from ",[13,1520,927],{},[79,1522,1523,1528],{},[94,1524,1525],{},[13,1526,1527],{},"source",[94,1529,1530],{},"SHA-256 hash of the code Kubb generated.",[79,1532,1533,1538],{},[94,1534,1535],{},[13,1536,1537],{},"output",[94,1539,1540,1541,178,1543,852,1545,1494,1547,112],{},"SHA-256 hash of the file on disk after ",[13,1542,848],{},[13,1544,851],{},[13,1546,303],{},[13,1548,1497],{},[857,1550,1551,1560],{},[860,1552,1553,1554,1556,1557,1559],{},"Do not edit ",[13,1555,388],{},". After a merge conflict, run ",[13,1558,15],{}," and commit the result.",[860,1561,1562,1563,1565,1566,1568,1569,1571,1572,112],{},"When ",[13,1564,310],{}," finds formatted output and no ",[13,1567,388],{},", it exits with ",[13,1570,322],{}," and tells you to run ",[13,1573,15],{},[809,1575,1577,1578],{"id":1576},"no-lockfile","Generate without ",[13,1579,388],{},[10,1581,1582,1583,1585,1586,1589],{},"Pass ",[13,1584,373],{}," to generate without the lockfile, as ",[13,1587,1588],{},"pnpm install --no-lockfile"," does:",[30,1591,1593],{"language":32,"code":1592,"class":35},"kubb generate --no-lockfile",[13,1594,1595],{"class":38},[40,1596,1597,1599],{"class":42,"style":43},[40,1598,47],{"style":46},[40,1600,1601],{"style":50},"generate --no-lockfile",[857,1603,1604,1610,1615,1618],{},[860,1605,1606,1607,1609],{},"Kubb does not read ",[13,1608,388],{}," and does not write it. An existing file stays as it is.",[860,1611,1612,1613,112],{},"Every run generates, formats, and lints. No run is skipped as ",[18,1614,366],{"href":365},[860,1616,1617],{},"A formatted file is written again on each run, because Kubb cannot tell that the formatter produced it.",[860,1619,1620,461,1622,1624,1625,1628,1629,1631,1632,178,1634,181,1636,1638],{},[13,1621,310],{},[13,1623,291],{}," count a file as unchanged only when the file on disk holds the generated text. ",[13,1626,1627],{},"--check --no-lockfile"," exits with ",[13,1630,322],{}," when a file differs from that text, which ",[13,1633,848],{},[13,1635,851],{},[13,1637,303],{}," usually causes.",[390,1640,639],{"id":1641},"run-summary",[10,1643,1644,1645,1647,1648,1650],{},"When a run ends, the ",[13,1646,243],{}," reporter prints a summary. Warnings come first, then a verdict line, the kinds of change, what to run next, and a ",[13,1649,608],{}," line.",[30,1652,1653],{"language":612,"filename":613,"code":614,"class":35},[13,1654,1655,56,1659,56,1663],{"class":617},[40,1656,1657],{"class":42,"style":43},[40,1658,622],{"style":50},[40,1660,1661],{"class":42,"style":43},[40,1662,627],{"style":50},[40,1664,1665],{"class":42,"style":43},[40,1666,632],{"style":50},[73,1668,1669,1679],{},[76,1670,1671],{},[79,1672,1673,1676],{},[82,1674,1675],{},"Entry",[82,1677,1678],{},"What it counts",[89,1680,1681,1694,1709,1722],{},[79,1682,1683,1688],{},[94,1684,1685],{},[13,1686,1687],{},"unchanged",[94,1689,1690,1691,1693],{},"Files whose content did not change, also when ",[13,1692,1000],{}," rewrites the folder.",[79,1695,1696,1701],{},[94,1697,1698],{},[13,1699,1700],{},"via kubb-lock.json",[94,1702,1703,1704,1708],{},"Unchanged files that differ from the generated text but match through ",[18,1705,1706],{"href":842},[13,1707,388],{},", such as formatted files. Like the \"reused\" count of a package manager.",[79,1710,1711,1719],{},[94,1712,1713,178,1715,178,1717],{},[13,1714,971],{},[13,1716,981],{},[13,1718,991],{},[94,1720,1721],{},"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,1723,1724,1729],{},[94,1725,1726],{},[13,1727,1728],{},"+312 −47",[94,1730,1731],{},"The count of each line, so moving a line inside a file is not a removal plus an addition.",[10,1733,659,1734,1736,1737,1740],{},[13,1735,291],{},", the verdict starts with ",[13,1738,1739],{},"◇ Dry run:"," and says how many files would change, followed by \"Nothing was written.\"",{"title":1742,"searchDepth":1743,"depth":1743,"links":1744},"",5,[1745,1747,1752,1753,1754],{"id":70,"depth":1746,"text":71},2,{"id":115,"depth":1746,"text":116,"children":1748},[1749,1751],{"id":392,"depth":1750,"text":393},3,{"id":416,"depth":1750,"text":327},{"id":250,"depth":1746,"text":468},{"id":642,"depth":1746,"text":465},{"id":707,"depth":1746,"text":708,"children":1755},[1756,1760,1761,1762,1766],{"id":711,"depth":1750,"text":413,"children":1757},[1758],{"id":811,"depth":1759,"text":812},4,{"id":833,"depth":1750,"text":460},{"id":1140,"depth":1750,"text":1141},{"id":1256,"depth":1750,"text":388,"children":1763},[1764],{"id":1576,"depth":1759,"text":1765},"Generate without kubb-lock.json",{"id":1641,"depth":1750,"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":1770,"title":5,"description":1767,"outline":1771,"order":1746,"navigation":1772},"doc",[1746,1750],{"title":15,"icon":1773},"i-iconoir-play",{"layout":1770,"outline":1775},[1746,1750],{"title":15,"icon":1773},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate",{"title":5,"description":1767},{"loc":1777},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate.md","docs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate","nwKnxShEHWBgXjST23uGSeixGW0w_Z8BgrzYfdJ8AkU",1795727676717,"1b64b1eb-29b7-4f90-ad41-6f24721e1669"]