OpenStoryline Install
Use this skill when the task is to install or repair a local source checkout of FireRed-OpenStoryline.
Keep the workflow deterministic:
- 1. Confirm the repo path and read the current README.md and config.toml.
- Detect local prerequisites before changing anything.
- Prefer a local
venv install unless the user explicitly asks for Docker or conda. - Download resources only after Python dependencies succeed.
- Validate imports and config loading before claiming success.
- This skill assumes macOS, Linux, or WSL with a POSIX shell.
What This Skill Covers
- - Clone the GitHub repo if needed
- Create a Python environment
- Install Python dependencies
- Download
.storyline models and resource/ assets - Fill
config.toml model settings - Start MCP and web servers
- Explain common installation/documentation gaps
Preconditions
Check these first:
- - INLINECODE5
- Python INLINECODE6
- INLINECODE7
- INLINECODE8
- INLINECODE9
Optional:
- - INLINECODE10
- INLINECODE11
If ffmpeg, wget, or unzip are missing, install them through the OS package manager before continuing.
Examples:
CODEBLOCK0
CODEBLOCK1
If no supported package manager or permission is available, stop and report the missing system dependency clearly.
Interpreter selection
First prefer any interpreter that already exists and passes version checks:
- 1. A system Python INLINECODE15
- An already available conda Python INLINECODE16
- An already available pyenv Python
>= 3.11, but only if basic stdlib modules work
Validate candidate interpreters before using them:
CODEBLOCK2
If no supported interpreter already exists, peferr conda fallback:
CODEBLOCK3
After a supported interpreter is found, always create a repo-local .venv and continue using .venv/bin/python for install, config validation, and service startup.
Do not duplicate the rest of the workflow for pyenv or conda unless the user explicitly asks to stay inside a conda environment.
Clone repository
If you don't have a local repository yet, clone the repository first.
CODEBLOCK4
Preferred Install Path
From the repo root:
CODEBLOCK5
Notes:
- -
download.sh pulls both model weights and a large resource archive. It can take a long time and may resume after network drops. - The resource download is required for a full local run, not just the Python package install.
Configuration
Before starting the app, update config.toml.
You can use scripts/update_config.py.
At minimum, fill:
CODEBLOCK6
Optional but common:
- -
search_media.pexels_api_key for searching media - TTS provider keys under
generate_voiceover.providers.* (choose one provider)
Verification
Run these checks before saying installation is complete:
CODEBLOCK7
Also confirm key resources exist:
CODEBLOCK8
Start Services
There are two common paths. These are long-running processes. Do not wait for them to exit normally. Treat successful startup log lines or confirmed listening ports as success, and keep the services running in separate shells/sessions as needed.
Manual start:
CODEBLOCK9
In a second shell:
CODEBLOCK10
Expected Outputs
After a successful install:
- -
.venv/ exists - MCP listens on the configured local port (commonly
127.0.0.1:8001) - Web listens on the configured web port (commonly
127.0.0.1:8005, though run.sh defaults may differ)
Common Problems
download.sh is slow or interrupted
Symptom:
- - Large downloads stall or reconnect
Fix:
- - Let
wget continue; it supports resume behavior here - Verify extracted outputs instead of trusting the progress meter
Web/MCP server fails to bind
Symptom:
- -
operation not permitted while binding 127.0.0.1 or INLINECODE29
Fix:
- - In agent sandboxes, request permission to open local listening ports
- Prefer
127.0.0.1 over 0.0.0.0 unless external access is required
Response Pattern
When reporting status to the user, separate:
- - what is installed
- what is still downloading
- what config is still missing
- what address the service is listening on
Do not say "installation complete" if only the Python packages are installed but the resource bundle is still missing.
OpenStoryline 安装
当任务需要安装或修复 FireRed-OpenStoryline 的本地源码检出时使用此技能。
保持工作流程确定性:
- 1. 确认仓库路径并读取当前的 README.md 和 config.toml。
- 在更改任何内容之前检测本地先决条件。
- 除非用户明确要求使用 Docker 或 conda,否则优先使用本地 venv 安装。
- 仅在 Python 依赖项成功后再下载资源。
- 在声明成功之前验证导入和配置加载。
- 此技能假设使用 macOS、Linux 或带有 POSIX shell 的 WSL。
此技能涵盖的内容
- - 如果需要,克隆 GitHub 仓库
- 创建 Python 环境
- 安装 Python 依赖项
- 下载 .storyline 模型和 resource/ 资源文件
- 填写 config.toml 模型设置
- 启动 MCP 和 Web 服务器
- 解释常见的安装/文档缺口
先决条件
首先检查以下内容:
- - git
- Python >= 3.11
- ffmpeg
- wget
- unzip
可选:
如果缺少 ffmpeg、wget 或 unzip,请先通过操作系统包管理器安装它们。
示例:
bash
brew install ffmpeg wget unzip
bash
sudo apt-get update
sudo apt-get install -y ffmpeg wget unzip
如果没有可用的受支持包管理器或权限,请停止并明确报告缺失的系统依赖项。
解释器选择
首先优先选择任何已存在且通过版本检查的解释器:
- 1. 系统 Python >= 3.11
- 已可用的 conda Python >= 3.11
- 已可用的 pyenv Python >= 3.11,但仅限于基本 stdlib 模块正常工作的情况
在使用候选解释器之前进行验证:
bash
/path/to/python -c import ssl, sqlite3, venv; print(stdlib_ok)
如果尚不存在受支持的解释器,优先使用 conda 回退方案:
bash
conda create -y -n openstoryline-py311 python=3.11
conda run -n openstoryline-py311 python --version
conda run -n openstoryline-py311 python -m venv .venv
找到受支持的解释器后,始终创建仓库本地的 .venv,并继续使用 .venv/bin/python 进行安装、配置验证和服务启动。
除非用户明确要求留在 conda 环境中,否则不要为 pyenv 或 conda 重复工作流的其余部分。
克隆仓库
如果还没有本地仓库,请先克隆仓库。
bash
git clone https://github.com/FireRedTeam/FireRed-OpenStoryline.git
cd FireRed-OpenStoryline
首选安装路径
从仓库根目录开始:
bash
/path/to/python -m venv .venv
.venv/bin/python -m pip install --upgrade pip
.venv/bin/python -m pip install -r requirements.txt
bash download.sh
注意:
- - download.sh 会拉取模型权重和一个大型资源存档。这可能需要很长时间,并且可以在网络中断后恢复。
- 资源下载对于完整的本地运行是必需的,而不仅仅是 Python 包安装。
配置
在启动应用之前,更新 config.toml。
可以使用 scripts/update_config.py。
至少需要填写:
bash
.venv/bin/python scripts/update_config.py --config ./config.toml --set llm.model=替换为实际模型
.venv/bin/python scripts/updateconfig.py --config ./config.toml --set llm.baseurl=替换为实际URL
.venv/bin/python scripts/updateconfig.py --config ./config.toml --set llm.apikey=sk-替换为实际密钥
.venv/bin/python scripts/update_config.py --config ./config.toml --set vlm.model=替换为实际模型
.venv/bin/python scripts/updateconfig.py --config ./config.toml --set vlm.baseurl=替换为实际URL
.venv/bin/python scripts/updateconfig.py --config ./config.toml --set vlm.apikey=sk-替换为实际密钥
可选但常见的配置:
- - 用于搜索媒体的 searchmedia.pexelsapikey
- generatevoiceover.providers.* 下的 TTS 提供商密钥(选择一个提供商)
验证
在声明安装完成之前运行以下检查:
bash
.venv/bin/pip check
PYTHONPATH=src .venv/bin/python -c from openstoryline.config import loadsettings; loadsettings(config.toml); print(configok)
同时确认关键资源存在:
bash
test -f .storyline/models/transnetv2-pytorch-weights.pth
test -d resource/bgms
启动服务
有两种常见路径。这些是长时间运行的进程。不要等待它们正常退出。将成功的启动日志行或确认的监听端口视为成功,并根据需要在单独的 shell/会话中保持服务运行。
手动启动:
bash
PYTHONPATH=src .venv/bin/python -m open_storyline.mcp.server
在第二个 shell 中:
bash
PYTHONPATH=src .venv/bin/python -m uvicorn agent_fastapi:app --host 127.0.0.1 --port 8005
预期输出
成功安装后:
- - .venv/ 存在
- MCP 在配置的本地端口上监听(通常为 127.0.0.1:8001)
- Web 在配置的 Web 端口上监听(通常为 127.0.0.1:8005,但 run.sh 默认值可能不同)
常见问题
download.sh 速度慢或中断
症状:
修复:
- - 让 wget 继续;它在此处支持断点续传
- 验证提取的输出,而不是相信进度条
Web/MCP 服务器绑定失败
症状:
- - 绑定 127.0.0.1 或 0.0.0.0 时出现 operation not permitted
修复:
- - 在代理沙箱中,请求打开本地监听端口的权限
- 除非需要外部访问,否则优先使用 127.0.0.1 而非 0.0.0.0
响应模式
向用户报告状态时,请区分:
- - 已安装的内容
- 仍在下载的内容
- 仍然缺失的配置
- 服务正在监听的地址
如果只安装了 Python 包但资源包仍然缺失,不要说安装完成。