Skip to content

Install the tool and create a project

Every StayFn release publishes to GitHub Packages (https://nuget.pkg.github.com/rizanc/index.json), at the product version:

Package Contents
stayfn (.NET tool) the CLI with the host, the reference functions, the OHIP specs and the dashboard: stayfn dev, mcp stdio, new …, catalog export, ohip ping from any folder
StayFn.Abstractions, StayFn.Ohip.Generated function contracts, the generated OHIP models and ctx.Ohip.Api
StayFn.Events (with StayFn.Runtime, StayFn.Data, StayFn.Ohip) typed event contracts for handlers
StayFn.Testing FunctionTestHost for function tests
StayFn.Analyzers the design rules, code fixes and the typed function client generator
StayFn.Client the runtime of SDKs from stayfn sdk generate

1. Feed access. GitHub Packages needs a token even to read. Ask StayFn for access, create a personal access token (classic) with the read:packages scope, and either store it once in your user-level NuGet configuration:

Terminal window
dotnet nuget add source https://nuget.pkg.github.com/rizanc/index.json --name stayfn-github \
--username <your GitHub user name> --password <token> --store-password-in-clear-text

or export it for the nuget.config that stayfn new project writes (it reads these two variables and never stores a token):

Terminal window
export STAYFN_FEED_USERNAME=<your GitHub user name> STAYFN_FEED_TOKEN=<token>

2. The tool. ~/.dotnet/tools must be on your PATH.

Terminal window
dotnet tool install -g stayfn --add-source https://nuget.pkg.github.com/rizanc/index.json
stayfn --help

Update with dotnet tool update -g stayfn --add-source ….

3. A project.

Terminal window
stayfn new project MyHotelFunctions
cd MyHotelFunctions
dotnet test # restores the SDK packages, builds, runs the sample's tests
cp .env.example .env # fill in OHIP_SANDBOX_* for functions that call OHIP
stayfn dev # PostgreSQL via docker compose, the host from the tool on :5080
curl -s -X POST http://localhost:5080/api/functions/custom/ping/invoke -H 'Content-Type: application/json' -d '{"message":"hi"}'

The project has functions/ (your functions, StayFnVersion in Directory.Build.props), tests/, docker-compose.yml with the host’s init.sql, .env.example, .mcp.json for Claude Code and .vscode/settings.json. Add functions with stayfn new function … [--operation rsv.getReservation] or the extension’s wizard.

4. Editors. Install the StayFn extension in VS Code and open the folder: its walkthrough repeats these steps, and Start Dev Host uses the installed tool. Claude Code picks up .mcp.json.

stayfn equivalence run and the Kiota regeneration still need the repository. To try the packages before a release, pack them and point a project at the folder: dotnet pack StayFn.sln -c Release -o ./packages, then stayfn new project Demo --feed ./packages --sdk-version &lt;version> (CI does exactly this in DistributionProofTests).