summarizely-cli
Version:
YouTube summarizer that respects your existing subscriptions. No API keys required.
86 lines (84 loc) • 3.03 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.printHelp = printHelp;
exports.getVersion = getVersion;
exports.formatBatchSummary = formatBatchSummary;
exports.formatBatchJson = formatBatchJson;
exports.formatSingleVideoJson = formatSingleVideoJson;
exports.formatProgress = formatProgress;
function printHelp() {
const msg = `
Summarizely CLI
Usage:
summarizely <youtube-url> [options]
summarizely <url1> <url2> ... [options] # Process multiple videos
Options:
-h, --help Show help
-v, --version Show version
--provider <name> Provider: claude-cli|codex-cli|ollama
--model <name> Model preset (default: qwen2.5:0.5b-instruct for Ollama)
--captions-only Force captions-only (no ASR; v1 doesn't do ASR)
--output-dir <dir> Output directory (default: summaries)
--no-save-transcript Do not write transcript .vtt/.txt files next to summary
--max-chars <n> Max transcript chars for CLI providers (default ~80k)
--no-cap Disable transcript cap for CLI providers
--stream Stream output for supported providers (no JSON)
--json Output JSON (metadata + content)
--batch Process multiple URLs (auto-detected for multiple args)
--playlist Extract and process all videos from a playlist
--channel Extract recent videos from a channel
--channel-limit <n> Number of channel videos to process (default: 10)
`;
process.stdout.write(msg);
}
function getVersion() {
try {
const pkg = require("../../package.json");
return pkg.version || "0.0.0";
}
catch {
return "0.0.0";
}
}
function formatBatchSummary(stats) {
const lines = [
'',
'='.repeat(60),
'Batch Processing Complete',
'='.repeat(60),
`Total videos: ${stats.totalVideos}`,
`Successful: ${stats.successful}`,
`Failed: ${stats.failed}`,
`Total time: ${Math.round(stats.totalDuration / 1000)}s`,
];
return lines.join('\n');
}
function formatBatchJson(stats, results) {
return JSON.stringify({
status: stats.failed === 0 ? 'ok' : 'partial',
stats,
results: results.map(r => ({
url: r.url,
videoId: r.videoId,
title: r.title,
success: r.success,
path: r.path,
error: r.error
}))
}, null, 2);
}
function formatSingleVideoJson(result, provider) {
return JSON.stringify({
status: 'ok',
path: result.path,
provider,
url: result.url,
videoId: result.videoId,
title: result.title
}, null, 2);
}
function formatProgress(current, total, title) {
const truncatedTitle = title ? (title.length > 50 ? title.substring(0, 47) + '...' : title) : '';
return `[${current}/${total}] Processing: ${truncatedTitle || 'video'}`;
}
//# sourceMappingURL=formatter.js.map