Files
Claude-Code-Workflow/ccw/src/commands/list.js
catlog22 35bd0aa8f6 feat: Add workflow dashboard template and utility functions
- Implemented a new HTML template for the workflow dashboard, featuring a responsive design with dark/light theme support, session statistics, and task management UI.
- Created a browser launcher utility to open HTML files in the default browser across platforms.
- Developed file utility functions for safe reading and writing of JSON and text files.
- Added path resolver utilities to validate and resolve file paths, ensuring security against path traversal attacks.
- Introduced UI utilities for displaying styled messages and banners in the console.
2025-12-04 09:40:12 +08:00

38 lines
1.3 KiB
JavaScript

import chalk from 'chalk';
import { showBanner, divider, info } from '../utils/ui.js';
import { getAllManifests } from '../core/manifest.js';
/**
* List command handler - shows all installations
*/
export async function listCommand() {
showBanner();
console.log(chalk.cyan.bold(' Installed Claude Code Workflow Instances\n'));
const manifests = getAllManifests();
if (manifests.length === 0) {
info('No installations found.');
console.log('');
console.log(chalk.gray(' Run: ccw install - to install Claude Code Workflow'));
console.log('');
return;
}
manifests.forEach((m, i) => {
const modeColor = m.installation_mode === 'Global' ? chalk.cyan : chalk.yellow;
console.log(chalk.white.bold(` ${i + 1}. `) + modeColor.bold(m.installation_mode));
console.log(chalk.gray(` Path: ${m.installation_path}`));
console.log(chalk.gray(` Date: ${new Date(m.installation_date).toLocaleDateString()}`));
console.log(chalk.gray(` Version: ${m.application_version}`));
console.log(chalk.gray(` Files: ${m.files_count}`));
console.log(chalk.gray(` Dirs: ${m.directories_count}`));
console.log('');
});
divider();
console.log(chalk.gray(' Run: ccw uninstall - to remove an installation'));
console.log('');
}