Problem
DotNetRunBuilder supports RunAsync and CaptureAsync, but does not appear to support RunAndCaptureAsync.
This creates a gap compared with Shell.Builder("dotnet") for interactive CLI workflows that need both:
- live streamed output while the command runs
- captured output/result details for failure reporting
Concrete use case
In timewarp-jaribu, tools/dev-cli/endpoints/test-command.cs runs the CI-safe runfile test runner:
CommandOutput result = await Shell.Builder("dotnet")
.WithArguments
(
"run",
ciTestRunner,
"/p:ExperimentalFileBasedProgramEnableTransitiveDirectives=true"
)
.WithWorkingDirectory(RepoRoot)
.WithNoValidation()
.RunAndCaptureAsync(Ct);
We refactored workflow-command.cs to use typed builders such as DotNet.Clean, DotNet.Build, DotNet.Run().WithFile(...), and DotNet.Pack, but left test-command.cs on Shell.Builder("dotnet") because DotNet.Run() cannot currently preserve the same behavior.
CaptureAsync would capture silently and lose live progress output. RunAsync would stream output but lose captured details such as result.Combined and result.Success.
Requested API
Add RunAndCaptureAsync(CancellationToken) support to DotNetRunBuilder, matching the behavior available from ShellBuilder and other typed command builders where applicable.
Expected benefit
This would allow projects to consistently use typed DotNet.* builders for dotnet run commands, including .NET 10 file-based app/runfile execution via WithFile(...), without sacrificing interactive CLI UX or error reporting.
Problem
DotNetRunBuildersupportsRunAsyncandCaptureAsync, but does not appear to supportRunAndCaptureAsync.This creates a gap compared with
Shell.Builder("dotnet")for interactive CLI workflows that need both:Concrete use case
In
timewarp-jaribu,tools/dev-cli/endpoints/test-command.csruns the CI-safe runfile test runner:We refactored
workflow-command.csto use typed builders such asDotNet.Clean,DotNet.Build,DotNet.Run().WithFile(...), andDotNet.Pack, but lefttest-command.csonShell.Builder("dotnet")becauseDotNet.Run()cannot currently preserve the same behavior.CaptureAsyncwould capture silently and lose live progress output.RunAsyncwould stream output but lose captured details such asresult.Combinedandresult.Success.Requested API
Add
RunAndCaptureAsync(CancellationToken)support toDotNetRunBuilder, matching the behavior available fromShellBuilderand other typed command builders where applicable.Expected benefit
This would allow projects to consistently use typed
DotNet.*builders fordotnet runcommands, including .NET 10 file-based app/runfile execution viaWithFile(...), without sacrificing interactive CLI UX or error reporting.