简体中文
快速开始
本页带你在本机拉起 ReliaForge 后端、调用内置示例插件,并用脚手架生成并加载第一个自定义插件。如果只想先看看界面,可直接打开只读在线演示。
环境准备
- Python 3.11+
- Git
- Node.js 20+ 与 npm 10+(仅在从源码运行前端控制台或构建自定义插件界面时需要)
1. 启动后端
克隆 reliaforge-backend,创建虚拟环境并启动开发服务器:
bash
git clone https://github.com/ReliaForge/reliaforge-backend.git
cd reliaforge-backend
python -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
cp .env.example .env
reliaforge在 Windows PowerShell 中使用 .venv\Scripts\Activate.ps1 激活虚拟环境。
开发服务器默认监听 127.0.0.1:8000。
2. 验证已加载插件
保持后端运行,另开终端查询平台状态与内置示例接口:
bash
curl http://127.0.0.1:8000/api/v1/status
curl http://127.0.0.1:8000/api/v1/plugins
curl http://127.0.0.1:8000/api/v1/plugins/demo/greeting
curl http://127.0.0.1:8000/api/v1/plugins/runbook/preview四条请求均应返回 HTTP 200。其中 demo 返回一段问候文本,runbook 通过进程内 Python 服务调用 demo 生成预览,用来演示插件依赖关系且不访问外部系统。
3. 用脚手架生成并加载第一个插件
按 Ctrl+C 停止后端,生成 sample_tool,并将 RELIAFORGE_PLUGIN_PATHS 指向插件父目录:
bash
reliaforge-scaffold sample_tool --destination ./local-plugins
RELIAFORGE_PLUGIN_PATHS=./local-plugins reliaforge在 Windows PowerShell 中:
powershell
$env:RELIAFORGE_PLUGIN_PATHS = "./local-plugins"
reliaforge在第二个终端调用新插件的接口:
bash
curl --fail http://127.0.0.1:8000/api/v1/plugins/sample_tool/message预期返回:
json
{"message": "Generated plugin is running", "plugin_id": "sample_tool"}如果返回 404,请检查 RELIAFORGE_PLUGIN_PATHS 指向的是父目录 ./local-plugins,而不是插件子目录 ./local-plugins/sample_tool。
4. 启动本地控制台
在 reliaforge-backend 同级目录另开终端执行:
bash
git clone https://github.com/ReliaForge/reliaforge-frontend.git
cd reliaforge-frontend
cp .env.example .env
npm ci
npm run dev访问 http://127.0.0.1:5530。控制台会自动跟随浏览器语言(中/英)以及系统浅色/深色外观。
