Skip to main content
Version: 0.8.0

Project Templates

Sharkable ships a dotnet new project template so you can scaffold a working service in seconds — with OpenAPI, Scalar UI, health checks, idempotency and auto-wrap pre-configured.

Install

dotnet new install Sharkable.Templates

Create a project

dotnet new sharkable-webapi -o MyService
cd MyService
dotnet run

That's it. The generated app listens on the default Kestrel port with:

URLPurpose
/api/helloExample endpoint (auto-wrapped UnifiedResult envelope)
/healthzReadiness probe
/livezLiveness probe
/openapi/v1.jsonOpenAPI document
/scalar/v1Scalar UI (interactive API explorer)

What's inside

MyService/
├── Program.cs # AddShark + UseShark + source-gen JSON context
├── Endpoints/HelloEndpoint.cs # Example ISharkEndpoint
├── SharkableWebApi.csproj # net10.0 + Sharkable package
├── rd.xml # Native AOT type retention
└── appsettings.json

The template enables:

  • EnableAutoWrap — plain returns wrapped in UnifiedResult<T>
  • EnableHealthChecks/healthz + /livez
  • EnableIdempotencyIdempotency-Key support
  • Source-generated JSON (AppJsonContext) — ready for Native AOT

Native AOT

The template is Native AOT-ready out of the box:

dotnet publish -c Release -r osx-arm64 -p:PublishAot=true

rd.xml retains the app assembly's types so ISharkEndpoint discovery and attribute-based DI registration survive trimming. Add your request/response types to AppJsonContext as you grow the API.

Uninstall

dotnet new uninstall Sharkable.Templates