Repository navigation
[docs] Document aspire init --file-based option - #1648
David Pine (IEvangelist) merged 1 commit into
Conversation
Documents the --file-based flag added in microsoft/aspire#20004, which bypasses .NET solution discovery to always scaffold a single-file apphost.cs and requires C#. Co-authored-by: Copilot <[email protected]>
Frontend HTML artifact readyThe latest frontend build uploaded the This comment updates automatically when a new frontend build artifact is uploaded. |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The documentation contains a claim that conflicts with existing AppHost protection and needs clarification.
Review effort: Lite
Findings: None
What changed in this PR
Documents the new C#-only aspire init --file-based option.
Changes:
- Explains solution-discovery bypass and behavior.
- Adds the option reference.
- Adds a usage example.
| File | Summary |
|---|---|
src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx |
Documents --file-based behavior, constraints, and usage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
David Pine (IEvangelist)
left a comment
There was a problem hiding this comment.
Automated docs-accuracy review
Phase A source of truth: microsoft/aspire @ release/13.6 (SHA 63b5556c7f4de9b259d6ba71a312f597a72bf307), source PR microsoft/aspire#20004 (commit cc51526083).
Claims extracted: 6 non-narrative → 6 verified, 0 verified-with-nuance, 0 unverifiable, 0 contradicted.
Phase B (doc-tester): exercised /reference/cli/commands/aspire-init/ — 0 critical, 0 warnings.
Verdict: APPROVE — every verifiable claim matches source; the option description mirrors the CLI help verbatim.
Phase A — Claim verification
✅ Verified claims (6) — evidence
- C1 —
--file-basedoption exists onaspire init(aspire-init.mdx:117): verified.InitCommand.cs—_fileBasedOption = new Option<bool>("--file-based"), thenOptions.Add(_fileBasedOption). - C2 — Bypasses .NET solution discovery and creates the single-file
apphost.csscaffold regardless of any.sln/.slnx(aspire-init.mdx:49): verified.InitCommand.csgates discovery withif (isCSharp && !fileBased) { solutionFile = await _solutionLocator.FindSolutionFileAsync(...) }; the added comment reads "File-based initialization bypasses discovery so incidental solutions cannot trigger a prompt." A null solution takes the existing single-file path. - C3 — Requires C#; fails with an error before scaffolding or persisting the language when another language is selected (explicitly, via config, or at the prompt) (
aspire-init.mdx:51): verified.isCSharpis derived fromselectedProject.LanguageId(which resolves--language,aspire.config.json, and the interactive prompt), thenif (fileBased && !isCSharp) return CommandResult.Failure(CliExitCodes.InvalidCommand, InitCommandStrings.FileBasedRequiresCSharp)— returning before discovery/scaffold/persist. The commit message states it rejects non-C# "before scaffolding or persisting language preferences." - C4 — Omitting
--file-based(or--file-based false) preserves normal initialization for all languages (aspire-init.mdx:51): verified. It's anOption<bool>(defaults tofalse); afalsevalue takes the normalisCSharp && !fileBaseddiscovery path. - C5 — Existing-file protection and agent skill setup are unaffected (
aspire-init.mdx:51): verified. The change touches only the solution-discovery guard and the C# check; the overwrite safeguards and skill-setup paths are untouched. The option was deliberately renamed from--force-emptyto--file-basedspecifically to clarify it does not bypass overwrite protection. - C6 — Options-list description text (
aspire-init.mdx:119): verified.InitCommandStrings.resx—FileBasedOptionDescription= "Create apphost.cs in the current directory, skipping .NET solution discovery. Requires C#." — an exact match for the doc's option bullet;FileBasedRequiresCSharpcorroborates the "fails with an error" wording.
Phase B — Doc-tester results
Scope: doc routes affected by this PR's diff. Tested against the live production site (release/13.6 is not yet published, no per-PR preview exists, and frontend deps are not installed in this hourly job).
Critical issues: none.
Warnings: none.
Passed checks:
/reference/cli/commands/aspire-init/loads (200); all three insertion points are present and land cleanly: the new### Skipping solution discovery with --file-basedsection goes before### Channel persistence in aspire.config.json; the new--file-basedoption bullet follows--languagein Options; the new example joins the Examples list.
Knowledge gaps / limitations:
- PR content isn't deployed, so the new section, option bullet, and example couldn't be rendered as they will appear.
- The
--file-basedCLI runtime behavior can't be exercised from the docs site. Phase A confirmed it from source (InitCommand.cs+ the localized help strings).
Automated review. Phase A reads microsoft/aspire source; Phase B validates the rendered docs site as a blind user; only PR-changed content and its routes were in scope.
dd8b148
into
release/13.6
Documents changes from microsoft/aspire#20004
@mitchdennyTargeting
release/13.6based on the source PR milestone13.6.Why
microsoft/aspire#20004 adds a new
--file-basedoption toaspire init. Repositories can contain incidental.sln/.slnxfiles that makeaspire initprompt for a solution or scaffold a project-based AppHost even when the user only wants an empty, file-based AppHost at the repository root.--file-basedbypasses .NET solution discovery entirely and always creates the single-fileapphost.csscaffold. The option requires C# — selecting another language explicitly, via configuration, or at the language prompt fails with a clear error before scaffolding or persisting the language selection.This is a new CLI option with no prior documentation, so the
aspire initreference page needed to be updated.What changed
Updated
src/frontend/src/content/docs/reference/cli/commands/aspire-init.mdx:--file-basedto the Options list with a description matching the CLI's own--helptext.aspire init --file-based --language csharp.No new pages were created; only the existing
aspire-init.mdxpage was updated.