Skip to content

CLI help

The --help output of every command of the stayfn tool 0.8.1. See CLI commands for exit codes and examples.

Description:
stayfn — StayFn developer tool
Usage:
stayfn [command] [options]
Options:
-?, -h, --help Show help and usage information
--version Show version information
Commands:
new Scaffold from the shared MCP templates: the class, its WireMock tests and a catalog doc stub; or a whole tenant project (exit 0 written, 1 refused, 2 usage)
catalog Function catalog commands
sdk Caller SDK commands
replay Replay a dead letter through the admin API (exit 0 enqueued, 1 refused, 2 configuration)
ohip OHIP connectivity commands
dev Run the local dev host: PostgreSQL (docker compose when needed), the host in the Development profile with the dev tenant and /api/dev/*, rebuilds on change, a dev token in .stayfn/dev-token
mcp Model Context Protocol server for AI authoring
equivalence OPERA 5 vs OHIP equivalence harness
Description:
Scaffold from the shared MCP templates: the class, its WireMock tests and a catalog doc stub; or a whole tenant project (exit 0 written, 1 refused, 2 usage)
Usage:
stayfn new [command] [options]
Options:
-?, -h, --help Show help and usage information
Commands:
function <name> An invokable [OhipFunction]
handler <name> An [EventHandler] (needs --event)
scheduled <name> A scheduled [OhipFunction] (needs --schedule)
project <name> A ready tenant repository: functions and tests projects on the SDK packages, a sample function with its test, docker-compose PostgreSQL, .env.example, .mcp.json, nuget.config, VS Code settings (exit 0 written, 1 refused, 2 usage)
Description:
An invokable [OhipFunction]
Usage:
stayfn new function <name> [options]
Arguments:
<name> Kebab-case name (handlers: the method, e.g. on-vip-changed)
Options:
--area <area> Area: an OHIP module code (rsv, crm, …) or a kebab-case tenant area
--description <description> Catalog description
--input <input> Input member name:type (? = optional, [] = list); repeat
--output <output> Output member name:type; repeat
--operation <operation> OHIP operation to start from (as catalog.search / ohip.operation name it)
--event <event> Event name of a handler, e.g. reservation.changed
--schedule <schedule> 6-field cron of a scheduled function, e.g. "0 0 2 * * *"
--dir <dir> Class directory relative to --root
--tests-dir <tests-dir> Tests directory relative to --root
--docs-dir <docs-dir> Doc stub directory relative to --root
--namespace <namespace> Root namespace
--overwrite Replace existing files
--root <root> The only directory files are written under (default: the repository root)
--specs <specs> Committed OHIP specs (default: <repo>/tools/ohip-specs/26.3.0.0, else the snapshot shipped with the tool)
-?, -h, --help Show help and usage information
Description:
An [EventHandler] (needs --event)
Usage:
stayfn new handler <name> [options]
Arguments:
<name> Kebab-case name (handlers: the method, e.g. on-vip-changed)
Options:
--area <area> Area: an OHIP module code (rsv, crm, …) or a kebab-case tenant area
--description <description> Catalog description
--input <input> Input member name:type (? = optional, [] = list); repeat
--output <output> Output member name:type; repeat
--operation <operation> OHIP operation to start from (as catalog.search / ohip.operation name it)
--event <event> Event name of a handler, e.g. reservation.changed
--schedule <schedule> 6-field cron of a scheduled function, e.g. "0 0 2 * * *"
--dir <dir> Class directory relative to --root
--tests-dir <tests-dir> Tests directory relative to --root
--docs-dir <docs-dir> Doc stub directory relative to --root
--namespace <namespace> Root namespace
--overwrite Replace existing files
--root <root> The only directory files are written under (default: the repository root)
--specs <specs> Committed OHIP specs (default: <repo>/tools/ohip-specs/26.3.0.0, else the snapshot shipped with the tool)
-?, -h, --help Show help and usage information
Description:
A scheduled [OhipFunction] (needs --schedule)
Usage:
stayfn new scheduled <name> [options]
Arguments:
<name> Kebab-case name (handlers: the method, e.g. on-vip-changed)
Options:
--area <area> Area: an OHIP module code (rsv, crm, …) or a kebab-case tenant area
--description <description> Catalog description
--input <input> Input member name:type (? = optional, [] = list); repeat
--output <output> Output member name:type; repeat
--operation <operation> OHIP operation to start from (as catalog.search / ohip.operation name it)
--event <event> Event name of a handler, e.g. reservation.changed
--schedule <schedule> 6-field cron of a scheduled function, e.g. "0 0 2 * * *"
--dir <dir> Class directory relative to --root
--tests-dir <tests-dir> Tests directory relative to --root
--docs-dir <docs-dir> Doc stub directory relative to --root
--namespace <namespace> Root namespace
--overwrite Replace existing files
--root <root> The only directory files are written under (default: the repository root)
--specs <specs> Committed OHIP specs (default: <repo>/tools/ohip-specs/26.3.0.0, else the snapshot shipped with the tool)
-?, -h, --help Show help and usage information
Description:
A ready tenant repository: functions and tests projects on the SDK packages, a sample function with its test, docker-compose PostgreSQL, .env.example, .mcp.json, nuget.config, VS Code settings (exit 0 written, 1 refused, 2 usage)
Usage:
stayfn new project <name> [options]
Arguments:
<name> Project name: dot-separated C# identifiers, e.g. MyHotelFunctions
Options:
--dir <dir> Target directory (default ./<name>); must not exist or be empty
--feed <feed> Package source of the StayFn packages written into nuget.config: a URL or a local folder (default GitHub Packages, token from STAYFN_FEED_TOKEN)
--sdk-version <sdk-version> StayFn SDK package version (default: this tool's version)
-?, -h, --help Show help and usage information
Description:
Function catalog commands
Usage:
stayfn catalog [command] [options]
Options:
-?, -h, --help Show help and usage information
Commands:
export Export the function catalog as sorted, timestamp-free JSON or markdown
Description:
Export the function catalog as sorted, timestamp-free JSON or markdown
Usage:
stayfn catalog export [options]
Options:
--format <format> json (default) or markdown [default: json]
--operations Include the OHIP operation rows (≈2,850)
--assemblies <assemblies> Additional function assemblies (the reference set is always included)
--out <out> Write to this file instead of stdout
-?, -h, --help Show help and usage information
Description:
Caller SDK commands
Usage:
stayfn sdk [command] [options]
Options:
-?, -h, --help Show help and usage information
Commands:
generate Generate a typed caller SDK (exit 0 written, 1 host refused or unreachable, 2 usage)
Description:
Generate a typed caller SDK (exit 0 written, 1 host refused or unreachable, 2 usage)
Usage:
stayfn sdk generate [options]
Options:
--lang <lang> (REQUIRED) csharp (types + StayFnClient over the stayfnent package) or typescript (Node 18+ ES module, no dependencies)
--area <area> Only these areas; repeat
--out <out> Output directory (default ./StayFn.Sdk or ./stayfn-client)
--from <from> Base URL of a running host; the catalog is read with a functions:read key (default: offline from the assemblies)
--api-key <api-key> Tenant API key for --from (default STAYFN_API_KEY); never printed
--assemblies <assemblies> Additional function assemblies for the offline catalog (the reference set is always included)
--namespace <namespace> C# namespace (default StayFn.Sdk)
--client-name <client-name> C# client class (default StayFnClient)
--package-name <package-name> npm package name (default stayfn-client)
-?, -h, --help Show help and usage information
Description:
Replay a dead letter through the admin API (exit 0 enqueued, 1 refused, 2 configuration)
Usage:
stayfn replay [options]
Options:
--dead-letter <dead-letter> (REQUIRED) Id of the dead letter to replay
--tenant <tenant> Tenant id (for a system-scope owner token)
--base-url <base-url> Host base URL (default STAYFN_BASE_URL, else http://localhost:5080)
--token <token> Admin JWT, operator or owner (default STAYFN_ADMIN_TOKEN)
-?, -h, --help Show help and usage information
Description:
OHIP connectivity commands
Usage:
stayfn ohip [command] [options]
Options:
-?, -h, --help Show help and usage information
Commands:
ping Obtain a token and fetch hotel details (entcfg getHotel) through the StayFn pipeline
stream-probe Connect to the Streaming API, subscribe newEvent and print structure only (exit 0 acknowledged, 1 configuration, 2 credentials refused, 3 upstream)
Description:
Obtain a token and fetch hotel details (entcfg getHotel) through the StayFn pipeline
Usage:
stayfn ohip ping [options]
Options:
--env <env> (REQUIRED) Environment name; variables OHIP_<ENV>_* are read (see .env.example)
--hotel <hotel> (REQUIRED) Hotel code sent as x-hotelid
-?, -h, --help Show help and usage information
Description:
Connect to the Streaming API, subscribe newEvent and print structure only (exit 0 acknowledged, 1 configuration, 2 credentials refused, 3 upstream)
Usage:
stayfn ohip stream-probe [options]
Options:
--env <env> (REQUIRED) Environment name; OHIP_<ENV>_* plus CHAIN_CODE, HOTEL_ID and optional WEBSOCKET_URL
--seconds <seconds> Seconds each session stays subscribed (default 60) [default: 60]
--offset-type <offset-type> highest: start from the latest event (NewEventInput.offsetType)
--offset <offset> Offset to start from (wins over --offset-type)
--hotel-code <hotel-code> hotelCode filter; repeat
--delta Subscribe with delta: true
--max-events <max-events> End a session after this many events
--subprotocol <subprotocol> graphql-transport-ws (default), graphql-ws (legacy message types) or none [default: graphql-transport-ws]
--ping-seconds <ping-seconds> Client ping interval; 0 sends none (default 10) [default: 10]
--corrupt-token Send a deliberately corrupted token (learn the close code)
--upgrade-headers Also send Authorization/x-app-key on the upgrade request
--no-key-hash Omit the ?key=<sha256 of the app key> query (reproduces the gateway's bare 400)
--sessions <sessions> Consecutive connections (never concurrent; default 1) [default: 1]
--resume <resume> Later sessions resume at next (last + 1, default) or same (first offset again: redelivery check) [default: next]
--gap-seconds <gap-seconds> Wait between sessions (at least 10, default 12) [default: 12]
-?, -h, --help Show help and usage information
Description:
Run the local dev host: PostgreSQL (docker compose when needed), the host in the Development profile with the dev tenant and /api/dev/*, rebuilds on change, a dev token in .stayfn/dev-token
Usage:
stayfn dev [command] [options]
Options:
--root <root> Directory to run in (default: the repository root above the working directory, else the working directory); .stayfn/ is written here
--url <url> URL the host listens on [default: http://localhost:5080]
--project <project> Functions project (.csproj) to build and watch (default: the repository's reference functions, or the single project of the working directory)
--host <host> Path of StayFn.Host.dll (default: next to the CLI — the installed tool carries it — else the repository build)
--env <env> OHIP environment name the dev tenant uses (variables OHIP_<ENV>_*) [default: sandbox]
--configuration <configuration> Build configuration of the projects and the host [default: Debug]
--no-watch Do not build or watch the functions project (restart only through POST /api/dev/reload)
--no-compose Never start PostgreSQL with docker compose
-?, -h, --help Show help and usage information
Commands:
seed Create or update the development tenant, environment and hotel in the database (idempotent) and print the tenant id
token Mint a development admin JWT from STAYFN__Auth__SigningKey (Development only) and print it
Description:
Create or update the development tenant, environment and hotel in the database (idempotent) and print the tenant id
Usage:
stayfn dev seed [options]
Options:
--env <env> (REQUIRED) Environment name; variables OHIP_<ENV>_* describe the gateway, credentials (as env: secret references) and hotel
--tenant <tenant> (REQUIRED) Display name of the development tenant
--tenant-id <tenant-id> Tenant id (default: the Runtime:DevTenant default id)
-?, -h, --help Show help and usage information
Description:
Mint a development admin JWT from STAYFN__Auth__SigningKey (Development only) and print it
Usage:
stayfn dev token [options]
Options:
--role <role> (REQUIRED) Admin role claim: owner, operator or viewer
--tenant <tenant> Tenant the token is bound to (required for operator/viewer; omitted for a cross-tenant owner)
--subject <subject> Subject (sub) claim; default dev-<role>
--lifetime <lifetime> Token lifetime as hh:mm:ss (default Auth:DevTokenLifetime, 8 h)
-?, -h, --help Show help and usage information
Description:
Model Context Protocol server for AI authoring
Usage:
stayfn mcp [command] [options]
Options:
-?, -h, --help Show help and usage information
Commands:
stdio Serve the StayFn MCP server over stdin/stdout for Claude Code (no database; logs on stderr)
Description:
Serve the StayFn MCP server over stdin/stdout for Claude Code (no database; logs on stderr)
Usage:
stayfn mcp stdio [options]
Options:
--assemblies <assemblies> Paths of additional function assemblies to put in the catalog (the shipped reference set is always included)
--specs <specs> Directory of the committed OHIP specs (default: <repo>/tools/ohip-specs/26.3.0.0, else the snapshot shipped with the tool)
--root <root> The only directory function.scaffold writes under and function.validate reads from (default: the repository root)
-?, -h, --help Show help and usage information
Description:
OPERA 5 vs OHIP equivalence harness
Usage:
stayfn equivalence [command] [options]
Options:
-?, -h, --help Show help and usage information
Commands:
run Run the equivalence harness and report diffs on the covered fields
Description:
Run the equivalence harness and report diffs on the covered fields
Usage:
stayfn equivalence run [options]
Options:
--root <root> Repository root fixture paths are relative to (default: found from the current directory)
--fixtures <fixtures> Fixtures directory (default: <root>/tests/fixtures/equivalence)
--case <case> Run one case by name
--compare <compare> values (default) or presence [default: values]
--out <out> Write the JSON report here
--ohip-env <ohip-env> Run the OHIP side against OHIP_<ENV>_* (read-only calls; forces presence mode)
--hotel <hotel> Hotel code for --ohip-env
--confirmation <confirmation> Confirmation number for --ohip-env
--list List the cases (name, function, kind) instead of running them
-?, -h, --help Show help and usage information