[{"data":1,"prerenderedAt":629},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fv2\u002Fextending\u002Fextensions":3},{"id":4,"title":5,"body":6,"description":16,"extension":622,"meta":623,"navigation":624,"path":625,"seo":626,"stem":627,"__hash__":628},"docs\u002Fdocs\u002Fv2\u002Fextending\u002Fextensions.md","Extensions",{"type":7,"value":8,"toc":612},"minimark",[9,13,17,25,91,96,115,121,195,207,216,220,275,282,336,343,346,386,389,394,397,401,415,422,459,462,477,481,484,490,494,576,586,590,600,608],[10,11,5],"h1",{"id":12},"extensions",[14,15,16],"p",{},"An extension is your config, packaged so someone else can install it.",[14,18,19,20,24],{},"That is the whole idea, and it is meant literally: same files, same globals, same way of\nwriting them. If you have written a ",[21,22,23],"code",{},"main.ts"," you have already written an extension —\npublishing it is giving it a name.",[26,27,32],"pre",{"className":28,"code":29,"language":30,"meta":31,"style":31},"language-bash shiki shiki-themes dark-plus","my-extension\u002F\n├── main.ts               # commands, keys, palettes — exactly as in your profile\n├── plugins\u002F              # lifecycle hooks — exactly as in your profile\n├── extension.config.ts   # marks the directory as an extension\n└── package.json          # name, version, description\n","bash","",[21,33,34,43,57,68,79],{"__ignoreMap":31},[35,36,39],"span",{"class":37,"line":38},"line",1,[35,40,42],{"class":41},"sCudf","my-extension\u002F\n",[35,44,46,49,53],{"class":37,"line":45},2,[35,47,48],{"class":41},"├──",[35,50,52],{"class":51},"sKc5r"," main.ts",[35,54,56],{"class":55},"sOLPB","               # commands, keys, palettes — exactly as in your profile\n",[35,58,60,62,65],{"class":37,"line":59},3,[35,61,48],{"class":41},[35,63,64],{"class":51}," plugins\u002F",[35,66,67],{"class":55},"              # lifecycle hooks — exactly as in your profile\n",[35,69,71,73,76],{"class":37,"line":70},4,[35,72,48],{"class":41},[35,74,75],{"class":51}," extension.config.ts",[35,77,78],{"class":55},"   # marks the directory as an extension\n",[35,80,82,85,88],{"class":37,"line":81},5,[35,83,84],{"class":41},"└──",[35,86,87],{"class":51}," package.json",[35,89,90],{"class":55},"          # name, version, description\n",[92,93,95],"h2",{"id":94},"creating-one","Creating one",[26,97,99],{"className":28,"code":98,"language":30,"meta":31,"style":31},"axon ext init @you\u002Fmy-extension\n",[21,100,101],{"__ignoreMap":31},[35,102,103,106,109,112],{"class":37,"line":38},[35,104,105],{"class":41},"axon",[35,107,108],{"class":51}," ext",[35,110,111],{"class":51}," init",[35,113,114],{"class":51}," @you\u002Fmy-extension\n",[14,116,117,118,120],{},"Scaffolds the layout above, ready to run. ",[21,119,23],{}," registers at module scope, the same\nas a profile's:",[26,122,126],{"className":123,"code":124,"language":125,"meta":31,"style":31},"language-ts shiki shiki-themes dark-plus","commands.register(\"mine\", async () => {\n    tui.info(\"hello from my extension\")\n}, { description: \"An example command\" })\n","ts",[21,127,128,163,181],{"__ignoreMap":31},[35,129,130,134,138,141,144,147,150,154,157,160],{"class":37,"line":38},[35,131,133],{"class":132},"s3F5K","commands",[35,135,137],{"class":136},"sTNBD",".",[35,139,140],{"class":41},"register",[35,142,143],{"class":136},"(",[35,145,146],{"class":51},"\"mine\"",[35,148,149],{"class":136},", ",[35,151,153],{"class":152},"scz_3","async",[35,155,156],{"class":136}," () ",[35,158,159],{"class":152},"=>",[35,161,162],{"class":136}," {\n",[35,164,165,168,170,173,175,178],{"class":37,"line":45},[35,166,167],{"class":132},"    tui",[35,169,137],{"class":136},[35,171,172],{"class":41},"info",[35,174,143],{"class":136},[35,176,177],{"class":51},"\"hello from my extension\"",[35,179,180],{"class":136},")\n",[35,182,183,186,189,192],{"class":37,"line":59},[35,184,185],{"class":136},"}, { ",[35,187,188],{"class":132},"description:",[35,190,191],{"class":51}," \"An example command\"",[35,193,194],{"class":136}," })\n",[14,196,197,198,201,202,206],{},"There is no ",[21,199,200],{},"setup()"," function and no default export to call. Importing the file ",[203,204,205],"strong",{},"is","\nloading it.",[14,208,209,212,213,215],{},[21,210,211],{},"extension.config.ts"," is empty on purpose. It marks the directory as an extension —\n",[21,214,23],{}," cannot do that job, since a profile has one too — and it is where declarative\nper-extension options will land if they are ever needed.",[92,217,219],{"id":218},"installing","Installing",[26,221,223],{"className":28,"code":222,"language":30,"meta":31,"style":31},"axon ext install @axon\u002Fvim        # from the registry\naxon ext install .\u002Fextensions\u002Fmine # a local directory\naxon ext list\naxon ext uninstall @axon\u002Fvim\n",[21,224,225,240,254,263],{"__ignoreMap":31},[35,226,227,229,231,234,237],{"class":37,"line":38},[35,228,105],{"class":41},[35,230,108],{"class":51},[35,232,233],{"class":51}," install",[35,235,236],{"class":51}," @axon\u002Fvim",[35,238,239],{"class":55},"        # from the registry\n",[35,241,242,244,246,248,251],{"class":37,"line":45},[35,243,105],{"class":41},[35,245,108],{"class":51},[35,247,233],{"class":51},[35,249,250],{"class":51}," .\u002Fextensions\u002Fmine",[35,252,253],{"class":55}," # a local directory\n",[35,255,256,258,260],{"class":37,"line":59},[35,257,105],{"class":41},[35,259,108],{"class":51},[35,261,262],{"class":51}," list\n",[35,264,265,267,269,272],{"class":37,"line":70},[35,266,105],{"class":41},[35,268,108],{"class":51},[35,270,271],{"class":51}," uninstall",[35,273,274],{"class":51}," @axon\u002Fvim\n",[14,276,277,278,281],{},"Installing does two things: fetches the extension, then records it in\n",[21,279,280],{},"profile.config.ts",". In that order — a config naming something that is not on disk would\nreport an error on every launch.",[26,283,285],{"className":123,"code":284,"language":125,"meta":31,"style":31},"export default defineProfile({\n    extensions: [\n        \"@axon\u002Fvim\",\n        \".\u002Fextensions\u002Fmine\",\n    ],\n})\n",[21,286,287,302,310,318,325,330],{"__ignoreMap":31},[35,288,289,293,296,299],{"class":37,"line":38},[35,290,292],{"class":291},"sYbnZ","export",[35,294,295],{"class":291}," default",[35,297,298],{"class":41}," defineProfile",[35,300,301],{"class":136},"({\n",[35,303,304,307],{"class":37,"line":45},[35,305,306],{"class":132},"    extensions:",[35,308,309],{"class":136}," [\n",[35,311,312,315],{"class":37,"line":59},[35,313,314],{"class":51},"        \"@axon\u002Fvim\"",[35,316,317],{"class":136},",\n",[35,319,320,323],{"class":37,"line":70},[35,321,322],{"class":51},"        \".\u002Fextensions\u002Fmine\"",[35,324,317],{"class":136},[35,326,327],{"class":37,"line":81},[35,328,329],{"class":136},"    ],\n",[35,331,333],{"class":37,"line":332},6,[35,334,335],{"class":136},"})\n",[14,337,338,339,342],{},"You can edit this file by hand. The array is ",[203,340,341],{},"load order",", and load order decides which\nof two extensions wins a name collision — so moving an entry up gives it precedence.",[14,344,345],{},"Disable one without losing the entry:",[26,347,349],{"className":123,"code":348,"language":125,"meta":31,"style":31},"extensions: [\n    { source: \"@axon\u002Fvim\", enabled: false },\n]\n",[21,350,351,359,381],{"__ignoreMap":31},[35,352,353,356],{"class":37,"line":38},[35,354,12],{"class":355},"sqDPy",[35,357,358],{"class":136},": [\n",[35,360,361,364,367,370,372,375,378],{"class":37,"line":45},[35,362,363],{"class":136},"    { ",[35,365,366],{"class":132},"source:",[35,368,369],{"class":51}," \"@axon\u002Fvim\"",[35,371,149],{"class":136},[35,373,374],{"class":132},"enabled:",[35,376,377],{"class":152}," false",[35,379,380],{"class":136}," },\n",[35,382,383],{"class":37,"line":59},[35,384,385],{"class":136},"]\n",[14,387,388],{},"Uninstalling removes the config entry and leaves the files. The directory may be one you\nare writing, and deleting source is not recoverable.",[390,391,393],"h3",{"id":392},"boot-installs-what-is-missing","Boot installs what is missing",[14,395,396],{},"Axon fetches anything your config declares but your machine does not have. Clone your\ndotfiles onto a new machine, launch Axon, and your extensions arrive on their own.",[92,398,400],{"id":399},"publishing","Publishing",[26,402,404],{"className":28,"code":403,"language":30,"meta":31,"style":31},"axon ext publish\n",[21,405,406],{"__ignoreMap":31},[35,407,408,410,412],{"class":37,"line":38},[35,409,105],{"class":41},[35,411,108],{"class":51},[35,413,414],{"class":51}," publish\n",[14,416,417,418,421],{},"Extensions publish to the same registry as agents, modules, cognets and prompts, into the\nsame namespace. Names are scoped — ",[21,419,420],{},"@you\u002Fname"," — and versions are immutable.",[26,423,425],{"className":28,"code":424,"language":30,"meta":31,"style":31},"axon ext init @you\u002Fgit-tools\ncd git-tools\n# ... write main.ts\naxon ext publish\n",[21,426,427,438,446,451],{"__ignoreMap":31},[35,428,429,431,433,435],{"class":37,"line":38},[35,430,105],{"class":41},[35,432,108],{"class":51},[35,434,111],{"class":51},[35,436,437],{"class":51}," @you\u002Fgit-tools\n",[35,439,440,443],{"class":37,"line":45},[35,441,442],{"class":41},"cd",[35,444,445],{"class":51}," git-tools\n",[35,447,448],{"class":37,"line":59},[35,449,450],{"class":55},"# ... write main.ts\n",[35,452,453,455,457],{"class":37,"line":70},[35,454,105],{"class":41},[35,456,108],{"class":51},[35,458,414],{"class":51},[14,460,461],{},"Anyone can then install it:",[26,463,465],{"className":28,"code":464,"language":30,"meta":31,"style":31},"axon ext install @you\u002Fgit-tools\n",[21,466,467],{"__ignoreMap":31},[35,468,469,471,473,475],{"class":37,"line":38},[35,470,105],{"class":41},[35,472,108],{"class":51},[35,474,233],{"class":51},[35,476,437],{"class":51},[92,478,480],{"id":479},"what-an-extension-may-do","What an extension may do",[14,482,483],{},"Everything your own config can, and nothing more — the same seven globals, the same\nboundaries.",[14,485,486,487,489],{},"Worth stating plainly, because an extension runs on someone else's machine: it can drive\nconversations, register commands, bind keys and read your agent list. It cannot read what\na model produced, and it cannot take a key the terminal needs. Built-ins always win a\ncollision, and so does the installing user's own ",[21,488,23],{},", which loads first.",[92,491,493],{"id":492},"reference","Reference",[495,496,497,510],"table",{},[498,499,500],"thead",{},[501,502,503,507],"tr",{},[504,505,506],"th",{},"Command",[504,508,509],{},"What it does",[511,512,513,524,534,544,556,566],"tbody",{},[501,514,515,521],{},[516,517,518],"td",{},[21,519,520],{},"axon ext init \u003Cname>",[516,522,523],{},"Scaffold a new extension",[501,525,526,531],{},[516,527,528],{},[21,529,530],{},"axon ext prepare",[516,532,533],{},"Install dependencies and regenerate types",[501,535,536,541],{},[516,537,538],{},[21,539,540],{},"axon ext publish",[516,542,543],{},"Publish to the registry",[501,545,546,551],{},[516,547,548],{},[21,549,550],{},"axon ext install \u003Csource>",[516,552,553,554],{},"Install and record in ",[21,555,280],{},[501,557,558,563],{},[516,559,560],{},[21,561,562],{},"axon ext uninstall \u003Csource>",[516,564,565],{},"Stop loading it; files stay",[501,567,568,573],{},[516,569,570],{},[21,571,572],{},"axon ext list",[516,574,575],{},"What your profile declares, in load order",[14,577,578,581,582,585],{},[21,579,580],{},"axon extension"," is an alias for ",[21,583,584],{},"axon ext"," throughout.",[92,587,589],{"id":588},"whats-next","What's next",[14,591,592,599],{},[203,593,594],{},[595,596,598],"a",{"href":597},"\u002Fdocs\u002Fv2\u002Fextending","Your Config"," — the profile directory and the seven globals.",[14,601,602,607],{},[203,603,604],{},[595,605,400],{"href":606},"\u002Fdocs\u002Fv2\u002Fmodules\u002Fpublishing"," — how the registry, namespaces and\nversioning work.",[609,610,611],"style",{},"html pre.shiki code .sCudf, html code.shiki .sCudf{--shiki-default:#DCDCAA}html pre.shiki code .sKc5r, html code.shiki .sKc5r{--shiki-default:#CE9178}html pre.shiki code .sOLPB, html code.shiki .sOLPB{--shiki-default:#6A9955}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .s3F5K, html code.shiki .s3F5K{--shiki-default:#9CDCFE}html pre.shiki code .sTNBD, html code.shiki .sTNBD{--shiki-default:#D4D4D4}html pre.shiki code .scz_3, html code.shiki .scz_3{--shiki-default:#569CD6}html pre.shiki code .sYbnZ, html code.shiki .sYbnZ{--shiki-default:#C586C0}html pre.shiki code .sqDPy, html code.shiki .sqDPy{--shiki-default:#C8C8C8}",{"title":31,"searchDepth":45,"depth":45,"links":613},[614,615,618,619,620,621],{"id":94,"depth":45,"text":95},{"id":218,"depth":45,"text":219,"children":616},[617],{"id":392,"depth":59,"text":393},{"id":399,"depth":45,"text":400},{"id":479,"depth":45,"text":480},{"id":492,"depth":45,"text":493},{"id":588,"depth":45,"text":589},"md",{},true,"\u002Fdocs\u002Fv2\u002Fextending\u002Fextensions",{"title":5,"description":16},"docs\u002Fv2\u002Fextending\u002Fextensions","_5L_pMbgGKaP6oSw5HkwCliEhSqfCvH7z028oAL4DGw",1786520846932]