import { terminalLink } from 'termi-link' import type { Argv } from 'yargs' import { recordTelemetryAttributes } from '@cedarjs/cli-helpers/telemetry' export const command = 'cache ' export const description = 'Sets up an init file for service caching' export const builder = (yargs: Argv) => { yargs .positional('client', { choices: ['memcached', 'redis'], description: 'Cache client', type: 'string', required: true, }) .option('force', { alias: 'f', default: false, description: 'Overwrite existing cache.js file', type: 'boolean', }) .epilogue( `Also see the ${terminalLink( 'CedarJS CLI Reference', 'https://cedarjs.com/docs/cli-commands#setup-cache', )}`, ) } export const handler = async (options: { client: string; force: boolean }) => { recordTelemetryAttributes({ command: 'setup cache', client: options.client, force: options.force, }) const { handler } = await import('./cacheHandler.js') return handler(options) }