Add agent-automation CLI flags to the Viewer#146
Merged
Conversation
…apture, render-state, logging)
Copilot created this pull request from a session on behalf of
philliphoff
May 30, 2026 19:03
View session
Spectre.Console.Cli rejects ',', 'x', and '|' inside the <NAME> portion of CommandOption templates, so 'viewer --help' threw 'Encountered invalid character ... in value name'. Use simple identifiers (<SIZE>, <LATLON>, <BBOX>, <STEP>); the descriptions still document the expected format. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Performance Gate✅ PASSED — no regressions. Threshold: 10.0%, MAD multiplier (k): 3.0, retry-zone mult: 2.0× Scenario summary
exchange-set-openIteration statistics
Spans (sum of all iterations)
Metrics
s101-portray-coldIteration statistics
Spans (sum of all iterations)
Metrics
s101-portray-warmIteration statistics
Spans (sum of all iterations)
Metrics
s101-render-warmIteration statistics
Spans (sum of all iterations)
Metrics
s102-coverageIteration statistics
Spans (sum of all iterations)
Metrics
s102-coverage-openIteration statistics
Spans (sum of all iterations)
Metrics
s102-coverage-render-largeIteration statistics
Spans (sum of all iterations)
Metrics
s124-vectorIteration statistics
Spans (sum of all iterations)
Metrics
s201-vectorIteration statistics
Spans (sum of all iterations)
Metrics
Generated by EncDotNet.S100.PerfReport gate command |
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
The Viewer could only be driven through its GUI, so an agent could not launch it with a dataset, frame a known state, talk to it over MCP, or capture diagnostics without manual interaction — and any scripted run wrote MCP ports and palette/category overrides back into the user's real profile. This adds additive CLI flags to make those loops scriptable while keeping the bare
viewer <datasets>invocation unchanged.--mcp,--mcp-port,--mcp-bind,--mcp-port-file(any MCP flag implies--mcp). The bound endpoint is written to the port-file and echoed to stdout ([MCP] listening on …) for ephemeral-port discovery. CLI-driven MCP runs never persist the bound port back tosettings.json.--settings <PATH>(alternate file) and--ephemeral(throwaway, never written back) keep the real profile pristine and let parallel runs avoid collisions.--center/--zoomand--bbox, applied after load, suppress auto-zoom-to-extent.--exit-after-screenshot,--full-window,--window-size.--palette,--display-category,--time-stepoverride persisted values for the run only.--log-file,-v/--verbose, and a configurable--crash-log(no longer hardcoded/tmp/viewer-crash.log).Override-layering lives in a GUI-free
StartupSettingsFactory; MCP no-persist/endpoint-publish lives inMcpServerHost; viewport/screenshot/time-step orchestration is inMainWindow.RunStartupAutomationAsync.Deferred as optional follow-ups: a headless
--dump-featuresand a Spectre subcommand restructure.Spec alignment
Check each spec this PR touches and confirm the relevant skill was
consulted (
.github/skills/<spec>/SKILL.md):s100-framework)s101-enc)s102-bathymetry)s104-water-level)s111-surface-currents)s124-nav-warnings)s129-ukc)Spec section references cited in code/docs:
N/A — viewer tooling only.
Tests
tests/SkippableFactdotnet test --configuration Releasepasses locallyAdded
ViewerCommandSettingsTests,StartupSettingsFactoryTests, andMcpServerHostCommandLineTests(42 new; 468 viewer tests pass). GUI-coupled behavior (viewport, screenshot timing, window-size, time-step re-render) was code-reviewed but not executed — no display in CI.Documentation
src/<project>/README.mddocs/if user-facing behaviourchanged
Added "Automation / agent control" sections (flag table + end-to-end walkthrough) to
src/EncDotNet.S100.Viewer/README.mdanddocs/mcp-server.md.Dependencies
Directory.Packages.props(not in the.csproj)gh-advisory-databasesecurity check run for any new dependencyBreaking changes
None. All flags are additive;
viewer <datasets>and the GUI MCP toggle behave as before. The MCP port is now persisted only for GUI/settings-driven runs, not CLI-driven ones.