Rayfin

rayfin init

Scaffold a new Rayfin project, add Rayfin to an existing directory, select templates, and choose services with rayfin init.

Use rayfin init to create or update rayfin/rayfin.yml. Use npm create @microsoft/rayfin@latest when you want the same initializer wrapped in npm's project-creation flow.

Create a new project

npm create @microsoft/rayfin@latest my-app

The project name is positional. Bare names with whitespace are slugified for the folder (My App → my-app/); pass ./My App to keep spaces in the directory name.

Add Rayfin to an existing project

npm install --save-dev @microsoft/rayfin-cli
npx rayfin init [directory]

[directory] defaults to the current directory and doubles as the default project name.

Interactive prompts

Without flags, rayfin init asks for the template/source first. In scratch mode it then asks which services to enable, which auth method to use, and whether static hosting should be configured. Fabric SSO is the supported auth method. The Data dialect defaults to mssql because managed Fabric apps use MSSQL.

The default interactive template path is the blankapp built-in, displayed as ✨ Use default template and backed by the Universal App in 1.36. Choose Start from scratch only when you want the CLI to write a minimal rayfin.yml instead of copying a template.

Reconfiguring an existing project

Running rayfin init again in a directory with rayfin/rayfin.yml reruns configuration. Existing entity files under rayfin/data/ are preserved. Use --overwrite only when you intend to replace scaffold-level files that already exist.

When a template ships rayfin.yml, the initializer preserves template-authored service settings and applies only explicit command-line choices such as --project-name, --dialect, or --services.

Options

OptionDefaultDescription
[directory]current directoryDirectory to create the project in.
--project-name <name>directory nameOverride the project name and update rayfin.yml without changing the directory.
-t, --template <uri>promptTemplate name, git URL, or local path to create the project from.
--template-name <name>prompt for multi-template sourcesPick one template from a multi-template source non-interactively.
-l, --list-templatesfalseList all available project templates and exit.
--dialect <dialect>mssql when Data is enabledDatabase dialect. Fabric supports mssql.
--services <list>auth,data in non-interactive scratch initComma-separated services to enable: auth, data, functions. functions is accepted without a feature flag. Changed in 1.36
--auth-methods <list>fabricComma-separated auth methods. fabric is the supported value.
--static-hostingtrueScaffold a static frontend.
--overwritefalseOverwrite existing configuration files.
-w, --workspace <name>—Fabric workspace display name. Mutually exclusive with --workspace-id.
--workspace-id <id>—Fabric workspace ID. Mutually exclusive with --workspace.
--item-id <id>—Fabric App Item ID to pre-associate with the project.

Root -y, --yes, --output <mode>, --json, and --verbose also apply.

Services

Auth and Data are regular services. Functions are regular in 1.36; use --services auth,data,functions to scaffold the Functions block and starter package. Storage remains experimental and is only offered when RAYFIN_FEATURE_FLAGS=storage or an existing config enables storage.

What init writes

For a scratch 1.36 project, rayfin init writes:

  • rayfin/rayfin.yml with id, name, version, and a services block.
  • services.staticHosting.assetAccess: protected when static hosting is scaffolded. New in 1.35.1
  • services.functions.auth.type: application when Functions are selected. New in 1.36
  • rayfin/data/ when Data is enabled.
  • A Functions package when Functions are enabled, unless the template already supplies one.
  • .gitignore entries for local Rayfin state.
  • Agent files: AGENTS.md one time, mcpServers.rayfin in .mcp.json, and Rayfin skills under .agents/skills/.

When a template already ships rayfin.yml, the CLI preserves the authored service shape and only applies explicit identity, dialect, and --services edits.

Template selection

Built-in templates use stable CLI names such as dataapp, gettingstartedauth, and todoapp. The blankapp built-in remains the visible default template name; in 1.36 it is backed by universal-app and displayed as ✨ Use default template. Plugin automation can still pass --template universal-app. Changed in 1.36

Run npx rayfin init --list-templates in the target project to see names accepted by the installed CLI. See Templates.

Next steps

npx rayfin login
npm run dev
npx rayfin up

Use npm run dev for the local Fabric-backed session. Use rayfin up to publish static content and Functions.

Agent files subcommand

rayfin init ai-files is documented on Ai-files.

PromptScaffold a Rayfin project with Functions
Create a new Rayfin project named orders-app with the current CLI. Use `npm create @microsoft/rayfin@latest orders-app -- --services auth,data,functions --auth-methods fabric --yes`, then show the generated rayfin/rayfin.yml and confirm it contains `services.staticHosting.assetAccess: protected` and `services.functions.auth.type: application`.
Something wrong on this page?Report an issueEdit this page

On this page