diff --git a/src/cli.ts b/src/cli.ts index f20d017..81c4fbd 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -96,10 +96,7 @@ export async function cliEntry(argv = process.argv) { } if (err?.response?.body?.message?.includes('Project is not allowed to use this feature')) { - log.info( - 'Embeddings Index API is available to users on the Team plan and above. Upgrade your plan to enable access.', - ) - log.info('https://sanity.io/pricing') + ;(await import('./disabledNotice')).default() } // eslint-disable-next-line no-process-exit diff --git a/src/disabledNotice.ts b/src/disabledNotice.ts new file mode 100644 index 0000000..7dc3cb2 --- /dev/null +++ b/src/disabledNotice.ts @@ -0,0 +1,11 @@ +import log from './util/log' +import {createClient} from './util/sanityClient' + +export default function logDisabledNotice() { + const client = createClient() + + log.info( + '💎 Unlock semantic search with Embeddings Index APIs — available on Team, Business, and Enterprise plans. ' + + `Upgrade now: https://www.sanity.io/manage/project/${client.config().projectId}/plan`, + ) +}