diff --git a/packages/composable-cli/src/commands/generate/d2c/d2c-command.tsx b/packages/composable-cli/src/commands/generate/d2c/d2c-command.tsx index 27da1de9..4bb0e0d7 100644 --- a/packages/composable-cli/src/commands/generate/d2c/d2c-command.tsx +++ b/packages/composable-cli/src/commands/generate/d2c/d2c-command.tsx @@ -498,11 +498,26 @@ export function createD2CCommandHandler( ]) if (configureAlgolia) { - await createAlgoliaIntegrationCommandHandler(ctx)({ + const result = await createAlgoliaIntegrationCommandHandler(ctx)({ algoliaApplicationId: gatheredOptions.algoliaApplicationId, algoliaAdminApiKey: gatheredOptions.algoliaAdminApiKey, ...args, }) + + if (result.success) { + logger.info( + boxen( + `Don't forget to add your Algolia index name to .env.local ${colors.bold.green( + `NEXT_PUBLIC_ALGOLIA_INDEX_NAME=${result.data.indexName}` ?? + "", + )}`, + { + padding: 1, + margin: 1, + }, + ), + ) + } } } diff --git a/packages/composable-cli/src/commands/integration/algolia/algolia-integration-command.tsx b/packages/composable-cli/src/commands/integration/algolia/algolia-integration-command.tsx index aca23db1..4a263f55 100644 --- a/packages/composable-cli/src/commands/integration/algolia/algolia-integration-command.tsx +++ b/packages/composable-cli/src/commands/integration/algolia/algolia-integration-command.tsx @@ -325,7 +325,9 @@ export function createAlgoliaIntegrationCommandHandler( return { success: true, - data: {}, + data: { + indexName: algoliaIndexName, + }, } } catch (e) { spinner.fail(`Failed to setup Algolia integration`) diff --git a/packages/composable-cli/src/commands/integration/algolia/algolia-integration.types.ts b/packages/composable-cli/src/commands/integration/algolia/algolia-integration.types.ts index b5c0ca43..991a8218 100644 --- a/packages/composable-cli/src/commands/integration/algolia/algolia-integration.types.ts +++ b/packages/composable-cli/src/commands/integration/algolia/algolia-integration.types.ts @@ -1,6 +1,8 @@ import { IntegrationCommandArguments } from "../integration.types" -export type AlgoliaIntegrationCommandData = {} +export type AlgoliaIntegrationCommandData = { + indexName?: string +} export type AlgoliaIntegrationCommandError = { code: string diff --git a/packages/composable-cli/src/composable.ts b/packages/composable-cli/src/composable.ts index 7b971766..bc74cb92 100644 --- a/packages/composable-cli/src/composable.ts +++ b/packages/composable-cli/src/composable.ts @@ -65,7 +65,6 @@ export async function main({ .example("$0 logout", "logout of the CLI") .strictCommands() .demandCommand(1) - .fail(false) .help("h").argv return 0