CLI installation
Install the Rayfin CLI as a project dev dependency, globally, or run it ad hoc with npx — plus how to verify the install and update it.
@microsoft/rayfin-cli ships as a normal npm package. Most projects never install it
directly — npm create @microsoft/rayfin@latest adds it as a dev dependency automatically —
but this page covers every install path.
Prerequisites
- Node.js 20 or later.
New project
Scaffolding a project installs the CLI as a dev dependency for you:
npm create @microsoft/rayfin@latest my-app
cd my-appExisting project
Install the CLI as a dev dependency, then run the interactive setup:
npm install --save-dev @microsoft/rayfin-cli
npx rayfin initSee Init for what the setup prompts for.
Global install
You can also install the CLI globally and call rayfin directly, without npx:
npm install -g @microsoft/rayfin-cli
rayfin --versionNote
Run rayfin from inside a project directory regardless of how it's installed. Commands
like rayfin docs discover version-locked documentation by
scanning the current project's node_modules, so a globally-installed CLI still needs to
be invoked from the project root to see the right package versions.
Run without installing
npx fetches and runs the CLI without adding it to package.json:
npx @microsoft/rayfin-cli --versionInside a project that already has @microsoft/rayfin-cli as a dev dependency, plain
npx rayfin <command> resolves to the locally installed version.
Verify the installation
npx rayfin --version
npx rayfin --helpFirst steps
npx rayfin login # sign in with Entra ID
npx rayfin up # deploy backend services to Fabric
npm run dev # run the frontend dev serverUpdate the CLI
npm update --save
npm installVerify the update:
npx rayfin --versionI have an existing TypeScript project at the current directory with no Rayfin backend yet.
Install @microsoft/rayfin-cli as a dev dependency, then run `npx rayfin init` and walk me
through the prompts to enable Auth and Data services with the mssql dialect.