Skip to content

Add non-interactive and build-only modes for automation#191

Merged
prjseal merged 3 commits intoprjseal:feature/ai-agent-improvementsfrom
hifi-phil:claude/psw-non-interactive-mode-92DcS
Feb 11, 2026
Merged

Add non-interactive and build-only modes for automation#191
prjseal merged 3 commits intoprjseal:feature/ai-agent-improvementsfrom
hifi-phil:claude/psw-non-interactive-mode-92DcS

Conversation

@hifi-phil
Copy link

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 the dotnet run command 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-run and --save-only handling 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.cs to conditionally include the dotnet run command based on the SkipDotnetRun flag in the model.

  • Data model extensions - Added SkipDotnetRun property to:

    • PackagesViewModel (shared model)
    • ScriptModel (API model)
    • Updated ScriptModelExtensions.cs to map the property
  • UI/Documentation - Updated help text in ConsoleDisplay.cs with new flags and added automation examples showing practical use cases.

  • Changelog - Documented new features in CHANGELOG.md.

Notable Implementation Details

  • The SaveScriptToFileAsync() method is implemented identically in both CliModeWorkflow.cs and TemplateWorkflow.cs to handle directory creation and file writing with appropriate logging and user feedback.
  • The --no-run flag is applied consistently across all script generation paths by setting model.SkipDotnetRun = true.
  • The --save-only flag causes early return after script generation, bypassing all interactive prompts and script execution logic.
  • Error handling ensures --save-only requires --output to be specified, with appropriate exit code setting.

https://claude.ai/code/session_01GjPpGbCY4XLHANx3eztDyz

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
@prjseal prjseal changed the base branch from main to feature/ai-agent-improvements February 11, 2026 20:06
@prjseal prjseal merged commit 819532c into prjseal:feature/ai-agent-improvements Feb 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants