| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import { Command } from "commander";
- import { writeFileSync, existsSync } from "node:fs";
- import { resolve } from "node:path";
- const DEFAULT_CONFIG = `# Pipeline default configuration
- llm:
- baseURL: "https://api.openai.com/v1"
- model: "gpt-4o"
- tts:
- provider: "openai-tts"
- openai-tts:
- model: "seed-tts-1.1"
- defaultVoice: "zh_female_vv_uranus_bigtts"
- fish-audio:
- model: "s2-pro"
- minimax:
- model: "speech-02-hd"
- elevenlabs:
- model: "eleven_multilingual_v2"
- output:
- dir: "./output"
- format: "mp4"
- `;
- export const initCommand = new Command("init")
- .description("Create default config file")
- .option("-o, --output <path>", "Config file path", "pipeline.config.yaml")
- .action((opts) => {
- const configPath = resolve(opts.output);
- if (existsSync(configPath)) {
- console.error(`Config file already exists: ${configPath}`);
- process.exit(1);
- }
- writeFileSync(configPath, DEFAULT_CONFIG, "utf-8");
- console.log(`Created config file: ${configPath}`);
- console.log("\nNext steps:");
- console.log(" 1. Edit the config file with your API keys");
- console.log(" 2. Set environment variables (see .env.example)");
- console.log(" 3. Run: pipeline render article.md -t news -p bilibili");
- });
|