Skip to content

Sync MDF (MarkdownFlow) courses to AI-Shifu platform — supports chapter→lesson nested structure

License

Notifications You must be signed in to change notification settings

ai-shifu/mdf-shifu-sync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

MDF Shifu Sync

将本地 MDF(MarkdownFlow)课程文件同步到 AI-Shifu 平台的 Agent Skill。

支持章→节嵌套结构,通过 REST API 自动创建课程、章节和课节,并写入 MDF 授课提示词。

功能

  • 📦 将 MDF 课程目录转为 AI-Shifu 导入 JSON
  • 🏗️ 支持章→节嵌套结构(不只是平铺)
  • 🔄 支持更新已有课程(复用 shifu_bid)
  • 🧹 自动清理旧 outline

快速使用

1. 准备课程目录

my-course/
├── structure.json    # 章节结构定义
└── lessons/
    ├── lesson-01.md  # MDF 授课提示词
    ├── lesson-02.md
    └── ...

2. structure.json 格式

{
  "title": "课程标题",
  "description": "课程描述",
  "chapters": [
    {
      "title": "第一章:xxx",
      "lessons": [
        {"title": "第1节标题", "file": "lesson-01.md"},
        {"title": "第2节标题", "file": "lesson-02.md"}
      ]
    }
  ]
}

3. 导入到 AI-Shifu

# 新建课程
python3 scripts/shifu-structured-import.py \
  --base-url https://app.ai-shifu.cn \
  --token <your_jwt_token> \
  --structure my-course/structure.json \
  --lessons-dir my-course/lessons/

# 更新已有课程
python3 scripts/shifu-structured-import.py \
  --base-url https://app.ai-shifu.cn \
  --token <your_jwt_token> \
  --structure my-course/structure.json \
  --lessons-dir my-course/lessons/ \
  --shifu-bid <existing_shifu_bid>

4. 平铺导入(无章节嵌套)

# 先生成导入 JSON
python3 scripts/mdf-to-shifu-json.py \
  --course-dir my-course \
  --output my-course/shifu-import.json \
  --title "课程标题"

# 再通过 API 导入
python3 scripts/shifu-api-import.py \
  --base-url https://app.ai-shifu.cn \
  --token <token> \
  --json-file my-course/shifu-import.json

脚本说明

脚本 用途
shifu-structured-import.py 推荐 — 按章→节结构导入
shifu-api-import.py 平铺导入(所有 lesson 同级)
mdf-to-shifu-json.py 将课程目录转为 AI-Shifu CLI 导入 JSON

依赖

  • Python 3.8+
  • requests (pip install requests)

配合使用的 Skills

License

MIT

About

Sync MDF (MarkdownFlow) courses to AI-Shifu platform — supports chapter→lesson nested structure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages