بنقرة واحدة
aicut-editing
// 指导如何进行项目管理(新建、查看、切换、删除)、操作 AIcut 时间轴、添加媒体、创建字幕及导出视频。当用户询问关于项目列表管理、新建/切换/删除项目、视频剪辑、时间轴操作、添加素材、生成的视频有问题或媒体管理时使用此技能。
// 指导如何进行项目管理(新建、查看、切换、删除)、操作 AIcut 时间轴、添加媒体、创建字幕及导出视频。当用户询问关于项目列表管理、新建/切换/删除项目、视频剪辑、时间轴操作、添加素材、生成的视频有问题或媒体管理时使用此技能。
| name | aicut-editing |
| description | 指导如何进行项目管理(新建、查看、切换、删除)、操作 AIcut 时间轴、添加媒体、创建字幕及导出视频。当用户询问关于项目列表管理、新建/切换/删除项目、视频剪辑、时间轴操作、添加素材、生成的视频有问题或媒体管理时使用此技能。 |
This skill helps understand and manipulate the AIcut video editing system.
ai_workspace/project-snapshot.json - The single source of truth for timeline state.projects/<display-name>/ - Readable folder names mapped to internal IDs via projects/projectIdMap.json.projects/<display-name>/assets/ - Media files organized by type.exports/ - Final rendered videos./projects page.projects/ directory.To manage projects via API/Python:
switch_project(projectId). If the project is loaded for the first time, it creates the folder. If it exists, the UI will automatically jump to that project.archive_project(). The system uses the project's name as the folder name.switch_project(anotherId). The UI will perform a hot-reload and navigate to the new project editor.projectIdMap.json.delete_project(projectId) to permanently remove the project folder and its ID mapping.{
"id": "e.g., el-0",
"type": "media",
"mediaId": "asset-reference-id",
"name": "display-name.mp4",
"thumbnailUrl": "/api/media/serve?path=...", // CRITICAL for video/image preview
"startTime": 0.0, // In seconds
"duration": 5.0, // Visible duration
"trimStart": 0.0, // Crop from start of source
"trimEnd": 0.0, // Crop from end of source
"x": 960, "y": 540, // Postion (Center origin is 960, 540)
"scale": 1.0,
"opacity": 1.0,
"volume": 1.0,
"metadata": {
"importSource": "sdk_v2"
}
}
To ensure compatibility between Python and Frontend, use this format:
{
"id": "unique-id",
"type": "text",
"content": "The display text", // Primary text field
"startTime": 0.0,
"duration": 3.0,
"trimStart": 0, "trimEnd": 0, // MUST include (default to 0)
"x": 960, "y": 900, // Subtitle position (bottom center)
"rotation": 0, "opacity": 1, // MUST include defaults
"fontSize": 60, // Styles MUST be at top level
"fontFamily": "Arial",
"color": "#ffffff",
"textAlign": "center",
"fontWeight": "bold",
"style": { // Optional nested style for Python SDK
"fontSize": 60,
"color": "#ffffff"
}
}
content as the single source of truth for text. The name field is OMITTED for text elements to prevent redundancy.trimStart, trimEnd, rotation, and opacity. If missing, the frontend might fail to render or default to 0 (invisible).(0,0) is Top-Left. 1920x1080 canvas. Standard center is (960, 540).nanoid or sub-0, sub-1).Preferred Method: Use AIcut SDK (import_media).
The SDK automates the following steps:
/api/media/generate-thumbnail for videos to create high-quality frames.thumbnailUrl.Manual Method (Advanced):
assets array.id.thumbnailUrl (use the asset's URL or a dedicated JPG thumb) for visual feedback.text).startTime with audio assets.element.volume (0.0 = mute, 1.0 = normal, up to 10.0 = 1000%).The frontend exposes a state-syncing API at POST /api/ai-edit. Always prefer using the Python SDK (scripts/aicut_sdk.py) over raw HTTP requests.
| Action | Description | Key Data Fields |
|---|---|---|
addSubtitle | Add a single subtitle | text, startTime, duration, fontSize, color |
addMultipleSubtitles | Batch add subtitles | subtitles (Array of subtitle objects) |
clearSubtitles | Remove subtitles | startTime, duration (Optional range) |
switchProject | Load or create project | projectId |
archiveProject | Save workspace to disk | projectId (Optional) |
deleteProject | Delete project folder | projectId |
updateSnapshot | Push full timeline state | project, tracks, assets (Full JSON object) |
GET /api/media/serve?path=<encoded_absolute_path>: Serves local files as browser-accessible URLs.POST /api/media/generate-thumbnail: Generate a JPG from a video file (Body: { filePath: string }).GET /api/ai-edit?action=getSnapshot: Retrieve current timeline state.GET /api/ai-edit?action=listProjects: List all archived projects.GET /api/ai-edit?action=poll: Polled by frontend to fetch pending edits.curl on Windows: Use a temporary Python script or the AIcut SDK for stable JSON communication./materials/ relative paths. Always use absolute paths wrapped in the /api/media/serve?path= API. This ensures files from any drive (F:, D:, etc.) work correctly.number type, not string.scripts/aicut_sdk.py. It correctly handles thumbnail generation calls and internal path mapping.The following scripts/CLIs are available in the scripts/ directory:
| Tool | Purpose | Usage Example |
|---|---|---|
aicut_tool.py | Centralized CLI for all common tasks. | python scripts/aicut_tool.py media import "path/to/video.mp4" |
aicut_sdk.py | Core library for all programmatic edits. | from aicut_sdk import AIcutClient |
fix_subtitle_pos.py | Align subtitles to bottom center. | python scripts/fix_subtitle_pos.py |
project_manager.py | Standalone project lifecycle tool (legacy support) | python scripts/project_manager.py list |
Note: These scripts depend on
scripts/aicut_sdk.py. Ensure you run them from the skill directory or add the directory to yourPYTHONPATH.