From 39724daee4b97cd98e5917a79608fa1cc5faa70f Mon Sep 17 00:00:00 2001 From: Boris Starkov Date: Fri, 24 Oct 2025 17:49:24 +0100 Subject: [PATCH] fix components add by using custom ui.* registry --- src/components/commands/add.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/commands/add.ts b/src/components/commands/add.ts index dccfa4b..4966d6e 100644 --- a/src/components/commands/add.ts +++ b/src/components/commands/add.ts @@ -14,17 +14,17 @@ export function createAddCommand(): Command { process.exit(1); } - console.log('Launching shadcn/ui CLI...'); - console.log('Source: https://ui.elevenlabs.io\n'); + const component = componentName || 'all'; + const targetUrl = new URL(`/r/${component}.json`, 'https://ui.elevenlabs.io').toString(); - // Prepare command arguments - const args = ['shadcn@latest', 'add']; - if (componentName) { - args.push(componentName); - } + console.log(`Installing ${component} from ElevenLabs UI registry...`); + console.log(`Source: ${targetUrl}\n`); + + // Prepare command with custom registry URL + const fullCommand = `npx -y shadcn@latest add ${targetUrl}`; // Run shadcn add command interactively - const result = spawnSync('npx', args, { + const result = spawnSync(fullCommand, { stdio: 'inherit', // Allow interactive prompts shell: true });