Fix build, add CI workflows, global tool packaging, and cross-platform improvements - #11
Merged
Conversation
CommandHandler.Create moved from System.CommandLine.Invocation to System.CommandLine.NamingConventionBinder in beta4. Add the package reference and update the using statement. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Document the three built-in Barn plugin commands (LaunchApplication, ShowCPUUsage, SnakeGame) with descriptions and usage examples. Add a table of contents for easier navigation. Update CLI commands table with the new profile, info, and brightness commands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The commands already use device-aware properties (ButtonResolution, ButtonColumns, ButtonRows) instead of hardcoded XL values, so they work on any model. Add CompatibleWith attributes for all nine supported devices. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Configure the project as a .NET global tool (PackAsTool, ToolCommandName) so users can install with 'dotnet tool install -g DeckSurf'. Add a ProjectReference to Barn so it ships with the tool. Update the Loader to scan both plugins/ subdirectory and the executable's own directory, supporting both local dev and global tool flat layouts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CI: Add pr-validation.yml for PR builds, publish-package.yml for tag-based NuGet publishing, and simplify build.yaml for main branch. All workflows now run on ubuntu-latest with concurrency controls. LaunchApplication: Extract Windows-specific icon loading behind OperatingSystem.IsWindows() guard with [SupportedOSPlatform] attribute. On non-Windows platforms, falls back to using an image file if the command argument is an image, or sets a colored key. Process.Start with UseShellExecute already works cross-platform. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- SnakeGame: initialize _columns=8 and _rows=4 as defaults to prevent divide-by-zero if ExecuteOnAction is called before ExecuteOnActivation - ShowCPUUsage: dispose PerformanceCounter with using statement - Directory.Build.props: disable nullable since codebase isn't annotated - Standardize workflow working-directory paths (remove leading ./) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move snake initialization from constructor to ExecuteOnActivation where the real device dimensions are known. Cap initial snake length to fit within the device's first row (min 3 segments or column count, whichever is smaller). Fixes incorrect behavior on Mini (3x2) and other non-XL devices. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Metadata: Fix copyright year in DeckSurf.csproj (2021 -> 2021-2026), update Barn plugin version to 0.0.2 and website URL to decksurf repo. Security: Disable UseShellExecute in LaunchApplication to prevent shell injection. Add path traversal guard in profile delete command. CI: Switch all workflows to windows-latest (System.Drawing requires Windows). Add explicit restore steps. Fix publish tag regex (remove trailing wildcard). Use PowerShell-compatible env vars in publish. Code quality: Enable .NET analyzers with latest analysis level. Expand .editorconfig with naming, formatting, and indentation rules. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The entire class uses System.Drawing and PerformanceCounter which are
Windows-only. Apply [SupportedOSPlatform("windows")] at the class
level instead of suppressing CA1416 on individual methods, so the
analyzer correctly understands all call sites are Windows-guarded.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use consistent sentence structure: verb phrase describing what the command does, mention Stream Deck context, note platform limitations where applicable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add CpuMonitor helper with platform-specific system-wide CPU
measurement: PerformanceCounter on Windows, /proc/stat parsing on
Linux, and top command output parsing on macOS. No new package
dependencies.
ShowCPUUsage now works on all platforms. On Windows, renders text
percentage on the button. On macOS/Linux, uses a green-to-red color
gradient to indicate CPU load. Remove [SupportedOSPlatform("windows")]
class-level restriction.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
CLI structure: Reorganize flat commands into consistent nested groups:
- deck devices {list, info, brightness}
- deck plugins {list}
- deck profiles {list, show, delete}
- deck write, deck listen (top-level actions)
Add root command description so 'deck --help' is informative. Add
empty-state messages with next-step guidance throughout (no devices,
no plugins, no profiles). Add success confirmation to write command
with 'run deck listen' suggestion. Fix option aliases (-g -> -a for
action-args, -l -> -n for plugin, -b -> -l for brightness level).
LaunchApplication: Use platform-specific launchers — 'open' on macOS
for .app bundles, 'xdg-open' on Linux for desktop files, direct
Process.Start on Windows.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update Barn plugin usage examples from -l/-g to -n/-a, and refresh option descriptions in the usage block to match Program.cs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
System.CommandLine.NamingConventionBinderpackage (CommandHandler.Create moved there in beta4)dotnet tool install -g DeckSurf) with Barn plugin includedTest plan
dotnet packproduces a valid .nupkg with Barn plugin includeddotnet tool installfrom local nupkg makesdeckavailable globally🤖 Generated with Claude Code