Aspire 入门指南
getting-started-with-aspire
当开发者询问如何开始使用 Aspire 时使用本技能——包括安装 Aspire CLI、创建新的 Aspire 应用、在本地运行,或在 aspire.dev 上查找权威文档、集成目录或 API 参考。适用于“如何安装 aspire?”“如何创建新的 aspire 应用?”“如何运行我的 aspire 应用?”“aspire 的文档在哪里?”等问题。不适用于:操作现有的 Aspire AppHost(使用 github.com/microsoft/aspire/tree/main/.agents/skills/aspire 上的官方 `aspire` 技能)、编写 AppHost 代码,或向现有应用添加集成。
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 206
- Forks
- 99
01 前言 Front Matter
- name
- getting-started-with-aspire
- description
- Use this skill when a developer asks how to begin using Aspire — installing the Aspire CLI, creating a new Aspire app, running it locally, or finding the authoritative docs, integration catalog, or API reference on aspire.dev. Use it for questions like "how do I install aspire?", "how do I create a new aspire app?", "how do I run my aspire app?", or "where is the documentation for aspire?". Do not use it for operating an existing Aspire AppHost (use the official `aspire` skill at github.com/microsoft/aspire/tree/main/.agents/skills/aspire), authoring AppHost code, or adding integrations to an existing app.
03 SKILL.md 正文
Getting started with Aspire
Aspire is a polyglot stack for building, running, debugging, and deploying distributed applications. The AppHost can be authored in C# or TypeScript today, with additional languages (Java, Go, Python, Rust, …) on the roadmap. The Aspire CLI (aspire) is the entry point for everything: scaffolding apps, running them locally, inspecting state, and deploying.
When to use this skill
- The user is new to Aspire and wants to install the CLI.
- The user wants to scaffold a brand-new Aspire app.
- The user wants to know how to run the app they just created.
- The user is looking for the authoritative docs, integration catalog, or API reference.
Don't use this skill for
- Operating an existing Aspire AppHost (resources, logs, traces, dashboard commands). That's the official
aspireskill. - Editing AppHost source code (C# or TypeScript) — consult the API reference on aspire.dev.
Install the Aspire CLI
The official cross-platform installers are hosted on aspire.dev:
- Windows (PowerShell):
iex (irm https://aspire.dev/install.ps1) - macOS / Linux (bash):
curl -fsSL https://aspire.dev/install.sh | bash
After install, verify with aspire --version. Do not install Aspire from NuGet/npm directly when the user wants the CLI — the install script is the supported path.
Create a new Aspire app
aspire new
aspire new is interactive. It prompts for the template (for example aspire-starter, apphost, apphost-ts), the project name, the output location, and the language. It creates a subfolder for the new project, so run it from the parent directory where you want the project folder to live. Do not pass fabricated template flags; let the CLI prompt the user.
Run the app
cd <project>
aspire start
aspire start launches the AppHost and the Aspire dashboard. Prefer aspire start over dotnet run for AppHosts — aspire start is the agent-friendly path; aspire run blocks the terminal.
Where to learn more
- Documentation hub: https://aspire.dev/docs/
- CLI reference: https://aspire.dev/reference/cli/
- Integration catalog: https://aspire.dev/integrations/
- C# API reference: https://aspire.dev/reference/api/csharp/
- TypeScript API reference: https://aspire.dev/reference/api/typescript/
- LLM-friendly corpus: https://aspire.dev/llms.txt, https://aspire.dev/llms-full.txt
- Per-page markdown: every page on aspire.dev is also available as
<page>.md(or viaAccept: text/markdowncontent negotiation). - In-page search tool: when running in a WebMCP-capable browser, the
search-aspire-docstool is registered on every aspire.dev page. - Source repository: https://github.com/microsoft/aspire
04 同仓库更多 Skills
Aspire 新特性发布说明编写
whatsnew
这是一个带步骤参数的技能,将编写 Aspire “What's new in N.N” 发布说明页面(src/frontend/src/content/docs/whats-new/aspire-N-N.mdx)规范为一套可重复的生命周期流程。以 `/whatsnew {modality}` 形式调用,其中 modality 为以下之一:draft/scaffold(init,初始化)、research(研究)、critique(评审)、validate(验证)、polish(润色)、review(审查)。适用于:为某个版本启动/搭建新的“新特性”页面,将版本变更研究整理成资料档案并撰写草稿正文,评审草稿,对差异进行事实核查/验证,润色并执行数据导入,或对 PR 做最终签核。不适用于:通用文档页面(使用 doc-writer)、审查任意文档 PR(使用 doc-pr-reviewer),或产品仓库的改动。编排的技能包括:doc-writer、doc-pr-reviewer、doc-tester、twoslash-validator、update-integrations、update-samples、container-images。
Aspire 示例数据同步
update-samples
通过从 microsoft/aspire-samples GitHub 仓库获取示例元数据来更新示例数据文件。在添加新示例、刷新示例数据,或确保 samples.json 与上游仓库保持同步时使用。
集成文档与 API 参考同步
update-integrations
通过将 NuGet 包名与其文档 URL 同步,并生成每个包的 API schema,来更新集成文档链接和 API 参考数据。在添加新集成、刷新包数据、确保 integration-docs.json 与 aspire-integrations.json 保持同步,或重新生成 API 参考 JSON 文件时使用。
Twoslash 示例校验与修复
twoslash-validator
为 aspire.dev 校验并修复双斜杠(twoslash)TypeScript 示例。在添加或编辑 `twoslash` 代码块、TypeScript AppHost 示例、生成的 TypeScript API 数据,或处理 `bun run test:unit:twoslash-blocks` 的失败时使用。
Playwright 浏览器自动化测试
playwright-cli
自动化浏览器交互,用于 Web 测试、表单填写、截图和数据提取。当用户需要浏览网站、与网页交互、填写表单、截取截图、测试 Web 应用或从网页提取信息时使用。
终端应用自动化操作
hex1b
用于自动化任何终端应用程序的 CLI 工具——TUI 应用、shell、CLI 工具、REPL 等。当需要在虚拟终端中启动进程、捕获其屏幕输出、注入键盘或鼠标输入、截取屏幕截图、录制会话或对可见内容进行断言时使用。