settling on this

import "zx/globals";
require("dotenv").config({ path: ".env.local" });
  

const SB_PROJECT_URL = process.env.NEXT_PUBLIC_SUPABASE_URL;
const SB_ANON_KEY = process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY;

await $`npx openapi-typescript ${SB_PROJECT_URL}/rest/v1/?apikey=${SB_ANON_KEY} --output types/supabase.ts`;


When in TRPC land handle errors with trpc.TRPCError and dont return an error object like in GQL