Skip to content

Add skillserver CLI tool with unified release pipeline#56

Merged
Aaronontheweb merged 6 commits intodevfrom
feature/skillserver-cli
May 5, 2026
Merged

Add skillserver CLI tool with unified release pipeline#56
Aaronontheweb merged 6 commits intodevfrom
feature/skillserver-cli

Conversation

@Aaronontheweb
Copy link
Copy Markdown
Contributor

Summary

  • Add skillserver CLI tool for publishing and managing skills on a SkillServer instance, distributed as both a .NET global tool and standalone trimmed binaries (linux-x64, linux-arm64, osx-arm64, win-x64)
  • Consolidate publish_nuget.yml and publish_container.yml into a single coordinated release.yml that builds NuGet packages, CLI binaries, and container images in parallel, then publishes everything in a gated final stage
  • Extend Netclaw.SkillClient with UploadSkillIfNotExistsAsync for idempotent publishes and UploadSkillWithResourcesAsync for resource file support

CLI Commands

publish, publish-all, delete, list, versions, verify, config, api-key

CI/CD

  • Unified release.yml replaces three separate tag-triggered workflows
  • pr_validation.yml gains CLI trimmed publish dry-run with trim warning checks, smoke tests, shellcheck, and PowerShell syntax linting
  • Install scripts for Linux/macOS (install-skillserver.sh) and Windows (install-skillserver.ps1)

Code Quality

  • Value types (ScannedResource, PublishOptions, ResolvedConfig) are readonly record struct
  • All classes sealed, JsonSerializerContext sealed
  • HandleHttpError helper eliminates duplicate catch blocks
  • VerboseLoggingHandler for --verbose HTTP logging
  • Resource verification parallelized with Task.WhenAll

Test plan

  • 35 CLI unit tests (arg parsing, config resolution, directory scanning)
  • 32 integration tests (10 end-to-end workflow tests via SkillServerClient against WebApplicationFactory)
  • 50 existing server tests still pass
  • Trimmed self-contained publish succeeds (14MB binary)
  • Binary smoke test (--version, --help)
  • NuGet pack includes correct CLI-specific README
  • shellcheck passes on install script
  • 0 slopwatch violations

Introduce Netclaw.SkillServer.Cli, a .NET global tool for managing
skills on a SkillServer instance. Supports publish, batch publish,
delete, list, search, verify, config, and API key management.

Key capabilities:
- Publish skill directories (SKILL.md + resource files) with idempotent
  skip-on-conflict behavior and --force for re-publishing
- Batch publish all skills in a directory via publish-all
- Auth resolution: CLI flags > env vars > config file
- AOT-compatible with hand-rolled YAML frontmatter parser
- Distributable as dotnet global tool (PackAsTool)

Also extends Netclaw.SkillClient with resource upload support
(UploadSkillWithResourcesAsync) and API key management methods.
…ishOptions

- Consolidate UploadSkillWithResourcesAsync to delegate to the Try
  variant instead of duplicating multipart form construction
- Extract PublishOptions record to replace boolean parameter sprawl
- Unify dry-run handling in PublishOrchestrator with shared formatting
- Deduplicate command dispatch into single DispatchAsync method
- Change all CLI types to internal (InternalsVisibleTo covers tests)
- Fix HttpResponseMessage leak in PublishOrchestrator
- Use stream.Length instead of redundant FileInfo allocations
- Remove explanatory WHAT comments per project conventions
…tsAsync

- Remove TryUploadSkillWithResourcesAsync (exposed raw HttpResponseMessage)
- Add UploadSkillIfNotExistsAsync returning SkillUploadResponse? (null = 409)
- Extract PostSkillAsync as private helper to eliminate form-building duplication
- Seal SkillServerClientJsonContext
- Convert ScannedResource, PublishOptions, ResolvedConfig to readonly record structs
Exercise full CLI workflows against a real in-process SkillServer:
publish, list, versions, verify, delete, idempotent upload, force
republish, resource uploads, multi-version tracking, search, digest
verification, and API key management.

Add AuthenticatedClient to SkillServerFixture to separate read
operations (no auth) from write operations (auth required).
Extract HandleHttpError helper to ConsoleOutput, replacing 5 identical
catch blocks across ApiKeyCommand, DeleteCommand, and VerifyCommand.
Parallelize resource verification in VerifyCommand using Task.WhenAll.
Change IsTty to static readonly field. Remove explanatory comments.
Consolidate publish_nuget.yml and publish_container.yml into a single
release.yml that builds NuGet packages, CLI binaries (linux-x64,
linux-arm64, osx-arm64, win-x64), and container images in parallel,
then publishes everything in a coordinated final stage.

Add install scripts for Linux/macOS (bash) and Windows (PowerShell)
that download platform binaries from GitHub Releases.

Enable trimming for self-contained CLI publishes (38MB -> 14MB). Add
VerboseLoggingHandler for --verbose HTTP request/response logging.

Update pr_validation.yml with trim warning checks, smoke tests, and
shellcheck/PowerShell linting. Add CLI README for NuGet package page
and update root README with component overview.
@Aaronontheweb Aaronontheweb force-pushed the feature/skillserver-cli branch from 90b7578 to a3a254f Compare May 5, 2026 01:00
@Aaronontheweb Aaronontheweb merged commit 8b846db into dev May 5, 2026
7 checks passed
@Aaronontheweb Aaronontheweb deleted the feature/skillserver-cli branch May 5, 2026 01:04
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.

1 participant