[{"data":1,"prerenderedAt":669,"buildId":670},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fadd":3},{"id":4,"title":5,"body":6,"description":652,"extension":653,"frontmatter":654,"heading":15,"meta":660,"navigation":662,"order":657,"path":663,"seo":664,"sitemap":665,"source":666,"stem":667,"__hash__":668},"docs\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fadd.md","kubb add - Install an extension from the registry",{"type":7,"value":8,"toc":635},"minimark",[9,21,30,88,92,97,136,140,146,150,153,196,207,211,221,263,269,273,336,352,356,441,448,452,506,510,514,520,584,596,605,608,616],[10,11,12,16,17,20],"p",{},[13,14,15],"code",{},"kubb add"," installs an extension at the version the registry pins. It adds a plugin or parser to your ",[13,18,19],{},"kubb.config.ts",". For an adapter, it prints the code you add by hand.",[10,22,23,24,29],{},"Ids, versions, and project files work as in ",[25,26,28],"a",{"href":27},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands#extension-commands","Extension commands",".",[31,32,37],"pre",{"language":33,"filename":34,"code":35,"class":36},"shell","Terminal","kubb add # search the registry\nkubb add plugin-zod # an official plugin by slug\nkubb add acme\u002Fplugin-graphql --yes # a community plugin, no prompt\nkubb add plugin-zod --no-install # edit the config only","highlights",[13,38,40,57,58,57,68,57,78],{"class":39},"language-shell",[41,42,45,49,53],"span",{"class":43,"style":44},"line","display: inline",[41,46,48],{"style":47},"color:#6f42c1;--hls-dark:#b392f0","kubb ",[41,50,52],{"style":51},"color:#24292e;--hls-dark:#e1e4e8","add ",[41,54,56],{"style":55},"color:#6a737d;--hls-dark:#6a737d","# search the registry","\n",[41,59,60,62,65],{"class":43,"style":44},[41,61,48],{"style":47},[41,63,64],{"style":51},"add plugin-zod ",[41,66,67],{"style":55},"# an official plugin by slug",[41,69,70,72,75],{"class":43,"style":44},[41,71,48],{"style":47},[41,73,74],{"style":51},"add acme\u002Fplugin-graphql --yes ",[41,76,77],{"style":55},"# a community plugin, no prompt",[41,79,80,82,85],{"class":43,"style":44},[41,81,48],{"style":47},[41,83,84],{"style":51},"add plugin-zod --no-install ",[41,86,87],{"style":55},"# edit the config only",[89,90],"mermaid",{"svg":91},"\u003Csvg xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\" class=\"pele pele-flowchart\" viewBox=\"0 0 1212 161\" width=\"1212\" height=\"161\" style=\"--_bg:var(--pele-bg,#fff);--_fg:var(--pele-fg,#1f1f1f);--_m:var(--pele-muted,#6e6e6e);--_l:var(--pele-line,#1f1f1f);--_s:var(--pele-surface,#f3f3f3);--_a:var(--pele-surface-alt,#e6e6e6);--_b:var(--pele-border,#8a8a8a);--_c:var(--pele-accent,#5b7bd5);color:var(--_fg);--_r:var(--pele-radius,4px);--_fm:var(--pele-font-mono,monospace);font:16px sans-serif;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;font-family:var(--pele-font,sans-serif)\" fill=\"var(--_fg)\" role=\"graphics-document document\" aria-roledescription=\"flowchart\">\u003Cg class=\"pele-edges\" fill=\"none\" stroke=\"var(--_l)\" stroke-linecap=\"round\">\u003Cg class=\"pele-edge\" data-id=\"L_A_B_0\">\u003Cpath d=\"M118.69,76L159.69,76\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M166.69,76L158.69,79.36L158.69,72.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_B_C_0\">\u003Cpath d=\"M305.84,76L346.84,76\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M353.84,76L345.84,79.36L345.84,72.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_C_X_0\">\u003Cpath d=\"M490.96,68C507.61,68 507.61,32 524.26,32L631,32\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M638,32L630,35.36L630,28.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_C_D_0\">\u003Cpath d=\"M490.96,84C507.61,84 507.61,120 524.26,120L578.54,120\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M585.54,120L577.54,123.36L577.54,116.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_D_E_0\">\u003Cpath d=\"M766.47,120L807.47,120\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M814.47,120L806.47,123.36L806.47,116.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003Cg class=\"pele-edge\" data-id=\"L_E_F_0\">\u003Cpath d=\"M988.33,120L1029.33,120\"\u002F>\u003Cpath class=\"pele-marker\" d=\"M1036.33,120L1028.33,123.36L1028.33,116.64Z\" fill=\"var(--_l)\" stroke=\"none\"\u002F>\u003C\u002Fg>\u003C\u002Fg>\u003Cg class=\"pele-edge-labels\" font-size=\"14\">\u003Cg class=\"pele-edge-label\" data-id=\"L_C_X_0\">\u003Crect x=\"529.37\" y=\"21.5\" width=\"23.57\" height=\"21\" rx=\"3\" fill=\"var(--_bg)\"\u002F>\u003Ctext x=\"541.15\" y=\"36.9\" text-anchor=\"middle\">no\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-edge-label\" data-id=\"L_C_D_0\">\u003Crect x=\"526.26\" y=\"109.5\" width=\"29.78\" height=\"21\" rx=\"3\" fill=\"var(--_bg)\"\u002F>\u003Ctext x=\"541.15\" y=\"124.9\" text-anchor=\"middle\">yes\u003C\u002Ftext>\u003C\u002Fg>\u003C\u002Fg>\u003Cg class=\"pele-nodes\">\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"A\" transform=\"translate(63.34,76)\">\u003Crect x=\"-55.34\" y=\"-24\" width=\"110.69\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">Resolve id\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"B\" transform=\"translate(236.26,76)\">\u003Crect x=\"-69.58\" y=\"-24\" width=\"139.15\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">Read manifest\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-diam\" data-id=\"C\" transform=\"translate(428.8,76)\">\u003Cpolygon points=\"0,-46.85 74.96,0 0,46.85 -74.96,0\" fill=\"var(--_s)\" stroke=\"var(--_b)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">Supported?\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"X\" transform=\"translate(676.01,32)\">\u003Crect x=\"-38.01\" y=\"-24\" width=\"76.02\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">Exit 1\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"D\" transform=\"translate(676.01,120)\">\u003Crect x=\"-90.46\" y=\"-24\" width=\"180.93\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">Preview and confirm\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"E\" transform=\"translate(901.4,120)\">\u003Crect x=\"-86.93\" y=\"-33\" width=\"173.86\" height=\"66\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" text-anchor=\"middle\" xml:space=\"preserve\">\u003Ctspan x=\"0\" y=\"-4.9\">Install package and\u003C\u002Ftspan>\u003Ctspan x=\"0\" y=\"16.1\">required plugins\u003C\u002Ftspan>\u003C\u002Ftext>\u003C\u002Fg>\u003Cg class=\"pele-node pele-shape-rect\" data-id=\"F\" transform=\"translate(1119.7,120)\">\u003Crect x=\"-83.37\" y=\"-24\" width=\"166.74\" height=\"48\" fill=\"var(--_s)\" stroke=\"var(--_b)\" style=\"rx:var(--_r)\"\u002F>\u003Ctext class=\"pele-label\" x=\"0\" y=\"5.6\" text-anchor=\"middle\">Edit kubb.config.ts\u003C\u002Ftext>\u003C\u002Fg>\u003C\u002Fg>\u003C\u002Fsvg>",[93,94,96],"h2",{"id":95},"arguments","Arguments",[98,99,100,113],"table",{},[101,102,103],"thead",{},[104,105,106,110],"tr",{},[107,108,109],"th",{},"Argument",[107,111,112],{},"What it does",[114,115,116],"tbody",{},[104,117,118,124],{},[119,120,121],"td",{},[13,122,123],{},"[id]",[119,125,126,127,131,132,29],{},"The ",[25,128,130],{"href":129},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands#ids","registry id",". Without it, you ",[25,133,135],{"href":134},"#add-search","pick an extension",[93,137,139],{"id":138},"add-search","Pick an extension",[10,141,142,143,145],{},"Without an id, ",[13,144,15],{}," lists the registry. Type to filter on the id, display name, and description. You cannot pick an installed extension.",[93,147,149],{"id":148},"add-preview","Preview and summary",[10,151,152],{},"Before it asks, the CLI shows the required plugins, the packages it installs, and the config lines it adds:",[31,154,158],{"language":155,"filename":156,"code":157,"class":36},"text","Output","◇ Plugin plugin-faker v5.3.2 · Generates a Faker.js mock-data factory for every schema in your…\n│ Needs plugin-ts ✓ installed\n│ Installs @kubb\u002Fplugin-faker@5.3.2\n│ Config kubb.config.ts\n│ + import { pluginFaker } from '@kubb\u002Fplugin-faker'\n│ + plugins: [pluginTs(), pluginFaker()],\n◆ Add it?",[13,159,161,57,166,57,171,57,176,57,181,57,186,57,191],{"class":160},"language-text",[41,162,163],{"class":43,"style":44},[41,164,165],{"style":51},"◇ Plugin plugin-faker v5.3.2 · Generates a Faker.js mock-data factory for every schema in your…",[41,167,168],{"class":43,"style":44},[41,169,170],{"style":51},"│ Needs plugin-ts ✓ installed",[41,172,173],{"class":43,"style":44},[41,174,175],{"style":51},"│ Installs @kubb\u002Fplugin-faker@5.3.2",[41,177,178],{"class":43,"style":44},[41,179,180],{"style":51},"│ Config kubb.config.ts",[41,182,183],{"class":43,"style":44},[41,184,185],{"style":51},"│ + import { pluginFaker } from '@kubb\u002Fplugin-faker'",[41,187,188],{"class":43,"style":44},[41,189,190],{"style":51},"│ + plugins: [pluginTs(), pluginFaker()],",[41,192,193],{"class":43,"style":44},[41,194,195],{"style":51},"◆ Add it?",[10,197,198,199,202,203,29],{},"After the install, the summary title gives the outcome. If it says ",[13,200,201],{},"Plugin needs configuration",", add the printed snippet to the config by hand. See ",[25,204,206],{"href":205},"#command-output","Command output",[93,208,210],{"id":209},"add-required-plugins","Required plugins",[10,212,213,214,217,218,220],{},"When the manifest lists ",[13,215,216],{},"dependencies"," that ",[13,219,19],{}," lacks, the CLI asks whether to add them too:",[98,222,223,233],{},[101,224,225],{},[104,226,227,230],{},[107,228,229],{},"Answer",[107,231,232],{},"Result",[114,234,235,249],{},[104,236,237,246],{},[119,238,239,242,243],{},[13,240,241],{},"Yes, add both"," or ",[13,244,245],{},"Yes, add all",[119,247,248],{},"Installs them and adds them next to the extension.",[104,250,251,256],{},[119,252,253],{},[13,254,255],{},"Only \u003Cname>",[119,257,258,259,262],{},"Adds the extension alone. ",[13,260,261],{},"kubb generate"," fails until you add the rest.",[10,264,265,268],{},[13,266,267],{},"--yes"," adds them.",[93,270,272],{"id":271},"add-config","Config changes",[98,274,275,285],{},[101,276,277],{},[104,278,279,282],{},[107,280,281],{},"Extension",[107,283,284],{},"Change",[114,286,287,299,324],{},[104,288,289,292],{},[119,290,291],{},"Plugin",[119,293,294,295,298],{},"Adds its import and a call at the end of the ",[13,296,297],{},"plugins"," array.",[104,300,301,304],{},[119,302,303],{},"Parser",[119,305,294,306,309,310,312,313,316,317,320,321,29],{},[13,307,308],{},"parsers"," array. Without ",[13,311,308],{},", it also writes the defaults ",[13,314,315],{},"parserTs()",", ",[13,318,319],{},"parserTsx()",", and ",[13,322,323],{},"parserMd()",[104,325,326,329],{},[119,327,328],{},"Adapter",[119,330,331,332,335],{},"Changes nothing. The CLI prints the import and the ",[13,333,334],{},"adapter"," line to add by hand.",[337,338,340,341,343,344,347,348,29],"blockquote",{"as":339},"warning","When the CLI cannot edit the config, such as when ",[13,342,297],{}," is not an array literal, it prints ",[13,345,346],{},"Could not edit \u003Cfile>: \u003Creason>"," and the snippet to add by hand, then exits with code 1. See ",[25,349,351],{"href":350},"#config-edits","Config edits",[93,353,355],{"id":354},"options","Options",[98,357,358,373],{},[101,359,360],{},[104,361,362,365,368,371],{},[107,363,364],{},"Flag",[107,366,367],{},"Alias",[107,369,370],{},"Default",[107,372,112],{},[114,374,375,392,411,425],{},[104,376,377,382,387,389],{},[119,378,379],{},[13,380,381],{},"--config \u003Cpath>",[119,383,384],{},[13,385,386],{},"-c",[119,388],{},[119,390,391],{},"Path to the Kubb config to edit.",[104,393,394,398,403,408],{},[119,395,396],{},[13,397,267],{},[119,399,400],{},[13,401,402],{},"-y",[119,404,405],{},[13,406,407],{},"false",[119,409,410],{},"Skip the confirmation and add the required plugins. Needs an id.",[104,412,413,418,420,422],{},[119,414,415],{},[13,416,417],{},"--no-install",[119,419],{},[119,421],{},[119,423,424],{},"Edit the config only. A plugin or parser is still added.",[104,426,427,432,434,438],{},[119,428,429],{},[13,430,431],{},"--dry-run",[119,433],{},[119,435,436],{},[13,437,407],{},[119,439,440],{},"Show what the command would install or write, then stop.",[337,442,444,445,447],{"as":443},"tip","Pass ",[13,446,267],{}," in scripts and CI, where no one can answer the prompt.",[93,449,451],{"id":450},"exit-codes","Exit codes",[98,453,454,464],{},[101,455,456],{},[104,457,458,461],{},[107,459,460],{},"Code",[107,462,463],{},"When",[114,465,466,476,488,497],{},[104,467,468,473],{},[119,469,470],{},[13,471,472],{},"0",[119,474,475],{},"The extension is added, or you canceled a prompt.",[104,477,478,483],{},[119,479,480],{},[13,481,482],{},"1",[119,484,485,486,29],{},"The id is invalid, unknown, or missing with ",[13,487,267],{},[104,489,490,494],{},[119,491,492],{},[13,493,482],{},[119,495,496],{},"The registry cannot be read, or the extension does not support your Kubb or Node.js version.",[104,498,499,503],{},[119,500,501],{},[13,502,482],{},[119,504,505],{},"No config is found for a plugin or parser, the install fails, or the config edit fails.",[93,507,509],{"id":508},"less-common-cases","Less common cases",[511,512,206],"h3",{"id":513},"command-output",[10,515,516,517,519],{},"After the install, the summary lists the packages, the added calls, the next step (",[13,518,261],{},"), and the extension's options page. Its title gives the outcome.",[98,521,522,531],{},[101,523,524],{},[104,525,526,529],{},[107,527,528],{},"Summary title",[107,530,463],{},[114,532,533,543,555,565,574],{},[104,534,535,540],{},[119,536,537],{},[13,538,539],{},"Plugin ready",[119,541,542],{},"Installed and added to the config.",[104,544,545,550],{},[119,546,547],{},[13,548,549],{},"Plugin configured",[119,551,552,553,29],{},"Added to the config with ",[13,554,417],{},[104,556,557,562],{},[119,558,559],{},[13,560,561],{},"Plugin already configured",[119,563,564],{},"The plugin was already in the config.",[104,566,567,571],{},[119,568,569],{},[13,570,201],{},[119,572,573],{},"Installed, but the config needs a manual change. The CLI prints the snippet.",[104,575,576,581],{},[119,577,578],{},[13,579,580],{},"Plugin configured; dependencies missing",[119,582,583],{},"Added without the required plugins you declined.",[10,585,586,587,589,590,592,593,595],{},"Adapters and parsers say ",[13,588,328],{}," and ",[13,591,303],{}," instead, except in ",[13,594,580],{},", which every kind uses.",[10,597,142,598,600,601,604],{},[13,599,15],{}," lists the registry. An installed extension shows ",[13,602,603],{},"installed"," and cannot be picked.",[511,606,351],{"id":607},"config-edits",[10,609,610,611,613,614,29],{},"When ",[13,612,15],{}," cannot write the extension into the config, it prints a snippet. Add its import and call to the config, then run ",[13,615,261],{},[617,618,619,623,632],"ul",{},[620,621,622],"li",{},"An extension already in its array is left alone.",[620,624,625,626,628,629,631],{},"The CLI cannot edit the config when ",[13,627,297],{}," is not an array literal, or the export name is already imported from another module. The CLI then prints ",[13,630,346],{}," and the snippet, and exits with code 1.",[620,633,634],{},"An adapter is never written, so its manual snippet does not set exit code 1.",{"title":636,"searchDepth":637,"depth":637,"links":638},"",5,[639,641,642,643,644,645,646,647],{"id":95,"depth":640,"text":96},2,{"id":138,"depth":640,"text":139},{"id":148,"depth":640,"text":149},{"id":209,"depth":640,"text":210},{"id":271,"depth":640,"text":272},{"id":354,"depth":640,"text":355},{"id":450,"depth":640,"text":451},{"id":508,"depth":640,"text":509,"children":648},[649,651],{"id":513,"depth":650,"text":206},3,{"id":607,"depth":650,"text":351},"The add command installs a plugin, adapter, or parser from the Kubb extension registry at its reviewed version and adds a plugin to kubb.config.ts.","md",{"layout":655,"title":5,"description":652,"outline":656,"order":657,"navigation":658},"doc",[640,650],4,{"title":15,"icon":659},"i-iconoir-plus-circle",{"layout":655,"outline":661},[640,650],{"title":15,"icon":659},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fadd",{"title":5,"description":652},{"loc":663},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fadd.md","docs\u002F5.x\u002Freference\u002Fcommands\u002Fadd","2RHDOkuXkffsjjSe-Z_xCIXsIjWbcuzZamLGujIFczk",1795727676678,"1b64b1eb-29b7-4f90-ad41-6f24721e1669"]