[{"data":1,"prerenderedAt":279},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fv2\u002Fdeploy\u002Fattaching":3},{"id":4,"title":5,"body":6,"description":16,"extension":272,"meta":273,"navigation":274,"path":275,"seo":276,"stem":277,"__hash__":278},"docs\u002Fdocs\u002Fv2\u002Fdeploy\u002Fattaching.md","Attaching",{"type":7,"value":8,"toc":264},"minimark",[9,13,17,28,39,44,50,55,58,63,66,70,77,92,96,107,131,140,144,151,154,158,165,209,218,222,228,245,248,254,260],[10,11,5],"h1",{"id":12},"attaching",[14,15,16],"p",{},"An agent running anywhere reachable over the network can be driven from your terminal.\nLocal dev server, a container on another machine, a deployment — the same command, and the\nsame interface once you are connected.",[18,19,24],"pre",{"className":20,"code":22,"language":23},[21],"language-text",":attach http:\u002F\u002Flocalhost:3010\n","text",[25,26,22],"code",{"__ignoreMap":27},"",[14,29,30,34,35,38],{},[31,32,33],"strong",{},"Attaching boots nothing."," The agent is already up and owned by whoever started it, so\n",[25,36,37],{},":close"," detaches and leaves it running — exactly as it does for a deployment.",[40,41,43],"h2",{"id":42},"attach-to-a-dev-server","Attach to a dev server",[14,45,46,49],{},[25,47,48],{},"axon dev"," prints the URL it is listening on:",[51,52],"terminal-image",{"alt":53,"src":54},"axon dev printing the Axon dev server banner: local URL localhost:3010, the agent @axon\u002Fzeno, engine auto, its loaded modules, ready in 817ms, and watching for changes","\u002Ftui\u002Fagent-dev-server.webp",[14,56,57],{},"From another terminal, attach to it:",[18,59,61],{"className":60,"code":22,"language":23},[21],[25,62,22],{"__ignoreMap":27},[14,64,65],{},"That is the whole loop for working on an agent while talking to it — the dev server\nhot-reloads on save, and your attached session keeps running against it.",[40,67,69],{"id":68},"what-the-handshake-tells-you","What the handshake tells you",[14,71,72,73,76],{},"Attaching is not a blind socket open. The connection resolves the agent's ",[31,74,75],{},"identity, its\nloaded modules and tools, and its engine",", then hydrates the session — so the conversation\nyou see is the agent's real history, not an empty buffer.",[14,78,79,80,83,84,87,88,91],{},"That is why ",[25,81,82],{},":attach"," takes a bare URL and still shows you a named agent: the handshake is\nthe only thing that knows what is running there. Everything the terminal does against a\nlocal agent works the same way once attached — the palettes, session history, ",[25,85,86],{},"*"," to change\nmodel, ",[25,89,90],{},":open"," to inspect the trace.",[40,93,95],{"id":94},"attaching-to-a-deployment","Attaching to a deployment",[14,97,98,99,102,103,106],{},"Deployments are ",[31,100,101],{},"enumerable",", so they are not typed. Press ",[25,104,105],{},"~"," and they appear alongside\nyour local agents — pick one and you are connected.",[18,108,112],{"className":109,"code":110,"language":111,"meta":27,"style":27},"language-bash shiki shiki-themes dark-plus","axon status     # prints the URL, if you want to attach by address instead\n","bash",[25,113,114],{"__ignoreMap":27},[115,116,119,123,127],"span",{"class":117,"line":118},"line",1,[115,120,122],{"class":121},"sCudf","axon",[115,124,126],{"class":125},"sKc5r"," status",[115,128,130],{"class":129},"sOLPB","     # prints the URL, if you want to attach by address instead\n",[14,132,133,134,136,137,139],{},"Use ",[25,135,82],{}," when the address is something only you know: a dev server, a container you\nstarted, an agent on another machine on your network. Use ",[25,138,105],{}," when the platform already\nknows about it.",[40,141,143],{"id":142},"one-writer-per-session","One writer per session",[14,145,146,147,150],{},"Re-attaching to the same URL ",[31,148,149],{},"focuses the binding you already have"," rather than opening a\nsecond one. Two handles onto one remote session would both write to it, which breaks the\none-session-one-writer rule that makes the log coherent.",[14,152,153],{},"The URL is normalised first, so a trailing slash or a capitalised host cannot slip past\nthat guard. Paths are left case-sensitive, because folding them would merge two genuinely\ndifferent agents behind one connection.",[40,155,157],{"id":156},"from-the-shell","From the shell",[14,159,160,161,164],{},"The CLI has no ",[25,162,163],{},"attach"," yet — the terminal is the mature path here. What the CLI gives you\ntoday is the HTTP and WebSocket surface directly, which is what you want from a script:",[18,166,168],{"className":109,"code":167,"language":111,"meta":27,"style":27},"curl -X POST http:\u002F\u002Flocalhost:3010\u002Fapi\u002Fchat \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{ \"message\": \"summarise my open issues\" }'\n",[25,169,170,189,200],{"__ignoreMap":27},[115,171,172,175,179,182,185],{"class":117,"line":118},[115,173,174],{"class":121},"curl",[115,176,178],{"class":177},"scz_3"," -X",[115,180,181],{"class":125}," POST",[115,183,184],{"class":125}," http:\u002F\u002Flocalhost:3010\u002Fapi\u002Fchat",[115,186,188],{"class":187},"svVle"," \\\n",[115,190,192,195,198],{"class":117,"line":191},2,[115,193,194],{"class":177},"  -H",[115,196,197],{"class":125}," \"Content-Type: application\u002Fjson\"",[115,199,188],{"class":187},[115,201,203,206],{"class":117,"line":202},3,[115,204,205],{"class":177},"  -d",[115,207,208],{"class":125}," '{ \"message\": \"summarise my open issues\" }'\n",[14,210,211,212,217],{},"See ",[213,214,216],"a",{"href":215},"\u002Fdocs\u002Fv2\u002Fdeploy\u002Fconnecting","Connecting"," for the full HTTP and WebSocket reference,\nincluding auth against a deployed agent.",[40,219,221],{"id":220},"running-it-yourself","Running it yourself",[14,223,224,227],{},[25,225,226],{},"axon build"," produces a container image from the same folder:",[18,229,231],{"className":109,"code":230,"language":111,"meta":27,"style":27},"axon build\n# → .agent\u002Fimage.tar\n",[25,232,233,240],{"__ignoreMap":27},[115,234,235,237],{"class":117,"line":118},[115,236,122],{"class":121},[115,238,239],{"class":125}," build\n",[115,241,242],{"class":117,"line":191},[115,243,244],{"class":129},"# → .agent\u002Fimage.tar\n",[14,246,247],{},"Run that image anywhere containers run, expose its port, and attach to it exactly as you\nwould a dev server. The agent does not know the difference — which is the point.",[18,249,252],{"className":250,"code":251,"language":23},[21],":attach http:\u002F\u002F10.0.0.42:3010\n",[25,253,251],{"__ignoreMap":27},[14,255,256,257,259],{},"A local dev server needs no credential: it is already inside your own trust boundary. A\ndeployed agent does — see ",[213,258,216],{"href":215},".",[261,262,263],"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 .scz_3, html code.shiki .scz_3{--shiki-default:#569CD6}html pre.shiki code .svVle, html code.shiki .svVle{--shiki-default:#D7BA7D}",{"title":27,"searchDepth":191,"depth":191,"links":265},[266,267,268,269,270,271],{"id":42,"depth":191,"text":43},{"id":68,"depth":191,"text":69},{"id":94,"depth":191,"text":95},{"id":142,"depth":191,"text":143},{"id":156,"depth":191,"text":157},{"id":220,"depth":191,"text":221},"md",{},true,"\u002Fdocs\u002Fv2\u002Fdeploy\u002Fattaching",{"title":5,"description":16},"docs\u002Fv2\u002Fdeploy\u002Fattaching","TyQ_Qku-3EuKccigtogCcIUuVuot0Vq89lZRsh4tEAo",1786914042758]