[{"data":1,"prerenderedAt":315},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Fhow-to\u002Finstallation":3},{"id":4,"title":5,"body":6,"description":296,"extension":297,"frontmatter":298,"heading":5,"meta":306,"navigation":308,"order":302,"path":309,"seo":310,"sitemap":311,"source":312,"stem":313,"__hash__":314},"docs\u002Fdocs\u002F5.x\u002Fhow-to\u002Finstallation.md","Install Kubb with npm, pnpm, Yarn, or Bun",{"type":7,"value":8,"toc":286},"minimark",[9,19,24,38,235,239,257,269],[10,11,12,13,18],"p",{},"Install Kubb in an existing project. To learn generation with a supplied specification and expected output, follow ",[14,15,17],"a",{"href":16},"\u002Fdocs\u002F5.x\u002Ftutorials\u002Fquickstart","Generate your first client"," instead.",[20,21,23],"h2",{"id":22},"prerequisites","Prerequisites",[25,26,27,35],"ul",{},[28,29,30,34],"li",{},[14,31,33],{"href":32},"https:\u002F\u002Fnodejs.org\u002F","Node.js"," 22.22 or higher.",[28,36,37],{},"TypeScript 5 or higher if you use a TypeScript config or import generated types.",[39,40,42,46,58,144,159,163,177,192,196,213,225],"steps",{"level":41},"2",[20,43,45],{"id":44},"install-kubb-and-your-plugins","Install Kubb and your plugins",[10,47,48,52,53,57],{},[49,50,51],"code",{},"kubb"," ships the CLI, the core runtime, the OpenAPI adapter, and the TypeScript, TSX, and Markdown parsers. Each output comes from its own plugin package, so install only the ",[14,54,56],{"href":55},"\u002Fextensions\u002Fkind\u002Fplugins","plugins"," you need. This example adds the TypeScript plugin:",[59,60,62,91,109,126],"code-group",{"sync":61},"package-manager",[63,64,69],"pre",{"language":65,"filename":66,"code":67,"class":68},"shell","pnpm","pnpm add -D kubb @kubb\u002Fplugin-ts typescript","highlights",[49,70,72],{"class":71},"language-shell",[73,74,77,81,85,88],"span",{"class":75,"style":76},"line","display: inline",[73,78,80],{"style":79},"color:#6f42c1;--hls-dark:#b392f0","pnpm ",[73,82,84],{"style":83},"color:#24292e;--hls-dark:#e1e4e8","add -D kubb ",[73,86,87],{"style":83},"@",[73,89,90],{"style":83},"kubb\u002Fplugin-ts typescript",[63,92,95],{"language":65,"filename":93,"code":94,"class":68},"npm","npm install -D kubb @kubb\u002Fplugin-ts typescript",[49,96,97],{"class":71},[73,98,99,102,105,107],{"class":75,"style":76},[73,100,101],{"style":79},"npm ",[73,103,104],{"style":83},"install -D kubb ",[73,106,87],{"style":83},[73,108,90],{"style":83},[63,110,113],{"language":65,"filename":111,"code":112,"class":68},"yarn","yarn add -D kubb @kubb\u002Fplugin-ts typescript",[49,114,115],{"class":71},[73,116,117,120,122,124],{"class":75,"style":76},[73,118,119],{"style":79},"yarn ",[73,121,84],{"style":83},[73,123,87],{"style":83},[73,125,90],{"style":83},[63,127,130],{"language":65,"filename":128,"code":129,"class":68},"bun","bun add -d kubb @kubb\u002Fplugin-ts typescript",[49,131,132],{"class":71},[73,133,134,137,140,142],{"class":75,"style":76},[73,135,136],{"style":79},"bun ",[73,138,139],{"style":83},"add -d kubb ",[73,141,87],{"style":83},[73,143,90],{"style":83},[10,145,146,147,150,151,154,155,158],{},"Install the runtime libraries your output needs too. An Axios client uses ",[49,148,149],{},"axios",", and React Query hooks use ",[49,152,153],{},"react"," and ",[49,156,157],{},"@tanstack\u002Freact-query",". Each plugin page lists its requirements.",[20,160,162],{"id":161},"verify-the-installation","Verify the installation",[63,164,167],{"language":65,"filename":165,"code":166,"class":68},"Terminal","npx kubb --version",[49,168,169],{"class":71},[73,170,171,174],{"class":75,"style":76},[73,172,173],{"style":79},"npx ",[73,175,176],{"style":83},"kubb --version",[10,178,179,180,183,184,187,188,191],{},"Use ",[49,181,182],{},"pnpm exec kubb",", ",[49,185,186],{},"yarn kubb",", or ",[49,189,190],{},"bunx kubb"," with the matching package manager.",[20,193,195],{"id":194},"create-a-config","Create a config",[10,197,198,199,203,204,207,208,212],{},"Run the ",[14,200,202],{"href":201},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Finit","initialization wizard"," to choose your specification, output directory, and plugins, or write ",[49,205,206],{},"kubb.config.ts"," yourself with one of the ",[14,209,211],{"href":210},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Frecipes","stacks",".",[63,214,216],{"language":65,"filename":165,"code":215,"class":68},"npx kubb init",[49,217,218],{"class":71},[73,219,220,222],{"class":75,"style":76},[73,221,173],{"style":79},[73,223,224],{"style":83},"kubb init",[10,226,227,228,231,232,212],{},"Then run ",[49,229,230],{},"npx kubb generate",". Kubb writes the generated files to ",[49,233,234],{},"output.path",[20,236,238],{"id":237},"add-plugins-later","Add plugins later",[10,240,241,242,248,249,253,254,256],{},"Once the config exists, ",[14,243,245],{"href":244},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fadd",[49,246,247],{},"kubb add"," installs a plugin at the version the ",[14,250,252],{"href":251},"\u002Fdocs\u002F5.x\u002Freference\u002Fregistry","Kubb registry"," pins and adds it to ",[49,255,206],{},":",[63,258,260],{"language":65,"filename":165,"code":259,"class":68},"npx kubb add plugin-zod",[49,261,262],{"class":71},[73,263,264,266],{"class":75,"style":76},[73,265,173],{"style":79},[73,267,268],{"style":83},"kubb add plugin-zod",[10,270,271,272,278,279,285],{},"Run ",[14,273,275],{"href":274},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Flist",[49,276,277],{},"kubb list"," to see your extensions and ",[14,280,282],{"href":281},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fupdate",[49,283,284],{},"kubb update"," to move them to the pinned versions.",{"title":287,"searchDepth":288,"depth":288,"links":289},"",5,[290,292,293,294,295],{"id":22,"depth":291,"text":23},2,{"id":44,"depth":291,"text":45},{"id":161,"depth":291,"text":162},{"id":194,"depth":291,"text":195},{"id":237,"depth":291,"text":238},"Install the Kubb CLI and the plugins your output needs with npm, pnpm, Yarn, or Bun, verify the version, and create the kubb.config.ts for your API spec.","md",{"layout":299,"title":5,"description":296,"outline":300,"order":302,"navigation":303},"doc",[291,301],3,1,{"title":304,"icon":305},"Installation","i-iconoir-download",{"layout":299,"outline":307},[291,301],{"title":304,"icon":305},"\u002Fdocs\u002F5.x\u002Fhow-to\u002Finstallation",{"title":5,"description":296},{"loc":309},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Fhow-to\u002Finstallation.md","docs\u002F5.x\u002Fhow-to\u002Finstallation","n0K6WTPAA_J_RVpAklQuUTtqFjJtGYGeGUIEqlIK1oI",1793288238304]