[{"data":1,"prerenderedAt":1043},["ShallowReactive",2],{"page:\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fstudio":3},{"id":4,"title":5,"body":6,"description":1026,"extension":1027,"frontmatter":1028,"heading":5,"meta":1033,"navigation":1035,"order":1012,"path":1036,"seo":1037,"sitemap":1038,"source":1039,"stem":1040,"__hash__":1041,"hasPopups":1042},"docs\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fstudio.md","kubb studio",{"type":7,"value":8,"toc":1010},"minimark",[9,31,36,51,62,84,88,94,187,191,204,227,240,260,264,600,620,629,643,646,650,714,717,721,774,818,822,844,849,855,864,868,880,920,933,950,964,998],[10,11,12,13,16,17,22,23,26,27,30],"p",{},"Run ",[14,15,5],"code",{}," to connect a project to ",[18,19,21],"a",{"href":20},"https:\u002F\u002Fkubb.studio","Kubb Studio",". The CLI runs generation on your machine and sends progress and generated file paths to Studio. Grant ",[14,24,25],{},"--allow-read"," to view generated file contents and diffs in the browser, and ",[14,28,29],{},"--allow-read-ast"," to share the parsed spec.",[32,33,35],"h2",{"id":34},"usage","Usage",[10,37,38,39,42,43,46,47,50],{},"Connect the current project. On the first run, open the pairing page and approve the code the CLI shows before it expires. The CLI copies the code to the clipboard when ",[14,40,41],{},"pbcopy",", ",[14,44,45],{},"xclip",", or ",[14,48,49],{},"clip.exe"," is available. It then asks which permissions to grant for this project in one list, with the two read permissions checked.",[10,52,53,54,57,58,61],{},"While connected, the CLI logs each job Studio runs on one line: the time, the command, who asked for it, and the result. The job's own steps and diagnostics stay in Studio. Press ",[14,55,56],{},"b"," to move the session to the background worker, the same as ",[14,59,60],{},"kubb studio start",".",[63,64,68],"pre",{"language":65,"filename":66,"code":5,"class":67},"shell","Terminal","shiki shiki-themes github-light github-dark dark:github-dark",[14,69,71],{"class":70},"language-shell",[72,73,76,80],"span",{"class":74,"style":75},"line","display: inline",[72,77,79],{"style":78},"color:#6F42C1;--shiki-dark:#B392F0","kubb",[72,81,83],{"style":82},"color:#032F62;--shiki-dark:#9ECBFF"," studio",[32,85,87],{"id":86},"actions","Actions",[10,89,90,91,61],{},"The positional argument selects the action. It defaults to ",[14,92,93],{},"connect",[95,96,97,110],"table",{},[98,99,100],"thead",{},[101,102,103,107],"tr",{},[104,105,106],"th",{},"Action",[104,108,109],{},"Description",[111,112,113,123,133,143,153,163,173],"tbody",{},[101,114,115,120],{},[116,117,118],"td",{},[14,119,93],{},[116,121,122],{},"Hold a foreground session open and generate on request.",[101,124,125,130],{},[116,126,127],{},[14,128,129],{},"start",[116,131,132],{},"Resolve pairing and permissions, then connect this project in the background.",[101,134,135,140],{},[116,136,137],{},[14,138,139],{},"stop",[116,141,142],{},"Stop the background worker and keep its pairing.",[101,144,145,150],{},[116,146,147],{},[14,148,149],{},"login",[116,151,152],{},"Pair this machine again without opening a generation session. Saved permissions reset.",[101,154,155,160],{},[116,156,157],{},[14,158,159],{},"logout",[116,161,162],{},"Stop the background worker and forget this project's stored token.",[101,164,165,170],{},[116,166,167],{},[14,168,169],{},"status",[116,171,172],{},"Show pairing, worker state and uptime, saved permissions, and the log path, each with the command that changes it.",[101,174,175,180],{},[116,176,177],{},[14,178,179],{},"snapshot",[116,181,182,183,61],{},"Generate and pack a snapshot on this machine, upload it in one request, then exit. See ",[18,184,186],{"href":185},"\u002Fdocs\u002F5.x\u002Fintegrations\u002Fci","Publish snapshots from CI",[32,188,190],{"id":189},"background-connection","Background connection",[10,192,12,193,42,195,197,198,200,201,203],{},[14,194,129],{},[14,196,169],{},", and ",[14,199,139],{}," from the same project directory. ",[14,202,129],{}," resolves pairing and permission prompts before detaching, then returns while the worker connects.",[10,205,206,208,209,42,212,42,215,42,218,46,221,224,225,61],{},[14,207,169],{}," reports ",[14,210,211],{},"starting",[14,213,214],{},"connected",[14,216,217],{},"reconnecting",[14,219,220],{},"authentication required",[14,222,223],{},"stopped",". Only one worker can own a project. Stop it before using foreground ",[14,226,93],{},[10,228,229,230,233,234,236,237,239],{},"The worker survives terminal closure and retries temporary connection failures. Restart it after a crash or reboot. If its token is rejected, run ",[14,231,232],{},"kubb studio login",", then ",[14,235,60],{},". To change its URL or config, stop it and start it with the new flags. Flags can only add permissions. ",[14,238,149],{}," resets the saved ones.",[10,241,242,243,246,247,250,251,253,254,256,257,259],{},"The CLI keeps credentials, worker state, and the worker log in ",[14,244,245],{},"KUBB_HOME",", which defaults to ",[14,248,249],{},"~\u002F.kubb",". ",[14,252,169],{}," prints the log path. ",[14,255,139],{}," waits for a running generation to clean up, and ",[14,258,159],{}," stops the worker before it removes credentials. An interrupted job does not run again.",[32,261,263],{"id":262},"options","Options",[95,265,266,278],{},[98,267,268],{},[101,269,270,273,276],{},[104,271,272],{},"Option",[104,274,275],{},"Default",[104,277,109],{},[111,279,280,298,325,339,352,366,384,405,423,454,471,483,501,518,532,550,568,584],{},[101,281,282,290,292],{},[116,283,284,42,287],{},[14,285,286],{},"--config=\u003Cpath>",[14,288,289],{},"-c \u003Cpath>",[116,291],{},[116,293,294,295,61],{},"Path to a config file, such as ",[14,296,297],{},".\u002Fkubb.staging.ts",[101,299,300,305,309],{},[116,301,302],{},[14,303,304],{},"--url=\u003Curl>",[116,306,307],{},[14,308,20],{},[116,310,311,312,315,316,42,319,46,322,61],{},"URL for Kubb Studio. Plain ",[14,313,314],{},"http:\u002F\u002F"," works only for ",[14,317,318],{},"localhost",[14,320,321],{},"127.0.0.1",[14,323,324],{},"[::1]",[101,326,327,331,336],{},[116,328,329],{},[14,330,25],{},[116,332,333],{},[14,334,335],{},"false",[116,337,338],{},"Let Studio read generated file contents. Asked once per project when omitted.",[101,340,341,345,349],{},[116,342,343],{},[14,344,29],{},[116,346,347],{},[14,348,335],{},[116,350,351],{},"Let Studio read the parsed spec (the Kubb AST). Asked once per project when omitted.",[101,353,354,359,363],{},[116,355,356],{},[14,357,358],{},"--allow-write",[116,360,361],{},[14,362,335],{},[116,364,365],{},"Write generated files to disk. Asked once per project when omitted.",[101,367,368,373,377],{},[116,369,370],{},[14,371,372],{},"--allow-config-edit",[116,374,375],{},[14,376,335],{},[116,378,379,380,383],{},"Let Studio change plugin options in ",[14,381,382],{},"kubb.config.ts",". Asked once per project.",[101,385,386,391,395],{},[116,387,388],{},[14,389,390],{},"--allow-install",[116,392,393],{},[14,394,335],{},[116,396,397,398,401,402,404],{},"Let Studio install extensions from the registry with ",[14,399,400],{},"kubb add",", which also edits the config, so grant ",[14,403,372],{}," too. Asked once per project.",[101,406,407,412,416],{},[116,408,409],{},[14,410,411],{},"--allow-update",[116,413,414],{},[14,415,335],{},[116,417,418,419,422],{},"Let Studio update installed extensions with ",[14,420,421],{},"kubb update",". It leaves the config alone. Asked once per project.",[101,424,425,430,434],{},[116,426,427],{},[14,428,429],{},"--allow-save-input",[116,431,432],{},[14,433,335],{},[116,435,436,437,46,440,443,444,447,448,451,452,404],{},"Let Studio save the spec it sends: a pasted document goes to ",[14,438,439],{},"openapi.yaml",[14,441,442],{},"openapi.json"," when it is JSON (",[14,445,446],{},"openapi-\u003Centry>"," for a later config entry), and ",[14,449,450],{},"input"," in the config points to it, a URL, or a git file. Grant ",[14,453,372],{},[101,455,456,461,465],{},[116,457,458],{},[14,459,460],{},"--allow-exec",[116,462,463],{},[14,464,335],{},[116,466,467,468,383],{},"Run the formatter, the linter, and ",[14,469,470],{},"output.postGenerate",[101,472,473,478,480],{},[116,474,475],{},[14,476,477],{},"--no-open",[116,479],{},[116,481,482],{},"Do not open the approval page in a browser.",[101,484,485,493,498],{},[116,486,487,42,490],{},[14,488,489],{},"--log-level=\u003Csilent|info|verbose>",[14,491,492],{},"-l",[116,494,495],{},[14,496,497],{},"info",[116,499,500],{},"Set the verbosity.",[101,502,503,508,510],{},[116,504,505],{},[14,506,507],{},"--token=\u003Ckey>",[116,509],{},[116,511,512,514,515,61],{},[14,513,179],{}," only: organization CI API key. Defaults to ",[14,516,517],{},"KUBB_TOKEN",[101,519,520,525,527],{},[116,521,522],{},[14,523,524],{},"--id=\u003Cid>",[116,526],{},[116,528,529,531],{},[14,530,179],{}," only: stable identity for the CI agent. Auto-detected on GitHub Actions, GitLab CI, Bitbucket Pipelines and CircleCI.",[101,533,534,539,541],{},[116,535,536],{},[14,537,538],{},"--base-id=\u003Cid>",[116,540],{},[116,542,543,545,546,549],{},[14,544,179],{}," only: the ",[14,547,548],{},"--id"," of another CI agent, such as the base branch's, to also compare with. Auto-detected on GitHub pull requests and GitLab merge requests.",[101,551,552,557,559],{},[116,553,554],{},[14,555,556],{},"--name=\u003Cname>",[116,558],{},[116,560,561,563,564,567],{},[14,562,179],{}," only: package name for the tarball. Defaults to the name in the nearest ",[14,565,566],{},"package.json"," that has a name and a version.",[101,569,570,575,577],{},[116,571,572],{},[14,573,574],{},"--package-version=\u003Cversion>",[116,576],{},[116,578,579,581,582,567],{},[14,580,179],{}," only: package version for the tarball. Defaults to the version in the nearest ",[14,583,566],{},[101,585,586,591,595],{},[116,587,588],{},[14,589,590],{},"--json",[116,592,593],{},[14,594,335],{},[116,596,597,599],{},[14,598,179],{}," only: print the result as one JSON object instead of a summary.",[10,601,602,604,605,608,609,612,613,616,617,619],{},[14,603,179],{}," takes no ",[14,606,607],{},"--allow-*"," flag. It generates like ",[14,610,611],{},"kubb generate",": it writes to ",[14,614,615],{},"output.path",", then runs the formatter, the linter, and ",[14,618,470],{},". It refuses a tarball over 50 MB.",[10,621,622,623,625,626,628],{},"Without ",[14,624,25],{},", a session still generates and reports file paths, but Studio cannot display their contents. The CLI asks about permissions not supplied as flags and remembers answers per project directory. Without a TTY it skips the permission prompts, so pass the flags the run needs. In CI it also refuses to pair and needs stored credentials, so use ",[14,627,179],{}," there instead.",[10,630,631,632,634,635,637,638,642],{},"With ",[14,633,25],{},", Studio loads the files already in ",[14,636,615],{}," when it connects. You can browse them before generating. Select ",[639,640,641],"strong",{},"Generate"," when you want to regenerate the output.",[10,644,645],{},"Each action exits with code 1 when it fails.",[32,647,649],{"id":648},"environment-variables","Environment variables",[95,651,652,661],{},[98,653,654],{},[101,655,656,659],{},[104,657,658],{},"Variable",[104,660,109],{},[111,662,663,674,688,701],{},[101,664,665,669],{},[116,666,667],{},[14,668,245],{},[116,670,671,672,61],{},"Directory the CLI keeps its Studio state in. Defaults to ",[14,673,249],{},[101,675,676,680],{},[116,677,678],{},[14,679,517],{},[116,681,682,684,685,61],{},[14,683,179],{}," only: organization CI API key. Same as ",[14,686,687],{},"--token",[101,689,690,695],{},[116,691,692],{},[14,693,694],{},"KUBB_AGENT_MAX_GENERATIONS",[116,696,697,698,61],{},"How many recent generations the agent keeps for Studio to read. Defaults to ",[14,699,700],{},"8",[101,702,703,708],{},[116,704,705],{},[14,706,707],{},"KUBB_AGENT_MAX_GENERATIONS_MB",[116,709,710,711,61],{},"Size cap in MB for the kept generations. Defaults to ",[14,712,713],{},"100",[10,715,716],{},"Initial disk output has a separate retention budget with the same count and size caps as generated runs. Unchanged output reuses its retained ID across reconnects.",[32,718,720],{"id":719},"snapshot-output","Snapshot output",[10,722,723,725,726,42,729,42,732,42,735,42,738,42,741,42,744,197,747,750,751,754,755,758,759,762,763,754,766,769,770,773],{},[14,724,590],{}," prints one JSON object with ",[14,727,728],{},"id",[14,730,731],{},"name",[14,733,734],{},"version",[14,736,737],{},"integrity",[14,739,740],{},"url",[14,742,743],{},"snapshotIdUrl",[14,745,746],{},"expiresAt",[14,748,749],{},"agentUrl",". It also includes ",[14,752,753],{},"number"," and ",[14,756,757],{},"webUrl"," when Studio sends them, and the summary then shows the snapshot number and a ",[14,760,761],{},"View"," link. It also includes ",[14,764,765],{},"changes",[14,767,768],{},"branchChanges"," when comparisons are available. Installing a snapshot requires a separate ",[14,771,772],{},"registry"," API key.",[95,775,776,786],{},[98,777,778],{},[101,779,780,783],{},[104,781,782],{},"JSON field",[104,784,785],{},"Compared with",[111,787,788,797],{},[101,789,790,794],{},[116,791,792],{},[14,793,765],{},[116,795,796],{},"The previous snapshot on the same pull request or branch.",[101,798,799,803],{},[116,800,801],{},[14,802,768],{},[116,804,805,806,809,810,813,814,817],{},"The latest snapshot of the agent named by ",[14,807,808],{},"--base-id",", or of the base branch detected on a GitHub pull request or GitLab merge request. Its ",[14,811,812],{},"branch"," field names that agent. Its ",[14,815,816],{},"baseFound"," field distinguishes a branch with no CI agent from one with an agent that has no snapshot of this package yet.",[32,819,821],{"id":820},"ci-agent-identity","CI agent identity",[10,823,824,826,827,829,830,832,833,835,836,838,839,841,842,61],{},[14,825,179],{}," detects GitHub Actions, GitLab CI, Bitbucket Pipelines, and CircleCI. Other providers require a stable ",[14,828,548],{},". Use a stable ",[14,831,548],{}," on the base branch and pass that identity as ",[14,834,808],{}," on pull request runs. Passing ",[14,837,548],{}," turns off base detection, so also pass ",[14,840,808],{}," to get ",[14,843,768],{},[845,846,848],"h3",{"id":847},"gitlab-ci","GitLab CI",[10,850,851,852,854],{},"Every pipeline on a merge request publishes to one CI agent. A branch pipeline publishes to one agent per branch, so the default branch has one agent too. Pass ",[14,853,548],{}," to group runs your own way.",[10,856,857,858,860,861,863],{},"A merge request pipeline compares with its target branch. The snapshot reports which generated files changed against that branch's latest snapshot in ",[14,859,768],{},", and against the merge request's previous pipeline in ",[14,862,765],{},". The commit it records is the head of the source branch.",[32,865,867],{"id":866},"plugins-in-studio","Plugins in Studio",[10,869,870,871,875,876,879],{},"Studio builds its plugin list and option forms from ",[18,872,874],{"href":873},"\u002Fdocs\u002F5.x\u002Freference\u002Fkit\u002Fmanifest","extension manifests",". When Studio connects, the agent reports each extension that is installed in the project, ships a valid ",[14,877,878],{},"kubb-extension.json",", and comes from one of these places:",[881,882,883,896,902],"ul",{},[884,885,886,887,754,890,893,894,61],"li",{},"The ",[14,888,889],{},"dependencies",[14,891,892],{},"devDependencies"," in the project's ",[14,895,566],{},[884,897,898,899,901],{},"The packages ",[14,900,382],{}," imports.",[884,903,904,905,907,908,42,911,42,914,197,917,61],{},"The extensions that ship with ",[14,906,79],{},": ",[14,909,910],{},"@kubb\u002Fadapter-oas",[14,912,913],{},"@kubb\u002Fparser-ts",[14,915,916],{},"@kubb\u002Fparser-md",[14,918,919],{},"@kubb\u002Fplugin-barrel",[10,921,922,923,926,927,932],{},"A third-party plugin works in Studio once it is installed in the project and ships a manifest with ",[14,924,925],{},"kind: \"plugin\"",". It needs no registry entry. Install it with ",[18,928,930],{"href":929},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fadd",[14,931,400],{}," or your package manager, then reconnect so Studio sees it.",[10,934,935,936,938,939,941,942,945,946,949],{},"The adapter and the parsers the config registers get a settings form the same way, from the ",[14,937,262],{}," in their manifest. The agent reports them on connect with a JSON copy of their options, and the edits Studio sends on generate are merged over the options in ",[14,940,382],{},". A ",[14,943,944],{},"null"," value unsets an option for that run, so the extension's default applies. An extension without a manifest, such as ",[14,947,948],{},"parserTsx",", is listed without fields.",[10,951,952,953,956,957,959,960,963],{},"The agent imports a plugin package only when it is a ",[14,954,955],{},"@kubb\u002Fplugin-*"," package, or an installed package whose manifest has ",[14,958,925],{},". It calls the factory the manifest names in ",[14,961,962],{},"export",". The agent refuses any other package name before it imports anything, and config edits follow the same rule.",[95,965,966,976],{},[98,967,968],{},[101,969,970,973],{},[104,971,972],{},"Agent",[104,974,975],{},"Plugins it can run",[111,977,978,990],{},[101,979,980,985],{},[116,981,982,984],{},[14,983,5],{}," on your machine",[116,986,987,989],{},[14,988,955],{}," packages and plugins installed in the project that ship a manifest.",[101,991,992,995],{},[116,993,994],{},"Docker agent and hosted sandbox",[116,996,997],{},"Only the packages installed in their image. They install nothing at runtime.",[10,999,1000,1001,1005,1006,1009],{},"Studio also lists plugins from the ",[18,1002,1004],{"href":1003},"\u002Fdocs\u002F5.x\u002Freference\u002Fregistry","kubb.dev registry",". A plugin that the agent cannot run shows as not installed, with a ",[14,1007,1008],{},"kubb add \u003Cid>"," hint to install it.",{"title":1011,"searchDepth":1012,"depth":1012,"links":1013},"",5,[1014,1016,1017,1018,1019,1020,1021,1025],{"id":34,"depth":1015,"text":35},2,{"id":86,"depth":1015,"text":87},{"id":189,"depth":1015,"text":190},{"id":262,"depth":1015,"text":263},{"id":648,"depth":1015,"text":649},{"id":719,"depth":1015,"text":720},{"id":820,"depth":1015,"text":821,"children":1022},[1023],{"id":847,"depth":1024,"text":848},3,{"id":866,"depth":1015,"text":867},"Command reference for connecting a project to Kubb Studio, managing pairing and permissions, and publishing CI snapshots.","md",{"layout":1029,"title":5,"description":1026,"outline":1030,"order":1012,"navigation":1031},"doc",[1015,1024],{"title":5,"icon":1032},"i-iconoir-cube",{"layout":1029,"outline":1034},[1015,1024],{"title":5,"icon":1032},"\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fstudio",{"title":5,"description":1026},{"loc":1036},"kubb-labs\u002Fkubb\u002Fdocs\u002F5.x\u002Freference\u002Fcommands\u002Fstudio.md","docs\u002F5.x\u002Freference\u002Fcommands\u002Fstudio","PoTjyDaGJKc1ao10f4zkDbq9Eb8OdOztA8SsYdx4baU",false,1792782248808]