Skip to content

Add astro dev --background to CLI reference#13949

Merged
ArmandPhilippot merged 10 commits into
v7from
background-dev
Jun 8, 2026
Merged

Add astro dev --background to CLI reference#13949
ArmandPhilippot merged 10 commits into
v7from
background-dev

Conversation

@matthewp

@matthewp matthewp commented May 27, 2026

Copy link
Copy Markdown
Contributor

Description (required)

Adds documentation for the new astro dev --background flag and astro dev stop, astro dev status, and astro dev logs subcommands for managing background dev servers. Also documents the /_astro/status health endpoint and automatic agent detection behavior.

Related issues & labels (optional)

This is for Astro 7.

@netlify

netlify Bot commented May 27, 2026

Copy link
Copy Markdown

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit 711423c
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/6a189a143bdd490008f547df
😎 Deploy Preview https://deploy-preview-13949--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread src/content/docs/en/reference/cli-reference.mdx Outdated
@astrobot-houston

astrobot-houston commented May 27, 2026

Copy link
Copy Markdown
Contributor

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/build-with-ai.mdx Source changed, localizations will be marked as outdated.
en/reference/cli-reference.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

Comment thread src/content/docs/en/reference/cli-reference.mdx Outdated
@matthewp matthewp marked this pull request as ready for review May 27, 2026 20:05

@ArmandPhilippot ArmandPhilippot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the content looks good to me! My only concern is the organization:

We are mixing flags, subcommands and "general" information.

Because this is a reference page, maybe we can organize it this way to be consistent:

h2: astro dev
  h3: Flags
    h4: --background
  h3: Subcommands
    h4: astro dev stop
    h4: astro dev status
    h4: astro dev log
      h5: Flags
        h6: --follow

And "Background mode for AI coding agents" might be more helpful on https://docs.astro.build/en/guides/build-with-ai/ with a link to the reference for the available flags and subcommands?

Remains "Health endpoint"... unless you can think of another use case than AI, maybe this also belong to https://docs.astro.build/en/guides/build-with-ai/


<p><Since v="7.0.0" /></p>

Starts the dev server as a detached background process. This is the flag that is used automatically when an AI agent is detected, but it can also be used manually.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wording sounds a bit unnecessarily verbose ("this is the flag that is..."):

Suggested change
Starts the dev server as a detached background process. This is the flag that is used automatically when an AI agent is detected, but it can also be used manually.
Starts the dev server as a detached background process. This flag is provided automatically when an AI agent is detected. You can also use it manually:

But, if we move "Background mode for AI coding agents" to the "Build with AI" page, the second sentence should probably link to /en/guides/build-with-ai/#background-mode-for-ai-coding-agents.

@ArmandPhilippot ArmandPhilippot added 7.0 add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. labels May 28, 2026
@ArmandPhilippot ArmandPhilippot added this to the v7 milestone May 28, 2026
@ArmandPhilippot

Copy link
Copy Markdown
Member

Ah, and it seems this is already a bit outdated, but it would be nice to update the latest code snippet in https://docs.astro.build/en/reference/cli-reference/#astro-commands to reflect what pnpm dev --help actually prints now that the format (options/subcommands) is also changing.

@matthewp matthewp changed the title Add background dev server subcommands to CLI reference Add astro dev --background to CLI reference May 28, 2026
- Restructure CLI reference with proper Flags/Subcommands headings
- Move background mode and health endpoint to Build with AI guide
- Update astro dev --help output to include new commands/flags
- Add cross-references between the two pages
Comment thread src/content/docs/en/reference/cli-reference.mdx
Comment thread src/content/docs/en/reference/cli-reference.mdx
Comment thread src/content/docs/en/reference/cli-reference.mdx Outdated
@matthewp

Copy link
Copy Markdown
Contributor Author

@ArmandPhilippot reorganized

@ArmandPhilippot ArmandPhilippot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a nit to keep the TOC consistent:

Otherwise, LGTM!

Comment thread src/content/docs/en/reference/cli-reference.mdx Outdated
Comment thread src/content/docs/en/reference/cli-reference.mdx Outdated
matthewp and others added 2 commits May 28, 2026 15:39
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
@ArmandPhilippot ArmandPhilippot added the merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!) label Jun 5, 2026
@ArmandPhilippot ArmandPhilippot merged commit a4650b3 into v7 Jun 8, 2026
12 checks passed
@ArmandPhilippot ArmandPhilippot deleted the background-dev branch June 8, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

7.0 add new content Document something that is not in docs. May require testing, confirmation, or affect other pages. merge-on-release Don't merge this before the feature is released! (MQ=approved but WAIT for feature release!)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants