Add non-interactive and build-only modes for automation#191
Merged
prjseal merged 3 commits intoprjseal:feature/ai-agent-improvementsfrom Feb 11, 2026
Merged
Conversation
Adds three new CLI flags to support programmatic/automation use cases where PSW is invoked from other tools (e.g., MCP servers, CI/CD) and stdin may not be a TTY: - --no-run: Omits the 'dotnet run' command from the generated script, allowing install+build without starting the web server - --save-only: Writes the generated script to a file and exits immediately, bypassing all interactive Spectre.Console prompts - --output <file>: Specifies the output file path for --save-only Changes span the shared library (PackagesViewModel, ScriptGeneratorService), CLI models (CommandLineOptions, ScriptModel), and both CliModeWorkflow and TemplateWorkflow. https://claude.ai/code/session_01GjPpGbCY4XLHANx3eztDyz
Add the new automation flags to the Execution section of the command reference and include usage examples in the CLI Mode section. https://claude.ai/code/session_01GjPpGbCY4XLHANx3eztDyz
- CommandLineOptionsTests: 10 new tests covering parsing of --no-run, --save-only, --output flags, their HasAnyOptions() behavior, combined usage with other flags, and default values - ScriptModelTests: 3 new tests for SkipDotnetRun JSON serialization, deserialization, and default value; updated existing round-trip and all-properties tests to include SkipDotnetRun - ScriptModelExtensionsTests: New test file with 4 tests verifying ToViewModel() correctly maps SkipDotnetRun from ScriptModel to PackagesViewModel https://claude.ai/code/session_01GjPpGbCY4XLHANx3eztDyz
819532c
into
prjseal:feature/ai-agent-improvements
2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for non-interactive script generation and build-only execution modes, enabling the CLI to be used programmatically from other tools (e.g., MCP servers, CI/CD pipelines) and in automation scenarios where the web server should not be started.
Key Changes
Non-interactive Mode (
--save-only) - New flag that saves the generated script to a file (via--output <file>) and exits immediately without displaying interactive prompts or awaiting user input. This enables integration with tools that don't have TTY access.Build-only Mode (
--no-run) - New flag that skips thedotnet runcommand from the generated script. When combined with--auto-run, this allows installing and building an Umbraco project without starting the web server.Script Output File (
--output <file>) - New option to specify the output file path for saving generated scripts, used in conjunction with--save-only.Implementation across workflows - Added
--no-runand--save-onlyhandling in:CliModeWorkflow.cs(default and custom script generation, community templates)TemplateWorkflow.cs(template-based script generation)CommandLineOptions.cs(argument parsing and validation)Script generation updates - Modified
ScriptGeneratorService.csto conditionally include thedotnet runcommand based on theSkipDotnetRunflag in the model.Data model extensions - Added
SkipDotnetRunproperty to:PackagesViewModel(shared model)ScriptModel(API model)ScriptModelExtensions.csto map the propertyUI/Documentation - Updated help text in
ConsoleDisplay.cswith new flags and added automation examples showing practical use cases.Changelog - Documented new features in
CHANGELOG.md.Notable Implementation Details
SaveScriptToFileAsync()method is implemented identically in bothCliModeWorkflow.csandTemplateWorkflow.csto handle directory creation and file writing with appropriate logging and user feedback.--no-runflag is applied consistently across all script generation paths by settingmodel.SkipDotnetRun = true.--save-onlyflag causes early return after script generation, bypassing all interactive prompts and script execution logic.--save-onlyrequires--outputto be specified, with appropriate exit code setting.https://claude.ai/code/session_01GjPpGbCY4XLHANx3eztDyz