@@ -5,6 +5,12 @@ import { join } from 'path';
55import fs from 'fs/promises' ;
66import { logger } from '../utils/logger' ;
77
8+ const DEFAULT_CLI_PATH = 'npx -y vibe-log-cli@latest' ;
9+ const LEGACY_NPX_CLI_PATHS = new Set ( [
10+ 'npx vibe-log-cli' ,
11+ 'npx vibe-log-cli@latest' ,
12+ ] ) ;
13+
814export interface ProjectSyncData {
915 oldestSyncedTimestamp ?: string ;
1016 newestSyncedTimestamp ?: string ;
@@ -68,7 +74,7 @@ const config = new Conf<ConfigSchema>({
6874 } ,
6975 cliPath : {
7076 type : 'string' ,
71- default : 'npx vibe-log-cli' ,
77+ default : DEFAULT_CLI_PATH ,
7278 } ,
7379 token : {
7480 type : 'string' ,
@@ -251,7 +257,17 @@ export function getCliPath(): string {
251257 }
252258
253259 // Use configured path or default to npx command
254- return config . get ( 'cliPath' ) || 'npx vibe-log-cli' ;
260+ const configuredPath = config . get ( 'cliPath' ) ;
261+ if ( ! configuredPath ) {
262+ return DEFAULT_CLI_PATH ;
263+ }
264+
265+ const normalizedPath = configuredPath . trim ( ) . replace ( / \s + / g, ' ' ) ;
266+ if ( LEGACY_NPX_CLI_PATHS . has ( normalizedPath ) ) {
267+ return DEFAULT_CLI_PATH ;
268+ }
269+
270+ return configuredPath ;
255271}
256272
257273export function setCliPath ( path : string ) : void {
@@ -456,4 +472,4 @@ export function getStatusLineBackup(): ConfigSchema['statusLineBackup'] | undefi
456472export function clearStatusLineBackup ( ) : void {
457473 config . delete ( 'statusLineBackup' ) ;
458474 logger . debug ( 'Status line backup cleared' ) ;
459- }
475+ }
0 commit comments