From 2ba826bb722c75bc773dd132095d6a42abb36691 Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Thu, 12 Feb 2026 07:31:02 +0700 Subject: [PATCH] fix(cursor): use getCursorConfig(), fix help text and stub messages --- src/ccs.ts | 2 +- src/commands/cursor-command.ts | 2 +- src/commands/help-command.ts | 2 +- src/web-server/routes/cursor-settings-routes.ts | 12 +++++++----- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/ccs.ts b/src/ccs.ts index a98e84d6..6431c855 100644 --- a/src/ccs.ts +++ b/src/ccs.ts @@ -555,7 +555,7 @@ async function main(): Promise { // Special case: cursor command (Cursor IDE integration) // Only route to command handler for known subcommands, otherwise treat as profile - // NOTE: Bare `ccs cursor` falls through to profile detection by design (differs from copilot routing) + // Bare 'ccs cursor' falls through to profile detection (reserved name). Subcommands required. // Note: cursor does not have enable/disable — it uses daemon start/stop instead const CURSOR_SUBCOMMANDS = ['auth', 'status', 'models', 'start', 'stop', 'help', '--help', '-h']; if (firstArg === 'cursor' && args.length > 1 && CURSOR_SUBCOMMANDS.includes(args[1])) { diff --git a/src/commands/cursor-command.ts b/src/commands/cursor-command.ts index 739c9515..56c73412 100644 --- a/src/commands/cursor-command.ts +++ b/src/commands/cursor-command.ts @@ -10,6 +10,6 @@ */ export async function handleCursorCommand(_args: string[]): Promise { console.error('[!] Cursor command not yet implemented (task #520)'); - console.error(' Available after cursor-command.ts is created'); + console.error(' Full implementation coming in task #520.'); return 1; } diff --git a/src/commands/help-command.ts b/src/commands/help-command.ts index 12bf0aae..16cd06f6 100644 --- a/src/commands/help-command.ts +++ b/src/commands/help-command.ts @@ -230,7 +230,7 @@ Run ${color('ccs config', 'command')} for web dashboard`.trim(); 'Auto-detects token from Cursor installation', ], [ - ['ccs cursor', 'Use Cursor IDE integration'], + ['ccs cursor ', 'Use Cursor IDE integration'], ['ccs cursor auth', 'Import Cursor token'], ['ccs cursor status', 'Show connection status'], ['ccs cursor models', 'List available models'], diff --git a/src/web-server/routes/cursor-settings-routes.ts b/src/web-server/routes/cursor-settings-routes.ts index cc7096d7..45ef3090 100644 --- a/src/web-server/routes/cursor-settings-routes.ts +++ b/src/web-server/routes/cursor-settings-routes.ts @@ -8,7 +8,11 @@ import * as fs from 'fs'; import * as path from 'path'; import { getCcsDir } from '../../utils/config-manager'; import { DEFAULT_CURSOR_CONFIG } from '../../config/unified-config-types'; -import { loadOrCreateUnifiedConfig, saveUnifiedConfig } from '../../config/unified-config-loader'; +import { + loadOrCreateUnifiedConfig, + saveUnifiedConfig, + getCursorConfig, +} from '../../config/unified-config-loader'; const router = Router(); @@ -17,8 +21,7 @@ const router = Router(); */ router.get('/', (_req: Request, res: Response): void => { try { - const config = loadOrCreateUnifiedConfig(); - const cursorConfig = config.cursor ?? DEFAULT_CURSOR_CONFIG; + const cursorConfig = getCursorConfig(); res.json(cursorConfig); } catch (error) { res.status(500).json({ error: (error as Error).message }); @@ -84,8 +87,7 @@ router.put('/', (req: Request, res: Response): void => { router.get('/raw', (_req: Request, res: Response): void => { try { const settingsPath = path.join(getCcsDir(), 'cursor.settings.json'); - const config = loadOrCreateUnifiedConfig(); - const cursorConfig = config.cursor ?? DEFAULT_CURSOR_CONFIG; + const cursorConfig = getCursorConfig(); // If file doesn't exist, return default structure if (!fs.existsSync(settingsPath)) {