{"id":380,"date":"2026-04-16T10:00:00","date_gmt":"2026-04-16T17:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/aspire\/?p=380"},"modified":"2026-04-15T15:59:34","modified_gmt":"2026-04-15T22:59:34","slug":"aspire-detached-mode-and-process-management","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/aspire\/aspire-detached-mode-and-process-management\/","title":{"rendered":"Free Your Terminal with Detached Mode in Aspire 13.2"},"content":{"rendered":"<p>Running Aspire apps from the CLI has a friction point: your terminal is locked to the AppHost process. While the app is running, you can&#8217;t use the terminal to check logs or telemetry. You must open a new terminal window. Worse, if an agent has started your Aspire app to test a feature, the agent may decide to kill the app to free the terminal for a new command. Oops!<\/p>\n<p>Aspire 13.2 fixes these problems with <strong>detached mode<\/strong>, a way to run an Aspire app in the background. Aspire 13.2 also introduces a new suite of process management commands that give you real CLI control over your application lifecycle.<\/p>\n<h2>Running in the Background<\/h2>\n<p>The simplest feature is often the most useful. With detached mode, you start your AppHost and immediately get your terminal back:<\/p>\n<pre><code class=\"language-bash\">aspire start<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/aspire\/wp-content\/uploads\/sites\/90\/2026\/04\/aspire-start.png\" alt=\"Output of aspire start showing the AppHost starting in the background\" \/><\/p>\n<p>That&#8217;s it. Your AppHost spins up in the background, and you&#8217;re ready to run other commands in the same terminal. No more hunting for another shell window or tmux session.<\/p>\n<p>This is especially valuable during local development when you&#8217;re:<\/p>\n<ul>\n<li>Running your AppHost while you inspect its state, such as with <code>aspire describe<\/code> in the same terminal.<\/li>\n<li>Working in a constrained environment (remote shell, CI\/CD runner) where terminal windows are limited.<\/li>\n<li>Working with a coding agent to inject runtime behavior. The coding agent will start your app in the background, then make terminal commands to send HTTP requests, fetch logs with <code>aspire logs<\/code>, and eventually shut down the app.<\/li>\n<\/ul>\n<p><div class=\"alert alert-info\"><p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Info\"><\/i><strong>Note<\/strong><\/p>\n<code>aspire start<\/code> is a shortcut for <code>aspire run --detach<\/code>. They do the same thing.\n<\/div><\/p>\n<h2>Managing Multiple AppHosts<\/h2>\n<p>Detached mode shines when you&#8217;re juggling multiple projects. List all running Aspire AppHosts:<\/p>\n<pre><code class=\"language-bash\">aspire ps<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/aspire\/wp-content\/uploads\/sites\/90\/2026\/04\/aspire-ps.png\" alt=\"Output of aspire ps showing a running AppHost with its path, PID, and dashboard URL\" \/><\/p>\n<p>If you combine detached mode with <a href=\"https:\/\/devblogs.microsoft.com\/aspire\/aspire-isolated-mode-parallel-development\/\">isolated mode<\/a>, then each AppHost is isolated, running on its own ports, with its own dashboard and telemetry.<\/p>\n<p>When you&#8217;re done with one, stop it cleanly:<\/p>\n<pre><code class=\"language-bash\">aspire stop<\/code><\/pre>\n<p>This displays a prompt to choose which AppHost to stop. If you want to stop a specific AppHost without a prompt, use the <code>--apphost<\/code> option:<\/p>\n<pre><code class=\"language-bash\">aspire stop --apphost my-app\/apphost.cs<\/code><\/pre>\n<p>The process shuts down gracefully, giving your services time to clean up connections and flush logs.<\/p>\n<p><div class=\"alert alert-info\"><p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Info\"><\/i><strong>Note<\/strong><\/p>\nYour Aspire Dashboard is still fully available in detached mode. Click the dashboard link after <code>aspire start<\/code> finishes, or run <code>aspire ps<\/code> to find it.\n<\/div><\/p>\n<h2>Running Your App From a Coding Agent<\/h2>\n<p>Detached mode is especially powerful when a coding agent is driving your development workflow. Because <code>aspire start<\/code> returns control to the terminal immediately, the agent can start the app, inspect its state, diagnose issues, and take action\u2014all in a single session.<\/p>\n<p>Below is a real example. A user asks their coding agent to start the app and check whether everything is healthy:<\/p>\n<pre><code>\u276f start app and check resources state<\/code><\/pre>\n<p>The agent runs <code>aspire start<\/code> to launch the AppHost in the background, then immediately runs <code>aspire describe --format Json<\/code> to inspect resource state. It reports back with a table:<\/p>\n<pre><code>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Resource        \u2502 Type                  \u2502 State               \u2502 Health  \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 apiservice      \u2502 Project               \u2502 \u2705 Running          \u2502 Healthy \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 cache           \u2502 Container (redis:8.6) \u2502 \u26a0\ufe0f RuntimeUnhealthy \u2502 \u2014       \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 webfrontend     \u2502 Project               \u2502 \u23f3 Waiting          \u2502 \u2014       \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518<\/code><\/pre>\n<p>The agent spots the problem: the Redis cache container is unhealthy, which is blocking the web frontend from starting. It then offers to investigate further\u2014all without the user having to open a dashboard or switch terminals.<\/p>\n<p>This is possible because the CLI gives the agent a way to start the app without blocking, query resource state, fetch logs, and eventually stop the app\u2014all through simple terminal commands.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/aspire\/wp-content\/uploads\/sites\/90\/2026\/04\/aspire-start-agent.gif\" alt=\"A coding agent starting an Aspire app and inspecting resource state\" \/><\/p>\n<p><div class=\"alert alert-info\"><p class=\"alert-divider\"><i class=\"fabric-icon fabric-icon--Info\"><\/i><strong>Note<\/strong><\/p>\nThe <code>aspire agent init<\/code> command automatically sets up an Aspire skill for the agent to use to get the best results.\n<\/div><\/p>\n<h2>When to Use Detached Mode<\/h2>\n<p>Use it when:<\/p>\n<ul>\n<li><strong>Local development<\/strong>: You want to inspect resources with <code>aspire describe<\/code>, check logs with <code>aspire logs<\/code>, or run <code>dotnet test<\/code> while your AppHost is running\u2014all from the same terminal.<\/li>\n<li><strong>CI\/CD pipelines<\/strong>: Your build runner has a single terminal. Start the AppHost, run integration tests, then stop it\u2014no extra shell needed.<\/li>\n<li><strong>Coding agents<\/strong>: An agent needs to start your app, query its state, make HTTP requests, and shut it down\u2014all as sequential terminal commands.<\/li>\n<li><strong>Constrained environments<\/strong>: You&#8217;re working over SSH or in a remote container where opening additional terminal windows isn&#8217;t practical.<\/li>\n<\/ul>\n<h2>Get Involved<\/h2>\n<ul>\n<li><strong>\ud83d\udcd6 Learn more:<\/strong> Read the full documentation on <a href=\"https:\/\/aspire.dev\/reference\/cli\/overview\/\">Aspire CLI<\/a> at aspire.dev.<\/li>\n<li><strong>\ud83d\udcac Give us feedback:<\/strong> We&#8217;d love to hear what you think \u2014 file issues or join discussions on the <a href=\"https:\/\/github.com\/dotnet\/aspire\">Aspire GitHub repo<\/a>.<\/li>\n<li><strong>\ud83c\udf10 Join the community:<\/strong> Follow us and connect with other Aspire developers at <a href=\"https:\/\/aspire.dev\/community\/\">aspire.dev\/community<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Aspire 13.2 brings detached mode to the CLI. Run your AppHost in the background, free your terminal, and let coding agents start, inspect, and manage your app without blocking.<\/p>\n","protected":false},"author":11402,"featured_media":384,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1,17],"tags":[26,9,10,66,65],"class_list":["post-380","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspire-category","category-deep-dives","tag-apphost","tag-aspire","tag-cli","tag-coding-agent","tag-detached-mode"],"acf":[],"blog_post_summary":"<p>Aspire 13.2 brings detached mode to the CLI. Run your AppHost in the background, free your terminal, and let coding agents start, inspect, and manage your app without blocking.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/posts\/380","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/users\/11402"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/comments?post=380"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/posts\/380\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/media\/384"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/media?parent=380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/categories?post=380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/aspire\/wp-json\/wp\/v2\/tags?post=380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}