[{"data":1,"prerenderedAt":506},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate":3},{"id":4,"title":5,"body":6,"description":489,"extension":490,"frontmatter":491,"heading":5,"meta":497,"navigation":499,"order":485,"path":500,"seo":501,"sitemap":502,"source":503,"stem":504,"__hash__":505},"docs\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate.md","kubb generate",{"type":7,"value":8,"toc":480},"minimark",[9,29,34,37,59,62,74,78,116,120,262,275,283,297,301,316,323,371,377,450,453,465,468],[10,11,12,13,16,17,24,25,28],"p",{},"Run ",[14,15,5],"code",{}," to read your ",[18,19,21],"a",{"href":20},"\u002Fdocs\u002F5.x\u002Freference\u002Fconfiguration",[14,22,23],{},"kubb.config.ts"," and run the code-generation pipeline. It's the default command, so running ",[14,26,27],{},"kubb"," with no arguments does the same.",[30,31,33],"h2",{"id":32},"usage","Usage",[10,35,36],{},"Generate from the input set in your config:",[38,39,43],"pre",{"language":40,"filename":41,"code":5,"class":42},"shell","Terminal","highlights",[14,44,46],{"class":45},"language-shell",[47,48,51,55],"span",{"class":49,"style":50},"line","display: inline",[47,52,54],{"style":53},"color:#6f42c1;--hls-dark:#b392f0","kubb ",[47,56,58],{"style":57},"color:#24292e;--hls-dark:#e1e4e8","generate",[10,60,61],{},"Pass an input file to override the config:",[38,63,65],{"language":40,"filename":41,"code":64,"class":42},"kubb generate .\u002FpetStore.yaml",[14,66,67],{"class":45},[47,68,69,71],{"class":49,"style":50},[47,70,54],{"style":53},[47,72,73],{"style":57},"generate .\u002FpetStore.yaml",[30,75,77],{"id":76},"arguments","Arguments",[79,80,81,94],"table",{},[82,83,84],"thead",{},[85,86,87,91],"tr",{},[88,89,90],"th",{},"Argument",[88,92,93],{},"Description",[95,96,97],"tbody",{},[85,98,99,105],{},[100,101,102],"td",{},[14,103,104],{},"[input]",[100,106,107,108,111,112,115],{},"Optional path, URL, or git input (",[14,109,110],{},"git+\u003Crepo>#\u003Cref>:\u003Cpath>",") of a Swagger\u002FOpenAPI document. Overrides the ",[14,113,114],{},"input"," set in the config.",[30,117,119],{"id":118},"options","Options",[79,121,122,134],{},[82,123,124],{},[85,125,126,129,132],{},[88,127,128],{},"Option",[88,130,131],{},"Default",[88,133,93],{},[95,135,136,156,178,200,216,231,248],{},[85,137,138,147,149],{},[100,139,140,143,144],{},[14,141,142],{},"--config=\u003Cpath>",", ",[14,145,146],{},"-c \u003Cpath>",[100,148],{},[100,150,151,152,155],{},"Path to a config file, such as ",[14,153,154],{},".\u002Fkubb.staging.ts",".",[85,157,158,166,171],{},[100,159,160,143,163],{},[14,161,162],{},"--log-level=\u003Csilent|info|verbose>",[14,164,165],{},"-l",[100,167,168],{},[14,169,170],{},"info",[100,172,173,174,177],{},"Set the verbosity. Use ",[14,175,176],{},"verbose"," to see plugin timings.",[85,179,180,188,193],{},[100,181,182,143,185],{},[14,183,184],{},"--silent",[14,186,187],{},"-s",[100,189,190],{},[14,191,192],{},"false",[100,194,195,196,199],{},"Force the log level to ",[14,197,198],{},"silent",". Suppresses output.",[85,201,202,207,211],{},[100,203,204],{},[14,205,206],{},"--verbose",[100,208,209],{},[14,210,192],{},[100,212,195,213,215],{},[14,214,176],{},". Shows slow plugins.",[85,217,218,223,225],{},[100,219,220],{},[14,221,222],{},"--reporter=\u003Ccli|json|file|html>",[100,224],{},[100,226,227,228,155],{},"Pick which reporters to trigger, comma-separated. Defaults to ",[14,229,230],{},"cli",[85,232,233,241,245],{},[100,234,235,143,238],{},[14,236,237],{},"--watch",[14,239,240],{},"-w",[100,242,243],{},[14,244,192],{},[100,246,247],{},"Re-run the pipeline whenever the local input file changes.",[85,249,250,255,259],{},[100,251,252],{},[14,253,254],{},"--dry-run",[100,256,257],{},[14,258,192],{},[100,260,261],{},"Preview a run without writing files, formatting, linting, or running post-generate commands. The summary shows planned file changes compared with disk.",[10,263,264,267,268,143,271,274],{},[14,265,266],{},"--reporter"," takes no short flag. The camelCase spellings from v4 (",[14,269,270],{},"--logLevel",[14,272,273],{},"--dryRun",") still work and print a deprecation warning.",[10,276,277,279,280,282],{},[14,278,237],{}," follows a local ",[14,281,114],{}," file only. A URL or git input is generated once, so rerun Kubb after the remote spec changes.",[10,284,285,286,288,289,292,293,296],{},"In ",[14,287,237],{}," mode, each rebuild line shows the duration and the schemas and operations the spec gained or lost; the summary below it lists the files it added, modified, or removed. In an interactive terminal, press ",[14,290,291],{},"r"," to rebuild and ",[14,294,295],{},"q"," to quit.",[30,298,300],{"id":299},"reporters","Reporters",[10,302,303,304,308,309,311,312,315],{},"A reporter decides how a run is rendered. The config registers available reporters with ",[18,305,306],{"href":20},[14,307,299],{},". ",[14,310,266],{}," picks which ones to trigger by name, comma-separated (",[14,313,314],{},"--reporter cli,file","). Four reporters are registered by default.",[10,317,318,319,322],{},"The CLI summary starts with the outcome and duration, then labels plugin results and the output path. Files with unchanged content are counted separately, including when ",[14,320,321],{},"output.clean"," rewrites the output directory.",[38,324,328],{"language":325,"filename":326,"code":327,"class":42},"text","Summary","✓ Generation complete  466ms\n\n  17 files generated · 54 unchanged\n  Plugins  4 passed\n  Output   .\u002Fsrc\u002Fgen\n\nFile changes\n  14 added · 3 modified · 1 deleted\n  Lines  +312 −47",[14,329,331,336,337,336,339,336,344,336,349,336,354,336,356,336,361,336,366],{"class":330},"language-text",[47,332,333],{"class":49,"style":50},[47,334,335],{"style":57},"✓ Generation complete  466ms","\n",[47,338],{"class":49,"style":50},[47,340,341],{"class":49,"style":50},[47,342,343],{"style":57},"  17 files generated · 54 unchanged",[47,345,346],{"class":49,"style":50},[47,347,348],{"style":57},"  Plugins  4 passed",[47,350,351],{"class":49,"style":50},[47,352,353],{"style":57},"  Output   .\u002Fsrc\u002Fgen",[47,355],{"class":49,"style":50},[47,357,358],{"class":49,"style":50},[47,359,360],{"style":57},"File changes",[47,362,363],{"class":49,"style":50},[47,364,365],{"style":57},"  14 added · 3 modified · 1 deleted",[47,367,368],{"class":49,"style":50},[47,369,370],{"style":57},"  Lines  +312 −47",[10,372,373,374,376],{},"File changes compare filesystem output with its contents before the run. Custom storage drivers omit this section. Line totals compare counts of each line, so moving a line within a file does not count as a removal and addition. With ",[14,375,254],{},", the summary says “planned” and “Nothing was written.” Plain terminals and AI agent sessions show the same summary.",[79,378,379,389],{},[82,380,381],{},[85,382,383,386],{},[88,384,385],{},"Reporter",[88,387,388],{},"Output",[95,390,391,400,415,437],{},[85,392,393,397],{},[100,394,395],{},[14,396,230],{},[100,398,399],{},"The end-of-run summary in the terminal. Default. Uses plain text in non-interactive terminals and AI agent sessions.",[85,401,402,407],{},[100,403,404],{},[14,405,406],{},"json",[100,408,409,410,414],{},"A machine-readable report on stdout for CI. See ",[18,411,413],{"href":412},"\u002Fdocs\u002F5.x\u002Freference\u002Fdiagnostics#machine-readable-output","Diagnostics"," for the full JSON shape.",[85,416,417,422],{},[100,418,419],{},[14,420,421],{},"file",[100,423,424,425,428,429,432,433,436],{},"The run's diagnostics, written to ",[14,426,427],{},".kubb\u002Fkubb[-\u003Cname>]-\u003Ctimestamp>.log",". The ",[14,430,431],{},"\u003Cname>"," segment is dropped when the config has no ",[14,434,435],{},"name",". A run without diagnostics writes no file.",[85,438,439,444],{},[100,440,441],{},[14,442,443],{},"html",[100,445,446,447,155],{},"A browsable report directory with generated files and diagnostics, written to ",[14,448,449],{},".kubb\u002Fkubb[-\u003Cname>]-\u003Ctimestamp>\u002Findex.html",[10,451,452],{},"Write a log file:",[38,454,456],{"language":40,"filename":41,"code":455,"class":42},"kubb generate --reporter file",[14,457,458],{"class":45},[47,459,460,462],{"class":49,"style":50},[47,461,54],{"style":53},[47,463,464],{"style":57},"generate --reporter file",[10,466,467],{},"Print a JSON report for CI. The exit code is non-zero on any error:",[38,469,471],{"language":40,"filename":41,"code":470,"class":42},"kubb generate --reporter json",[14,472,473],{"class":45},[47,474,475,477],{"class":49,"style":50},[47,476,54],{"style":53},[47,478,479],{"style":57},"generate --reporter json",{"title":481,"searchDepth":482,"depth":482,"links":483},"",5,[484,486,487,488],{"id":32,"depth":485,"text":33},2,{"id":76,"depth":485,"text":77},{"id":118,"depth":485,"text":119},{"id":299,"depth":485,"text":300},"The generate command runs the Kubb code-generation pipeline based on your kubb.config.ts.","md",{"layout":492,"title":5,"description":489,"outline":493,"order":485,"navigation":495},"doc",[485,494],3,{"title":5,"icon":496},"i-iconoir-play",{"layout":492,"outline":498},[485,494],{"title":5,"icon":496},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate",{"title":5,"description":489},{"loc":500},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate.md","docs\u002F5.x\u002Freference\u002Fcommands\u002Fgenerate","r700bUk1MQzENTYW1yS4WAC1r0tyelvNGCyNuxTiYsI",1793288240238]