Status
Frozen draft. This skill is intentionally not discoverable by scanSkillsDirectory() because it has no index.js / index.py entrypoint.
Do not register or enable it until the external Wiki.js write boundary, credentials, and API wrapper contract are reviewed. See STATUS.md.
Wiki.js - Wiki 交互技能
通过 GraphQL API 和 REST 上传端点操作 Wiki.js 实例。
工具
| 工具 |
说明 |
关键参数 |
listPages |
列出所有页面 |
orderBy |
getPageByPath |
按路径获取页面 |
path, locale |
getPageById |
按 ID 获取页面 |
id |
createPage |
创建页面 |
path, title, content |
updatePage |
更新页面 |
id, content, title |
deletePage |
删除页面 |
id |
getPageTree |
获取页面树 |
mode, locale |
searchPages |
搜索页面 |
query, locale |
uploadFile |
上传文件 |
filePath, filename, folderId |
listAssetFolders |
列出资源文件夹 |
parentId |
createAssetFolder |
创建资源文件夹 |
name, slug, parentId |
listAssets |
列出资源 |
folderId, kind |
deleteAsset |
删除资源 |
id |
页面操作
listPages
列出所有页面。
参数:
orderBy (string, optional): 排序方式,默认 'TITLE'
getPageByPath
按路径获取页面。
参数:
path (string, required): 页面路径
locale (string, required): 语言代码,如 'en'
createPage
创建页面。
参数:
path (string, required): 页面路径
title (string, required): 页面标题
content (string, required): 页面内容(Markdown)
locale (string, optional): 语言代码,默认 'en'
description (string, optional): 页面描述
tags (string[], optional): 标签数组
isPublished (boolean, optional): 是否发布,默认 true
updatePage
更新页面。
参数:
id (number, required): 页面 ID
content (string, optional): 新内容
title (string, optional): 新标题
deletePage
删除页面。
参数:
id (number, required): 页面 ID
文件上传
uploadFile
上传文件到 Wiki.js。
参数:
filePath (string, required): 本地文件路径
filename (string, required): 文件名
folderId (number, required): 目标文件夹 ID
返回:
{ "succeeded": true, "message": "ok" }
上传格式说明:
Wiki.js 文件上传需要两个字段都命名为 mediaUpload:
- 第一个字段:文件夹元数据 JSON
{"folderId": 1}
- 第二个字段:实际文件内容
资源管理
listAssetFolders
列出资源文件夹。
参数:
parentId (number, required): 父文件夹 ID(根目录为 0)
listAssets
列出资源。
参数:
folderId (number, required): 文件夹 ID
kind (string, optional): 资源类型 - 'ALL', 'IMAGE', 'BINARY', 'PDF', 'CODE', 'MARKUP', 'VIDEO', 'AUDIO'
配置要求
需要以下环境变量:
WIKIJS_URL - Wiki.js 实例 URL(如 https://wiki.example.com)
WIKIJS_TOKEN - API Token(从 Admin > API Access 获取)
常见上传错误
| 错误 |
原因 |
解决方案 |
| "Missing upload folder metadata" |
缺少 JSON 元数据字段 |
添加 mediaUpload={"folderId":1} |
| "Missing upload payload" |
缺少文件字段 |
添加文件字段 mediaUpload |
| "You are not authorized" |
无 write:assets 权限 |
检查 API Token 权限 |
相关技能
PPT 转 Wiki.js:使用 ppt-to-wiki 技能将 PowerPoint 转换为 Wiki.js 页面。
1---2name: wikijs3description: Wiki.js 交互技能。通过 GraphQL API 和 REST 上传端点操作 Wiki.js,支持页面 CRUD、目录浏览、资源管理、搜索。当需要管理 Wiki.js 文档、内容迁移、自动化操作时触发。4---56# Status78Frozen draft. This skill is intentionally not discoverable by `scanSkillsDirectory()` because it has no `index.js` / `index.py` entrypoint.910Do not register or enable it until the external Wiki.js write boundary, credentials, and API wrapper contract are reviewed. See `STATUS.md`.1112# Wiki.js - Wiki 交互技能1314通过 GraphQL API 和 REST 上传端点操作 Wiki.js 实例。1516## 工具1718| 工具 | 说明 | 关键参数 |19|------|------|----------|20| `listPages` | 列出所有页面 | `orderBy` |21| `getPageByPath` | 按路径获取页面 | `path`, `locale` |22| `getPageById` | 按 ID 获取页面 | `id` |23| `createPage` | 创建页面 | `path`, `title`, `content` |24| `updatePage` | 更新页面 | `id`, `content`, `title` |25| `deletePage` | 删除页面 | `id` |26| `getPageTree` | 获取页面树 | `mode`, `locale` |27| `searchPages` | 搜索页面 | `query`, `locale` |28| `uploadFile` | 上传文件 | `filePath`, `filename`, `folderId` |29| `listAssetFolders` | 列出资源文件夹 | `parentId` |30| `createAssetFolder` | 创建资源文件夹 | `name`, `slug`, `parentId` |31| `listAssets` | 列出资源 | `folderId`, `kind` |32| `deleteAsset` | 删除资源 | `id` |3334## 页面操作3536### listPages3738列出所有页面。3940**参数:**41- `orderBy` (string, optional): 排序方式,默认 'TITLE'4243### getPageByPath4445按路径获取页面。4647**参数:**48- `path` (string, required): 页面路径49- `locale` (string, required): 语言代码,如 'en'5051### createPage5253创建页面。5455**参数:**56- `path` (string, required): 页面路径57- `title` (string, required): 页面标题58- `content` (string, required): 页面内容(Markdown)59- `locale` (string, optional): 语言代码,默认 'en'60- `description` (string, optional): 页面描述61- `tags` (string[], optional): 标签数组62- `isPublished` (boolean, optional): 是否发布,默认 true6364### updatePage6566更新页面。6768**参数:**69- `id` (number, required): 页面 ID70- `content` (string, optional): 新内容71- `title` (string, optional): 新标题7273### deletePage7475删除页面。7677**参数:**78- `id` (number, required): 页面 ID7980## 文件上传8182### uploadFile8384上传文件到 Wiki.js。8586**参数:**87- `filePath` (string, required): 本地文件路径88- `filename` (string, required): 文件名89- `folderId` (number, required): 目标文件夹 ID9091**返回:**92```json93{ "succeeded": true, "message": "ok" }94```9596**上传格式说明:**97Wiki.js 文件上传需要**两个字段都命名为 `mediaUpload`**:981. 第一个字段:文件夹元数据 JSON `{"folderId": 1}`992. 第二个字段:实际文件内容100101## 资源管理102103### listAssetFolders104105列出资源文件夹。106107**参数:**108- `parentId` (number, required): 父文件夹 ID(根目录为 0)109110### listAssets111112列出资源。113114**参数:**115- `folderId` (number, required): 文件夹 ID116- `kind` (string, optional): 资源类型 - 'ALL', 'IMAGE', 'BINARY', 'PDF', 'CODE', 'MARKUP', 'VIDEO', 'AUDIO'117118## 配置要求119120需要以下环境变量:121- `WIKIJS_URL` - Wiki.js 实例 URL(如 `https://wiki.example.com`)122- `WIKIJS_TOKEN` - API Token(从 Admin > API Access 获取)123124## 常见上传错误125126| 错误 | 原因 | 解决方案 |127|------|------|----------|128| "Missing upload folder metadata" | 缺少 JSON 元数据字段 | 添加 `mediaUpload={"folderId":1}` |129| "Missing upload payload" | 缺少文件字段 | 添加文件字段 `mediaUpload` |130| "You are not authorized" | 无 `write:assets` 权限 | 检查 API Token 权限 |131132## 相关技能133134PPT 转 Wiki.js:使用 **ppt-to-wiki** 技能将 PowerPoint 转换为 Wiki.js 页面。