Skip to content

feat(run): add --except to run every service but the named ones#513

Open
jongio wants to merge 1 commit into
mainfrom
idea/run-except
Open

feat(run): add --except to run every service but the named ones#513
jongio wants to merge 1 commit into
mainfrom
idea/run-except

Conversation

@jongio

@jongio jongio commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Adds --except to azd app run so you can start every service and skip only the one(s) you name. It is the complement to --service: one names what runs, the other names what to leave out.

# Start everything except the worker
azd app run --except worker

# Skip several services
azd app run --except worker,cache

This is handy when a project has one heavy or noisy service you do not want locally (a background worker, a scheduled job) but you still want everything else, without having to spell out the full list in --service.

Behavior

  • --service and --except are mutually exclusive. Passing both returns a clear error instead of guessing.
  • An unknown name passed to --except fails with the list of available services, so a typo does not silently start more than you intended.
  • Excluding every service reports that nothing remains to run.
  • The existing --service behavior is unchanged.

Details

  • The selection logic lives in selectRunServices / excludeServices, kept separate from the run flow so it is unit tested without spinning anything up.
  • The mutual-exclusion check runs early in runWithServices, before any dependency or trust work, so it fails fast.
  • --except gets service-name shell completion, same as --service.

Testing

  • go build ./...
  • go vet ./src/cmd/app/commands/...
  • go test ./src/cmd/app/commands/ -count=1 -short
  • golangci-lint run ./src/cmd/app/commands/...

Closes #508

Add a `--except` flag to `azd app run` as the complement of `--service`.
It starts every service except the comma-separated names given. The two flags
are mutually exclusive, and an unknown excluded name fails with the list of
available services so a typo does not silently run more than intended.

Closes #508

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jongio jongio added the idea Feature idea from the idea pipeline label Jul 13, 2026
@jongio jongio self-assigned this Jul 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Website Preview

Your PR preview is ready!

📎 Preview URL: https://jongio.github.io/azd-app/pr/513/

This preview will be automatically cleaned up when the PR is closed.

github-actions Bot added a commit that referenced this pull request Jul 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Test This PR

A preview build (0.19.5-pr513) is ready for testing!

🌐 Website Preview

Live Preview: https://jongio.github.io/azd-app/pr/513/

One-Line Install (Recommended)

PowerShell (Windows):

iex "& { $(irm https://raw.githubusercontent.com/jongio/azd-app/main/cli/scripts/install-pr.ps1) } -PrNumber 513 -Version 0.19.5-pr513"

Bash (macOS/Linux):

curl -fsSL https://raw.githubusercontent.com/jongio/azd-app/main/cli/scripts/install-pr.sh | bash -s 513 0.19.5-pr513

Uninstall

When you're done testing:

PowerShell (Windows):

iex "& { $(irm https://raw.githubusercontent.com/jongio/azd-app/main/cli/scripts/uninstall-pr.ps1) } -PrNumber 513"

Bash (macOS/Linux):

curl -fsSL https://raw.githubusercontent.com/jongio/azd-app/main/cli/scripts/uninstall-pr.sh | bash -s 513

Build Info:

What to Test:
Please review the PR description and test the changes described there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

idea Feature idea from the idea pipeline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add run --except flag to run all services except named ones

1 participant