Using the CLI in SvelteKit project

I am a bit confused since I followed the SvelteKit integration guide that recommends

import { betterAuth } from "better-auth";
import { sveltekitCookies } from "better-auth/svelte-kit";
import { getRequestEvent } from "$app/server";
 
export const auth = betterAuth({
  // ... your config
  plugins: [sveltekitCookies(getRequestEvent)],
});

but when I then try any CLI command, like pnpm dlx @better-auth/cli migrate I get an error corresponding to not being able to access the $app (since it's a SvelteKit thing?).

ERROR [Better Auth]: [#better-auth]: Couldn't read your auth config. Error: Cannot find module '$app/server'


Any recommendations?
Solution
I think right now the only way is just to comment out code that causes the CLI to run into issues,
Was this page helpful?