#!/usr/bin/env node
import { Command } from 'commander';
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';
import { setGlobalPrettyMode } from './utils/output.js';
import { registerImageCommand } from './commands/image.js';
import { registerVideoCommand } from './commands/video.js';
import { registerVideoTranslateCommand } from './commands/video-translate.js';
import { registerTtsCommand } from './commands/tts.js';
import { registerAsrCommand } from './commands/asr.js';
import { registerTryonCommand } from './commands/tryon.js';
import { registerTaskCommand } from './commands/task.js';
import { registerConfigCommand } from './commands/config.js';
import { registerVoiceCommand } from './commands/voice.js';
import { registerAvatarCommand } from './commands/avatar.js';
import { registerDoctorCommand } from './commands/doctor.js';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8'));
const program = new Command();
program
    .name('gen')
    .description('Optima Gen CLI - AI 内容生成命令行工具')
    .version(packageJson.version)
    .option('--pretty', '使用人类可读的表格格式输出（默认为 JSON）')
    .hook('preAction', (thisCommand) => {
    const opts = thisCommand.optsWithGlobals();
    if (opts.pretty) {
        setGlobalPrettyMode(true);
    }
})
    .addHelpText('after', `
Output Formats:
  默认输出 JSON 格式（AI 友好），支持两种输出模式：
  --json    JSON 格式（默认）- 机器可读，AI 友好，减少 50%+ token
  --pretty  表格格式 - 人类可读，带颜色和表格

常用命令:
  $ gen image "a cat"                # 生成图像
  $ gen video cat.png --prompt "walk" # 图生视频
  $ gen tts "你好世界" --voice Cherry  # 文本转语音
  $ gen asr audio.mp3 --language zh   # 语音识别
  $ gen tryon person.jpg dress.jpg    # 虚拟试穿
  $ gen task list                     # 查看任务列表

文档:
  GitHub: https://github.com/Optima-Chat/optima-gen
  Issues: https://github.com/Optima-Chat/optima-gen/issues
`);
// 生成命令
registerImageCommand(program);
registerVideoCommand(program);
registerVideoTranslateCommand(program);
registerTtsCommand(program);
registerAsrCommand(program);
registerTryonCommand(program);
// Phase 2 doctor-avatar
registerVoiceCommand(program);
registerAvatarCommand(program);
registerDoctorCommand(program);
// 任务管理
registerTaskCommand(program);
// 配置
registerConfigCommand(program);
program.parse();
//# sourceMappingURL=index.js.map