diff --git a/src/commands/install-command.ts b/src/commands/install-command.ts index 5bdcfbf2..8842dc0a 100644 --- a/src/commands/install-command.ts +++ b/src/commands/install-command.ts @@ -4,7 +4,9 @@ * Handle --install and --uninstall commands for CCS. */ -import { info, color, initUI } from '../utils/ui'; +import { info, ok, color, box, initUI } from '../utils/ui'; +import { uninstallWebSearchHook } from '../utils/websearch'; +import { ClaudeSymlinkManager } from '../utils/claude-symlink-manager'; /** * Handle install command @@ -28,12 +30,34 @@ export async function handleInstallCommand(): Promise { export async function handleUninstallCommand(): Promise { await initUI(); console.log(''); - console.log(info('Feature not available')); + console.log(box('Uninstalling CCS', { borderColor: 'cyan' })); console.log(''); - console.log('The --uninstall flag is currently under development.'); - console.log('.claude/ integration testing is not complete.'); + + let removed = 0; + + // 1. Remove WebSearch hook (file + settings.json) + const hookRemoved = uninstallWebSearchHook(); + if (hookRemoved) { + console.log(ok('Removed WebSearch hook')); + removed++; + } + + // 2. Remove symlinks from ~/.claude/ + const symlinkManager = new ClaudeSymlinkManager(); + symlinkManager.uninstall(); + removed++; + + // 3. Summary console.log(''); - console.log(`For updates: ${color('https://github.com/kaitranntt/ccs/issues', 'path')}`); + if (removed > 0) { + console.log(ok('Uninstall complete!')); + console.log(''); + console.log(info('~/.ccs/ directory preserved')); + console.log(info('To reinstall: ccs --install')); + } else { + console.log(info('Nothing to uninstall')); + } console.log(''); + process.exit(0); }