taskflow-ai
Version:
TaskFlow AI - 智能PRD文档解析与任务管理助手,支持多模型AI协同、MCP编辑器集成,专为开发团队设计的CLI工具
121 lines (120 loc) • 2.48 kB
TypeScript
/**
* 改进的CLI用户界面
* 提供更好的用户体验和交互设计
*/
import { Ora } from 'ora';
/**
* CLI主题配置
*/
export interface CLITheme {
primary: string;
secondary: string;
success: string;
warning: string;
error: string;
info: string;
muted: string;
}
/**
* 默认主题
*/
export declare const defaultTheme: CLITheme;
/**
* 进度条配置
*/
export interface ProgressConfig {
total: number;
current: number;
label: string;
showPercentage: boolean;
showETA: boolean;
}
/**
* CLI界面管理器
*/
export declare class CLIInterface {
private theme;
private startTime;
private currentSpinner;
constructor(theme?: CLITheme);
/**
* 显示欢迎横幅
*/
showWelcomeBanner(): void;
/**
* 显示帮助信息
*/
showHelp(): void;
/**
* 显示成功消息
*/
showSuccess(message: string, details?: string): void;
/**
* 显示错误消息
*/
showError(message: string, details?: string): void;
/**
* 显示警告消息
*/
showWarning(message: string, details?: string): void;
/**
* 显示信息消息
*/
showInfo(message: string, details?: string): void;
/**
* 创建加载动画
*/
createSpinner(text: string): Ora;
/**
* 显示进度条
*/
showProgress(config: ProgressConfig): void;
/**
* 显示表格
*/
showTable(headers: string[], rows: string[][]): void;
/**
* 显示统计信息
*/
showStats(stats: Record<string, string | number>): void;
/**
* 显示代码块
*/
showCodeBlock(code: string, language?: string): void;
/**
* 显示分隔线
*/
showSeparator(text?: string): void;
/**
* 清屏
*/
clear(): void;
/**
* 显示执行时间
*/
showExecutionTime(): void;
/**
* 停止当前动画
*/
stopSpinner(): void;
/**
* 显示确认对话框
*/
confirm(message: string): Promise<boolean>;
/**
* 显示选择列表
*/
select(message: string, choices: string[]): Promise<string>;
/**
* 显示输入框
*/
input(message: string, defaultValue?: string): Promise<string>;
/**
* 显示多选框
*/
multiSelect(message: string, choices: string[]): Promise<string[]>;
}
/**
* 全局CLI界面实例
*/
export declare const cli: CLIInterface;