Skip to content

Latest commit

 

History

History
695 lines (490 loc) · 21.5 KB

File metadata and controls

695 lines (490 loc) · 21.5 KB

Python 3.9+ MIT License Zero Dependencies CLI Tool

🎬 ScriptForge

AI-Powered Content Script Generator CLI Tool
AI驱动的短视频/内容脚本自动生成命令行工具
Generate viral video scripts in seconds, not hours.

简体中文繁體中文English


🎉 简介

ScriptForge 是一款轻量级、零依赖的AI驱动内容脚本生成CLI工具。无论你是短视频创作者、内容运营还是自媒体从业者,ScriptForge都能帮你快速生成高质量的短视频脚本、分镜方案和字幕文件。

💡 灵感来源

参考了GitHub Trending上热门的AI视频生成工具(如Pixelle-Video等)的脚本生成环节,独立自研了这款专注于脚本创作的轻量级工具。与需要复杂环境配置的全栈视频工具不同,ScriptForge专注于做好一件事——帮你写出爆款脚本

🔥 自研差异化亮点

  • 零外部依赖:核心功能仅使用Python标准库,无需安装任何第三方包
  • 多平台适配:内置抖音/TikTok、YouTube Shorts、B站、小红书、Instagram Reels模板
  • 多LLM后端:支持OpenAI、Anthropic Claude、Ollama本地模型及任何OpenAI兼容API
  • 智能评分系统:7维度脚本质量评估,帮你优化每一个细节
  • 多格式导出:Markdown、JSON、SRT字幕、纯文本,一键切换
  • 内置Mock模式:无需API Key即可体验全部功能,方便测试和演示

✨ 核心特性

特性 描述
🎬 多平台模板 内置8+平台模板(抖音15s/30s/60s、YouTube、B站、小红书、Instagram等)
🤖 AI脚本生成 接入GPT-4o/Claude/Ollama等大模型,智能生成专业脚本
📊 7维质量评分 钩子强度、结构、互动性、清晰度、平台适配、CTA效果、标签相关性
📝 SRT字幕生成 自动生成带时间轴的SRT字幕文件,可直接用于视频剪辑
🔥 热点话题推荐 内置6大分类(科技/生活/教育/商业/娱乐/综合)热门话题库
📦 批量生成 从话题文件批量生成脚本,支持大规模内容生产
🌐 多语言输出 支持中文、英文、日文、韩文、西班牙文脚本生成
🎨 6种风格 互动型、教育型、娱乐型、励志型、叙事型、推广型
📤 4种导出格式 Markdown、JSON、SRT字幕、纯文本
⚙️ YAML配置 灵活的YAML配置文件,支持环境变量覆盖
🧪 Mock模式 内置模拟生成器,无需API Key即可完整体验

🚀 快速开始

环境要求

  • Python 3.9 或更高版本
  • pip 包管理器
  • (可选)OpenAI / Anthropic API Key,或本地安装 Ollama

安装

# 从PyPI安装(推荐)
pip install scriptforge

# 或从源码安装
git clone https://github.com/gitstq/scriptforge.git
cd scriptforge
pip install -e .

快速使用

# 1. 查看帮助
scriptforge --help

# 2. 使用Mock模式生成脚本(无需API Key)
scriptforge generate "5个Python新手必知技巧" --platform tiktok --duration 15

# 3. 查看可用模板
scriptforge templates

# 4. 查看热门话题推荐
scriptforge trending --category tech --count 5

# 5. 导出为Markdown
scriptforge generate "AI工具推荐" --platform youtube --duration 60 --output script.md

# 6. 导出为SRT字幕
scriptforge generate "生活小妙招" --platform xiaohongshu --format srt --output subtitles.srt

# 7. 批量生成
scriptforge batch --topics-file topics.txt --output-dir ./scripts --platform tiktok

# 8. 初始化项目
scriptforge init my-video-project

📖 详细使用指南

配置API Key

创建配置文件 scriptforge.yaml

# 使用OpenAI
provider:
  name: openai
  api_key: sk-your-key-here
  model: gpt-4o-mini

# 或使用Anthropic Claude
# provider:
#   name: anthropic
#   api_key: sk-ant-your-key-here
#   model: claude-sonnet-4-20250514

# 或使用本地Ollama(完全免费)
# provider:
#   name: ollama
#   model: llama3
#   base_url: http://localhost:11434

# 或使用环境变量
# export OPENAI_API_KEY=sk-your-key-here
# export SCRIPTFORGE_PROVIDER=ollama

平台模板

模板名称 平台 时长 适用场景
tiktok-15s 抖音/TikTok 15秒 快速钩子视频
tiktok-30s 抖音/TikTok 30秒 中等内容视频
tiktok-60s 抖音/TikTok 60秒 深度内容视频
youtube-60s YouTube Shorts 60秒 知识分享
bilibili-60s B站 60秒 深度内容
xiaohongshu-30s 小红书 30秒 种草推荐
instagram-30s Instagram Reels 30秒 生活方式
generic-30s 通用 30秒 多平台分发

脚本评分维度

📊 Script Quality Scores
  hook_strength     ████████░░ 85%  A    🎣 钩子吸引力
  structure         █████████░ 95%  A+   📐 结构完整性
  engagement        ███████░░░ 75%  B    💬 互动潜力
  clarity           ████████░░ 80%  A    🔍 内容清晰度
  platform_fit      █████████░ 90%  A+   📱 平台适配度
  cta_effectiveness ███████░░░ 70%  B    📢 CTA效果
  hashtag_relevance ████████░░ 85%  A    🏷️ 标签相关性
  overall           ████████░░ 83%  A    🏆 综合评分

💡 设计思路与迭代规划

设计理念

  1. 零依赖核心:不依赖任何第三方库,降低安装门槛,提升稳定性
  2. 配置驱动:YAML配置文件 + 环境变量,灵活适配不同使用场景
  3. 模板化:平台模板系统,让脚本结构符合各平台最佳实践
  4. 可扩展:清晰的模块架构,方便添加新的平台模板、LLM后端和导出格式

技术选型

  • Python 3.9+:广泛兼容,标准库丰富
  • urllib:替代requests,实现零依赖HTTP请求
  • 内置YAML解析器:替代PyYAML,简化依赖
  • 内置模板引擎:替代Jinja2,保持轻量

后续迭代计划

  • 🎥 视频分镜图自动生成(集成图片生成API)
  • 📊 脚本A/B测试对比功能
  • 🔄 历史脚本管理与版本对比
  • 🌐 更多语言支持(法语、德语、阿拉伯语等)
  • 📱 Web UI界面
  • 🔗 与视频剪辑工具集成(FFmpeg、剪映等)

📦 打包与部署指南

作为pip包安装

pip install scriptforge

从源码安装

git clone https://github.com/gitstq/scriptforge.git
cd scriptforge
pip install -e .

Docker部署(可选)

docker build -t scriptforge .
docker run -it scriptforge generate "AI工具推荐" --platform tiktok

兼容环境

环境 最低版本 推荐版本
Python 3.9 3.11+
操作系统 Windows/macOS/Linux 任意
Ollama(可选) 0.1.0 最新版

🤝 贡献指南

欢迎贡献代码!请遵循以下步骤:

  1. Fork 本仓库
  2. 创建功能分支:git checkout -b feat/your-feature
  3. 编写代码和测试
  4. 确保所有测试通过:python -m unittest discover tests/
  5. 提交代码:git commit -m "feat: 添加你的功能"
  6. 推送分支:git push origin feat/your-feature
  7. 提交Pull Request

详细指南请参阅 CONTRIBUTING.md


📄 开源协议

本项目基于 MIT License 开源。


Made with ❤️ by gitstq


🎉 簡介

ScriptForge 是一款輕量級、零依賴的AI驅動內容腳本生成CLI工具。無論你是短視頻創作者、內容運營還是自媒體從業者,ScriptForge都能幫你快速生成高質量的短視頻腳本、分鏡方案和字幕文件。

💡 靈感來源

參考了GitHub Trending上熱門的AI視頻生成工具(如Pixelle-Video等)的腳本生成環節,獨立自研了這款專注於腳本創作的輕量級工具。與需要複雜環境配置的全棧視頻工具不同,ScriptForge專注於做好一件事——幫你寫出爆款腳本

🔥 自研差異化亮點

  • 零外部依賴:核心功能僅使用Python標準庫,無需安裝任何第三方包
  • 多平台適配:內置抖音/TikTok、YouTube Shorts、B站、小紅書、Instagram Reels模板
  • 多LLM後端:支持OpenAI、Anthropic Claude、Ollama本地模型及任何OpenAI兼容API
  • 智能評分系統:7維度腳本質量評估,幫你優化每一個細節
  • 多格式導出:Markdown、JSON、SRT字幕、純文本,一鍵切換
  • 內置Mock模式:無需API Key即可體驗全部功能,方便測試和演示

✨ 核心特性

特性 描述
🎬 多平台模板 內置8+平台模板(抖音15s/30s/60s、YouTube、B站、小紅書、Instagram等)
🤖 AI腳本生成 接入GPT-4o/Claude/Ollama等大模型,智能生成專業腳本
📊 7維質量評分 鉤子強度、結構、互動性、清晰度、平台適配、CTA效果、標籤相關性
📝 SRT字幕生成 自動生成帶時間軸的SRT字幕文件,可直接用於視頻剪輯
🔥 熱點話題推薦 內置6大分類(科技/生活/教育/商業/娛樂/綜合)熱門話題庫
📦 批量生成 從話題文件批量生成腳本,支持大規模內容生產
🌐 多語言輸出 支持中文、英文、日文、韓文、西班牙文腳本生成
🎨 6種風格 互動型、教育型、娛樂型、勵志型、敘事型、推廣型
📤 4種導出格式 Markdown、JSON、SRT字幕、純文本
⚙️ YAML配置 靈活的YAML配置文件,支持環境變量覆蓋
🧪 Mock模式 內建模擬生成器,無需API Key即可完整體驗

🚀 快速開始

環境要求

  • Python 3.9 或更高版本
  • pip 包管理器
  • (可選)OpenAI / Anthropic API Key,或本地安裝 Ollama

安裝

# 從PyPI安裝(推薦)
pip install scriptforge

# 或從源碼安裝
git clone https://github.com/gitstq/scriptforge.git
cd scriptforge
pip install -e .

快速使用

# 1. 查看幫助
scriptforge --help

# 2. 使用Mock模式生成腳本(無需API Key)
scriptforge generate "5個Python新手必知技巧" --platform tiktok --duration 15

# 3. 查看可用模板
scriptforge templates

# 4. 查看熱門話題推薦
scriptforge trending --category tech --count 5

# 5. 導出為Markdown
scriptforge generate "AI工具推薦" --platform youtube --duration 60 --output script.md

# 6. 導出為SRT字幕
scriptforge generate "生活小妙招" --platform xiaohongshu --format srt --output subtitles.srt

# 7. 批量生成
scriptforge batch --topics-file topics.txt --output-dir ./scripts --platform tiktok

# 8. 初始化項目
scriptforge init my-video-project

📖 詳細使用指南

配置API Key

創建配置文件 scriptforge.yaml

# 使用OpenAI
provider:
  name: openai
  api_key: sk-your-key-here
  model: gpt-4o-mini

# 或使用本地Ollama(完全免費)
# provider:
#   name: ollama
#   model: llama3
#   base_url: http://localhost:11434

平台模板

模板名稱 平台 時長 適用場景
tiktok-15s 抖音/TikTok 15秒 快速鉤子視頻
tiktok-30s 抖音/TikTok 30秒 中等內容視頻
tiktok-60s 抖音/TikTok 60秒 深度內容視頻
youtube-60s YouTube Shorts 60秒 知識分享
bilibili-60s B站 60秒 深度內容
xiaohongshu-30s 小紅書 30秒 種草推薦
instagram-30s Instagram Reels 30秒 生活方式
generic-30s 通用 30秒 多平台分發

💡 設計思路與迭代規劃

設計理念

  1. 零依賴核心:不依賴任何第三方庫,降低安裝門檻,提升穩定性
  2. 配置驅動:YAML配置文件 + 環境變量,靈活適配不同使用場景
  3. 模板化:平台模板系統,讓腳本結構符合各平台最佳實踐
  4. 可擴展:清晰的模塊架構,方便添加新的平台模板、LLM後端和導出格式

後續迭代計劃

  • 🎥 視頻分鏡圖自動生成
  • 📊 腳本A/B測試對比功能
  • 🔄 歷史腳本管理與版本對比
  • 🌐 更多語言支持
  • 📱 Web UI界面
  • 🔗 與視頻剪輯工具集成

🤝 貢獻指南

歡迎貢獻代碼!請遵循以下步驟:

  1. Fork 本倉庫
  2. 創建功能分支:git checkout -b feat/your-feature
  3. 編寫代碼和測試
  4. 確保所有測試通過:python -m unittest discover tests/
  5. 提交代碼:git commit -m "feat: 添加你的功能"
  6. 推送分支:git push origin feat/your-feature
  7. 提交Pull Request

📄 開源協議

本項目基於 MIT License 開源。


Made with ❤️ by gitstq


🎉 Introduction

ScriptForge is a lightweight, zero-dependency AI-powered content script generator CLI tool. Whether you're a short video creator, content operator, or social media professional, ScriptForge helps you quickly generate high-quality video scripts, storyboard plans, and subtitle files.

💡 Inspiration

Inspired by the script generation capabilities of trending AI video tools (like Pixelle-Video) on GitHub Trending, ScriptForge is an independently developed tool focused solely on script creation. Unlike full-stack video tools that require complex setups, ScriptForge does one thing exceptionally well — helping you write viral scripts.

🔥 Unique Differentiators

  • Zero External Dependencies: Core functionality uses only Python standard library
  • Multi-Platform Templates: Built-in templates for TikTok, YouTube Shorts, Bilibili, Xiaohongshu, Instagram Reels
  • Multi-LLM Backend: Supports OpenAI, Anthropic Claude, Ollama local models, and any OpenAI-compatible API
  • Smart Scoring System: 7-dimension script quality assessment to optimize every detail
  • Multi-Format Export: Markdown, JSON, SRT subtitles, plain text — one-click switching
  • Built-in Mock Mode: Experience all features without any API key

✨ Core Features

Feature Description
🎬 Multi-Platform Templates 8+ built-in platform templates (TikTok 15s/30s/60s, YouTube, Bilibili, etc.)
🤖 AI Script Generation Powered by GPT-4o / Claude / Ollama for professional script creation
📊 7-Dimension Quality Scoring Hook strength, structure, engagement, clarity, platform fit, CTA, hashtag relevance
📝 SRT Subtitle Generation Auto-generate timestamped SRT subtitle files for video editing
🔥 Trending Topic Suggestions Built-in topic library across 6 categories (tech, lifestyle, education, etc.)
📦 Batch Generation Generate scripts in bulk from a topics file
🌐 Multi-Language Output Chinese, English, Japanese, Korean, Spanish
🎨 6 Script Styles Engaging, educational, entertaining, inspirational, storytelling, promotional
📤 4 Export Formats Markdown, JSON, SRT subtitles, plain text
⚙️ YAML Configuration Flexible config files with environment variable override
🧪 Mock Mode Built-in mock generator for testing without API keys

🚀 Quick Start

Requirements

  • Python 3.9 or higher
  • pip package manager
  • (Optional) OpenAI / Anthropic API key, or locally installed Ollama

Installation

# Install from PyPI (recommended)
pip install scriptforge

# Or install from source
git clone https://github.com/gitstq/scriptforge.git
cd scriptforge
pip install -e .

Quick Usage

# 1. Show help
scriptforge --help

# 2. Generate a script with Mock mode (no API key needed)
scriptforge generate "5 Python Tips Every Beginner Needs" --platform tiktok --duration 15

# 3. List available templates
scriptforge templates

# 4. Get trending topic suggestions
scriptforge trending --category tech --count 5

# 5. Export as Markdown
scriptforge generate "AI Tools You Must Try" --platform youtube --duration 60 --output script.md

# 6. Export as SRT subtitles
scriptforge generate "Life Hacks" --platform xiaohongshu --format srt --output subtitles.srt

# 7. Batch generation
scriptforge batch --topics-file topics.txt --output-dir ./scripts --platform tiktok

# 8. Initialize a project
scriptforge init my-video-project

📖 Detailed Usage Guide

Configure API Key

Create a config file scriptforge.yaml:

# Use OpenAI
provider:
  name: openai
  api_key: sk-your-key-here
  model: gpt-4o-mini

# Use Anthropic Claude
# provider:
#   name: anthropic
#   api_key: sk-ant-your-key-here
#   model: claude-sonnet-4-20250514

# Use local Ollama (completely free)
# provider:
#   name: ollama
#   model: llama3
#   base_url: http://localhost:11434

# Or use environment variables
# export OPENAI_API_KEY=sk-your-key-here
# export SCRIPTFORGE_PROVIDER=ollama

Platform Templates

Template Platform Duration Best For
tiktok-15s TikTok 15s Quick hook videos
tiktok-30s TikTok 30s Medium content videos
tiktok-60s TikTok 60s In-depth content videos
youtube-60s YouTube Shorts 60s Knowledge sharing
bilibili-60s Bilibili 60s Deep content
xiaohongshu-30s Xiaohongshu/RED 30s Product recommendations
instagram-30s Instagram Reels 30s Lifestyle content
generic-30s Generic 30s Multi-platform distribution

Script Scoring Dimensions

📊 Script Quality Scores
  hook_strength     ████████░░ 85%  A    🎣 Hook attractiveness
  structure         █████████░ 95%  A+   📐 Structural integrity
  engagement        ███████░░░ 75%  B    💬 Engagement potential
  clarity           ████████░░ 80%  A    🔍 Content clarity
  platform_fit      █████████░ 90%  A+   📱 Platform fit
  cta_effectiveness ███████░░░ 70%  B    📢 CTA effectiveness
  hashtag_relevance ████████░░ 85%  A    🏷️ Hashtag relevance
  overall           ████████░░ 83%  A    🏆 Overall score

💡 Design Philosophy & Roadmap

Design Principles

  1. Zero-Dependency Core: No third-party libraries for maximum portability
  2. Configuration-Driven: YAML config + environment variables for flexibility
  3. Template-Based: Platform templates ensure scripts follow best practices
  4. Extensible: Clean module architecture for easy additions

Technology Choices

  • Python 3.9+: Broad compatibility, rich standard library
  • urllib: Zero-dependency HTTP requests (no requests library)
  • Built-in YAML Parser: No PyYAML dependency
  • Built-in Template Engine: No Jinja2 dependency

Roadmap

  • 🎥 Auto-generate storyboard images (integrate image generation APIs)
  • 📊 Script A/B testing comparison
  • 🔄 Script history management & version diff
  • 🌐 More language support (French, German, Arabic, etc.)
  • 📱 Web UI interface
  • 🔗 Integration with video editors (FFmpeg, CapCut, etc.)

📦 Build & Deploy

Install as pip package

pip install scriptforge

Install from source

git clone https://github.com/gitstq/scriptforge.git
cd scriptforge
pip install -e .

Compatible Environments

Environment Min Version Recommended
Python 3.9 3.11+
OS Windows/macOS/Linux Any
Ollama (optional) 0.1.0 Latest

🤝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork this repository
  2. Create a feature branch: git checkout -b feat/your-feature
  3. Write code and tests
  4. Ensure all tests pass: python -m unittest discover tests/
  5. Commit your changes: git commit -m "feat: add your feature"
  6. Push to the branch: git push origin feat/your-feature
  7. Submit a Pull Request

See CONTRIBUTING.md for detailed guidelines.


📄 License

This project is licensed under the MIT License.


Made with ❤️ by gitstq