()
| 881 | } |
| 882 | cfg.providers.custom = custom.filter((c: any) => c?.name !== name); |
| 883 | const { writeFileAtomic } = await import('./utils/atomic-write.js'); |
| 884 | await writeFileAtomic(QODEX_CONFIG_FILE, yaml.dump(cfg, { lineWidth: 100, noRefs: true })); |
| 885 | console.log(`✓ Removed custom provider "${name}".`); |
| 886 | process.exit(0); |
| 887 | }); |
| 888 | |
| 889 | program |
| 890 | .command('maintain-demo') |
| 891 | .description('Open a self-contained "Maintain in action" demo page (the self-improvement loop, visually)') |
| 892 | .option('--markdown', 'emit a shareable Markdown writeup instead of opening the interactive page') |
| 893 | .option('--pdf', 'write a shareable one-page PDF instead of opening the interactive page') |
| 894 | .option('-o, --out <file>', 'with --markdown/--pdf, write to this file (PDF default: ~/.qodex/maintain-demo.pdf)') |
| 895 | .action(async (opts: { markdown?: boolean; pdf?: boolean; out?: string }) => { |
| 896 | if (opts.markdown) { |
| 897 | const { buildMaintainDemoMarkdown } = await import('./cli/maintain-demo.js'); |
| 898 | const md = buildMaintainDemoMarkdown(); |
| 899 | if (opts.out) { const { promises: fs } = await import('fs'); await fs.writeFile(opts.out, md); console.log(`\n📝 Maintain writeup → ${opts.out}\n`); } |
| 900 | else console.log(md); |
| 901 | process.exit(0); |
| 902 | } |
| 903 | if (opts.pdf) { |
| 904 | const { buildMaintainDemoPdfBlocks } = await import('./cli/maintain-demo.js'); |
| 905 | const { buildPdf } = await import('./cli/pdf-lite.js'); |
| 906 | const { QODEX_HOME } = await import('./config/defaults.js'); |
| 907 | const { promises: fs } = await import('fs'); |
| 908 | const path = await import('path'); |
no test coverage detected