aspire by github/awesome-copilot
npx skills add https://github.com/github/awesome-copilot --skill aspireAspire 是一个代码优先、多语言工具链,用于构建可观测、生产就绪的分布式应用程序。它通过单个 AppHost 项目编排容器、可执行文件和云资源——无论工作负载是 C#、Python、JavaScript/TypeScript、Go、Java、Rust、Bun、Deno 还是 PowerShell。
心智模型: AppHost 是一个指挥家——它不演奏乐器,而是告诉每个服务何时启动、如何找到彼此,并监视问题。
详细的参考资料位于 references/ 文件夹中——按需加载。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 方法签名、链式选项、特定语言模式 |
| 架构 | DCP 内部原理、资源模型、服务发现、网络、遥测 |
| 仪表板 | 仪表板功能、独立模式、GenAI 可视化工具 |
| 部署 | Docker、Kubernetes、Azure 容器应用、应用服务 |
| 测试 | 针对 AppHost 的集成测试 |
| 故障排除 | 诊断代码、常见错误和修复方法 |
Aspire 团队提供了一个 MCP 服务器,可以直接在您的 AI 助手中提供文档工具。设置详情请参见 MCP 服务器。
如果运行的是 Aspire CLI 13.2 或更高版本 (aspire --version),MCP 服务器包含文档搜索工具:
| 工具 | 描述 |
|---|---|
list_docs | 列出 aspire.dev 上所有可用的文档 |
search_docs | 在索引文档中执行加权词汇搜索 |
get_doc | 通过其 slug 检索特定文档 |
这些工具在 PR #14028 中添加。要更新:aspire update --self --channel daily。
有关此方法的更多信息,请参阅 David Pine 的帖子:https://davidpine.dev/posts/aspire-docs-mcp-tools/
在 13.1 版本上,MCP 服务器提供集成查找功能,但不提供文档搜索:
| 工具 | 描述 |
|---|---|
list_integrations | 列出可用的 Aspire 托管集成 |
get_integration_docs | 获取特定集成包的文档 |
对于 13.1 版本上的一般文档查询,请使用 Context7 作为主要来源(见下文)。
当 Aspire MCP 文档工具不可用(13.1 版本)或 MCP 服务器未运行时,请使用 Context7 (mcp_context7):
步骤 1 — 解析库 ID(每个会话一次):
使用 libraryName: ".NET Aspire" 调用 mcp_context7_resolve-library-id。
| 排名 | 库 ID | 使用场景 |
|---|---|---|
| 1 | /microsoft/aspire.dev | 主要来源。指南、集成、CLI 参考、部署。 |
| 2 | /dotnet/aspire | API 内部原理、源代码级实现细节。 |
| 3 | /communitytoolkit/aspire | 非微软的多语言集成(Go、Java、Node.js、Ollama)。 |
步骤 2 — 查询文档:
libraryId: "/microsoft/aspire.dev", query: "Python integration AddPythonApp service discovery"
libraryId: "/communitytoolkit/aspire", query: "Golang Java Node.js community integrations"
在 GitHub 上搜索官方文档仓库:
microsoft/aspire.dev — 路径:src/frontend/src/content/docs/dotnet/aspiredotnet/aspire-samplesCommunityToolkit/Aspire| 要求 | 详情 |
|---|---|
| .NET SDK | 10.0+(即使是针对非 .NET 工作负载也需要——AppHost 是 .NET 的) |
| 容器运行时 | Docker Desktop、Podman 或 Rancher Desktop |
| IDE(可选) | VS Code + C# Dev Kit、Visual Studio 2022、JetBrains Rider |
# Linux / macOS
curl -sSL https://aspire.dev/install.sh | bash
# Windows PowerShell
irm https://aspire.dev/install.ps1 | iex
# 验证
aspire --version
# 安装模板
dotnet new install Aspire.ProjectTemplates
| 模板 | 命令 | 描述 |
|---|---|---|
| aspire-starter | aspire new aspire-starter | ASP.NET Core/Blazor 入门项目 + AppHost + 测试 |
| aspire-ts-cs-starter | aspire new aspire-ts-cs-starter | ASP.NET Core/React 入门项目 + AppHost |
| aspire-py-starter | aspire new aspire-py-starter | FastAPI/React 入门项目 + AppHost |
| aspire-apphost-singlefile | aspire new aspire-apphost-singlefile | 空的单文件 AppHost |
AppHost 编排所有服务。非 .NET 工作负载作为容器或可执行文件运行。
var builder = DistributedApplication.CreateBuilder(args);
// 基础设施
var redis = builder.AddRedis("cache");
var postgres = builder.AddPostgres("pg").AddDatabase("catalog");
// .NET API
var api = builder.AddProject<Projects.CatalogApi>("api")
.WithReference(postgres).WithReference(redis);
// Python ML 服务
var ml = builder.AddPythonApp("ml-service", "../ml-service", "main.py")
.WithHttpEndpoint(targetPort: 8000).WithReference(redis);
// React 前端 (Vite)
var web = builder.AddViteApp("web", "../frontend")
.WithHttpEndpoint(targetPort: 5173).WithReference(api);
// Go 工作器
var worker = builder.AddGolangApp("worker", "../go-worker")
.WithReference(redis);
builder.Build().Run();
完整的 API 签名,请参见 多语言 API。
| 概念 | 要点 |
|---|---|
| 运行 vs 发布 | aspire run = 本地开发(DCP 引擎)。aspire publish = 生成部署清单。 |
| 服务发现 | 通过环境变量自动实现:ConnectionStrings__<name>, services__<name>__http__0 |
| 资源生命周期 | DAG 排序——依赖项先启动。.WaitFor() 根据健康检查进行门控。 |
| 资源类型 | ProjectResource, ContainerResource, ExecutableResource, ParameterResource |
| 集成 | 13 个类别中超过 144 个。托管包(AppHost)+ 客户端包(服务)。 |
| 仪表板 | 实时日志、跟踪、指标、GenAI 可视化工具。运行 aspire run 时自动启动。 |
| MCP 服务器 | AI 助手可以通过 CLI(STDIO)查询正在运行的应用程序和搜索文档。 |
| 测试 | Aspire.Hosting.Testing — 在 xUnit/MSTest/NUnit 中启动完整的 AppHost。 |
| 部署 | Docker、Kubernetes、Azure 容器应用、Azure 应用服务。 |
Aspire CLI 13.1 中的有效命令:
| 命令 | 描述 | 状态 |
|---|---|---|
aspire new <template> | 从模板创建 | 稳定 |
aspire init | 在现有项目中初始化 | 稳定 |
aspire run | 在本地启动所有资源 | 稳定 |
aspire add <integration> | 添加集成 | 稳定 |
aspire publish | 生成部署清单 | 预览 |
aspire config | 管理配置设置 | 稳定 |
aspire cache | 管理磁盘缓存 | 稳定 |
aspire deploy | 部署到定义的目标 | 预览 |
aspire do <step> | 执行流水线步骤 | 预览 |
aspire update | 更新集成(或 --self 更新 CLI) | 预览 |
aspire mcp init | 为 AI 助手配置 MCP | 稳定 |
aspire mcp start | 启动 MCP 服务器 | 稳定 |
带标志的完整命令参考:CLI 参考。
Add*App() 或 AddProject<T>().WithReference().WaitFor()aspire runaspire new aspire-apphost-singlefile(空的 AppHost)docker-compose 服务替换为 Aspire 资源depends_on → .WithReference() + .WaitFor()ports → .WithHttpEndpoint()environment → .WithEnvironment() 或 .WithReference()| 资源 | 网址 |
|---|---|
| 文档 | https://aspire.dev |
| 运行时仓库 | https://github.com/dotnet/aspire |
| 文档仓库 | https://github.com/microsoft/aspire.dev |
| 示例 | https://github.com/dotnet/aspire-samples |
| 社区工具包 | https://github.com/CommunityToolkit/Aspire |
| 仪表板镜像 | mcr.microsoft.com/dotnet/aspire-dashboard |
| Discord | https://aka.ms/aspire/discord |
| https://www.reddit.com/r/aspiredotdev/ |
每周安装量
7.4K
仓库
GitHub 星标数
26.7K
首次出现
2026年2月13日
安全审计
安装于
codex7.3K
gemini-cli7.3K
opencode7.3K
github-copilot7.3K
cursor7.3K
kimi-cli7.2K
Aspire is a code-first, polyglot toolchain for building observable, production-ready distributed applications. It orchestrates containers, executables, and cloud resources from a single AppHost project — regardless of whether the workloads are C#, Python, JavaScript/TypeScript, Go, Java, Rust, Bun, Deno, or PowerShell.
Mental model: The AppHost is a conductor — it doesn't play the instruments, it tells every service when to start, how to find each other, and watches for problems.
Detailed reference material lives in the references/ folder — load on demand.
| Reference | When to load |
|---|---|
| CLI Reference | Command flags, options, or detailed usage |
| MCP Server | Setting up MCP for AI assistants, available tools |
| Integrations Catalog | Discovering integrations via MCP tools, wiring patterns |
| Polyglot APIs | Method signatures, chaining options, language-specific patterns |
| Architecture | DCP internals, resource model, service discovery, networking, telemetry |
| Dashboard | Dashboard features, standalone mode, GenAI Visualizer |
| Deployment | Docker, Kubernetes, Azure Container Apps, App Service |
| Testing | Integration tests against the AppHost |
| Troubleshooting | Diagnostic codes, common errors, and fixes |
The Aspire team ships an MCP server that provides documentation tools directly inside your AI assistant. See MCP Server for setup details.
If running Aspire CLI 13.2 or later (aspire --version), the MCP server includes docs search tools:
| Tool | Description |
|---|---|
list_docs | Lists all available documentation from aspire.dev |
search_docs | Performs weighted lexical search across indexed documentation |
get_doc | Retrieves a specific document by its slug |
These tools were added in PR #14028. To update: aspire update --self --channel daily.
For more on this approach, see David Pine's post: https://davidpine.dev/posts/aspire-docs-mcp-tools/
On 13.1, the MCP server provides integration lookup but not docs search:
| Tool | Description |
|---|---|
list_integrations | Lists available Aspire hosting integrations |
get_integration_docs | Gets documentation for a specific integration package |
For general docs queries on 13.1, use Context7 as your primary source (see below).
Use Context7 (mcp_context7) when the Aspire MCP docs tools are unavailable (13.1) or the MCP server isn't running:
Step 1 — Resolve the library ID (one-time per session):
Call mcp_context7_resolve-library-id with libraryName: ".NET Aspire".
| Rank | Library ID | Use when |
|---|---|---|
| 1 | /microsoft/aspire.dev | Primary source. Guides, integrations, CLI reference, deployment. |
| 2 | /dotnet/aspire | API internals, source-level implementation details. |
| 3 | /communitytoolkit/aspire | Non-Microsoft polyglot integrations (Go, Java, Node.js, Ollama). |
Step 2 — Query docs:
libraryId: "/microsoft/aspire.dev", query: "Python integration AddPythonApp service discovery"
libraryId: "/communitytoolkit/aspire", query: "Golang Java Node.js community integrations"
Search the official docs repo on GitHub:
microsoft/aspire.dev — path: src/frontend/src/content/docs/dotnet/aspiredotnet/aspire-samplesCommunityToolkit/Aspire| Requirement | Details |
|---|---|
| .NET SDK | 10.0+ (required even for non-.NET workloads — the AppHost is .NET) |
| Container runtime | Docker Desktop, Podman, or Rancher Desktop |
| IDE (optional) | VS Code + C# Dev Kit, Visual Studio 2022, JetBrains Rider |
# Linux / macOS
curl -sSL https://aspire.dev/install.sh | bash
# Windows PowerShell
irm https://aspire.dev/install.ps1 | iex
# Verify
aspire --version
# Install templates
dotnet new install Aspire.ProjectTemplates
| Template | Command | Description |
|---|---|---|
| aspire-starter | aspire new aspire-starter | ASP.NET Core/Blazor starter + AppHost + tests |
| aspire-ts-cs-starter | aspire new aspire-ts-cs-starter | ASP.NET Core/React starter + AppHost |
| aspire-py-starter | aspire new aspire-py-starter | FastAPI/React starter + AppHost |
| aspire-apphost-singlefile | aspire new aspire-apphost-singlefile | Empty single-file AppHost |
The AppHost orchestrates all services. Non-.NET workloads run as containers or executables.
var builder = DistributedApplication.CreateBuilder(args);
// Infrastructure
var redis = builder.AddRedis("cache");
var postgres = builder.AddPostgres("pg").AddDatabase("catalog");
// .NET API
var api = builder.AddProject<Projects.CatalogApi>("api")
.WithReference(postgres).WithReference(redis);
// Python ML service
var ml = builder.AddPythonApp("ml-service", "../ml-service", "main.py")
.WithHttpEndpoint(targetPort: 8000).WithReference(redis);
// React frontend (Vite)
var web = builder.AddViteApp("web", "../frontend")
.WithHttpEndpoint(targetPort: 5173).WithReference(api);
// Go worker
var worker = builder.AddGolangApp("worker", "../go-worker")
.WithReference(redis);
builder.Build().Run();
For complete API signatures, see Polyglot APIs.
| Concept | Key point |
|---|---|
| Run vs Publish | aspire run = local dev (DCP engine). aspire publish = generate deployment manifests. |
| Service discovery | Automatic via env vars: ConnectionStrings__<name>, services__<name>__http__0 |
| Resource lifecycle | DAG ordering — dependencies start first. .WaitFor() gates on health checks. |
| Resource types | ProjectResource, , , |
Valid commands in Aspire CLI 13.1:
| Command | Description | Status |
|---|---|---|
aspire new <template> | Create from template | Stable |
aspire init | Initialize in existing project | Stable |
aspire run | Start all resources locally | Stable |
aspire add <integration> | Add an integration | Stable |
aspire publish | Generate deployment manifests |
Full command reference with flags: CLI Reference.
Add*App() or AddProject<T>().WithReference().WaitFor() if neededaspire runaspire new aspire-apphost-singlefile (empty AppHost)docker-compose service with an Aspire resourcedepends_on → .WithReference() + .WaitFor()ports → .WithHttpEndpoint()environment → .WithEnvironment() or .WithReference()| Resource | URL |
|---|---|
| Documentation | https://aspire.dev |
| Runtime repo | https://github.com/dotnet/aspire |
| Docs repo | https://github.com/microsoft/aspire.dev |
| Samples | https://github.com/dotnet/aspire-samples |
| Community Toolkit | https://github.com/CommunityToolkit/Aspire |
| Dashboard image | mcr.microsoft.com/dotnet/aspire-dashboard |
| Discord |
Weekly Installs
7.4K
Repository
GitHub Stars
26.7K
First Seen
Feb 13, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykWarn
Installed on
codex7.3K
gemini-cli7.3K
opencode7.3K
github-copilot7.3K
cursor7.3K
kimi-cli7.2K
97,600 周安装
ContainerResourceExecutableResourceParameterResource| Integrations | 144+ across 13 categories. Hosting package (AppHost) + Client package (service). |
| Dashboard | Real-time logs, traces, metrics, GenAI visualizer. Runs automatically with aspire run. |
| MCP Server | AI assistants can query running apps and search docs via CLI (STDIO). |
| Testing | Aspire.Hosting.Testing — spin up full AppHost in xUnit/MSTest/NUnit. |
| Deployment | Docker, Kubernetes, Azure Container Apps, Azure App Service. |
| Preview |
aspire config | Manage configuration settings | Stable |
aspire cache | Manage disk cache | Stable |
aspire deploy | Deploy to defined targets | Preview |
aspire do <step> | Execute a pipeline step | Preview |
aspire update | Update integrations (or --self for CLI) | Preview |
aspire mcp init | Configure MCP for AI assistants | Stable |
aspire mcp start | Start the MCP server | Stable |
| https://www.reddit.com/r/aspiredotdev/ |