← 返回
未分类 Key 中文

Wiki Js V3

All-encompassing Wiki.js Administration – GraphQL + REST API wrapper with full coverage. Pages, Assets, Search, Tags, Tree, History, Versioning, Rendering. R...
全能的 Wiki.js 管理——GraphQL + REST API 包装器,覆盖全部功能:页面、资源、搜索、标签、树形结构、历史、版本控制、渲染。
nyhx1101 nyhx1101 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 需要
★ 0
Stars
📥 310
下载
💾 0
安装
1
版本
#latest

概述

Wiki.js V3 Skill – All-Encompassing Wiki Administration

Ersetzt: wiki-js-v2 (nur Pages + Assets)

🎯 Features

FeatureV2V3
-----------------
Pages (CRUD)
Assets (Upload/List)
Move/Copy Pages
Page History
Version Restore
Render (HTML/PDF)
Search (Full-Text + Tags)
Page Tree/Hierarchy
Tags (CRUD)
Asset Folders
Asset Delete
Multi-Locale
Retry + Backoff
Path-First + ID

📦 Installation

# Skill bereits installiert unter:
~/.openclaw/workspace/skills/wiki-js-v3/

# CLI-Wrapper (optional, für direkten Terminal-Zugriff):
chmod +x ~/.openclaw/workspace/skills/wiki-js-v3/bin/wiki.js
ln -s ~/.openclaw/workspace/skills/wiki-js-v3/bin/wiki.js ~/.local/bin/wiki

Environment:

export WIKIJS_URL="https://your-wiki.example.com"
export WIKIJS_TOKEN="your_api_key_here"
export WIKIJS_LOCALE="de"  # Optional, default: de

🔧 API Coverage

GraphQL Operations

CategoryOperations
---------------------
Pagessingle, singleByPath, list, create, update, delete, move, render, history, restoreVersion
Searchsearch(query, limit)
Tagslist, create, delete
Assetslist, createFolder, delete

REST Operations

EndpointUse Case
--------------------
POST /uFile upload (multipart/form-data)
GET /f/:hash/:filenameStatic asset serving

📝 CLI Reference

Pages

# Create or update (idempotent)
wiki upsert docs/setup "Setup Guide" @content.md "setup,wiki"
wiki upsert docs/api "API Reference" "## Overview\n..." "api,docs"

# Get page content
wiki get docs/setup
wiki get 42  # by ID

# Delete page
wiki delete docs/old-page
wiki delete 42

# Move page (changes path)
wiki move docs/old docs/new

# Copy page (creates new page)
wiki copy docs/template docs/new-page

# Show page history
wiki history docs/setup

# Restore specific version
wiki restore docs/setup --version=3

# Render page
wiki render docs/setup --format=html
wiki render docs/setup --format=pdf > setup.pdf

Search

# Full-text search
wiki search "docker"

# With tag filter
wiki search "kubernetes" --tags="devops,cloud"

# Limit results
wiki search "api" --limit=50

Tree / Hierarchy

# List all pages
wiki tree

# Filter by path prefix
wiki tree --path=docs

# Control depth
wiki tree --depth=5

Tags

# List all tags
wiki tags

# Create tag
wiki tags create "new-feature"

# Delete tag
wiki tags delete "deprecated"

Assets

# List assets
wiki assets
wiki assets --folder=images
wiki assets --kind=IMAGE

# Upload file
wiki upload screenshot.png
wiki upload doc.pdf --folder=documents --name="manual.pdf"

# Delete asset
wiki asset-delete 42

# Create folder
wiki mkdir 0 images "Bilder"

Options

--pretty, -p        Human-readable output (default: JSON)
--locale, -l de     Locale override
--private           Create private page
--draft             Create unpublished page

🔄 Error Handling

ErrorHandling
-----------------
413 Payload Too LargeThrows descriptive error (chunking not auto-applied for pages)
401 UnauthorizedClear token error message
ECONNREFUSEDAuto-retry with exponential backoff (3 attempts)
Timeout30s default, configurable via WIKIJS_TIMEOUT

📐 Architecture

bin/wiki.js
├── GraphQL Client (query, mutation)
├── REST Upload (form-data)
├── Path Resolution (singleByPath)
├── CLI Parser (arg parsing)
└── Output Formatter (JSON / Pretty)

Dependencies:

  • Node.js built-in modules only
  • form-data for file uploads (installed on-demand)

🔐 Security

  • Token only via environment variable (WIKIJS_TOKEN)
  • No token logging
  • Input validation (null bytes, size limits)
  • Path sanitization (strips leading /)

📤 Examples

Create Documentation Page

# Write content to file
cat > /tmp/api.md << 'EOF'
# API Reference

## Authentication

All requests require a Bearer token...

## Endpoints

- `GET /api/v1/pages` - List pages
- `POST /api/v1/pages` - Create page
EOF

# Upsert to Wiki
wiki upsert docs/api "API Reference" @/tmp/api.md "api,reference" --pretty

Upload Screenshot and Embed

# Upload image
wiki upload screenshot.png --folder=images --name="api-auth-flow.png"
# Output: {"id":47,"url":"/f/a3f9b2/api-auth-flow.png",...}

# Create page with embedded image
wiki upsert docs/api-auth "API Authentication" '![Auth Flow](/f/a3f9b2/api-auth-flow.png)' "api"

Batch Update via Script

#!/bin/bash
for file in docs/*.md; do
  name=$(basename "$file" .md)
  wiki upsert "docs/$name" "$name Documentation" "@$file" "docs"
done

🆚 Migration from V2

V2 CommandV3 Command
-----------------------
wiki-v2 upsert ...wiki upsert ...
wiki-v2 get ...wiki get ...
wiki-v2 delete ...wiki delete ...
wiki-v2 search ...wiki search ...
wiki-v2 upload ...wiki upload ...
wiki-v2 assets ...wiki assets ...
wiki-v2 mkdir ...wiki mkdir ...
wiki move ...
wiki copy ...
wiki history ...
wiki restore ...
wiki render ...
wiki tree ...
wiki tags ...
wiki asset-delete ...

🐛 Troubleshooting

IssueSolution
-----------------
WIKIJS_TOKEN not setexport WIKIJS_TOKEN=...
Page not foundCheck path (no leading /)
GraphQL Error: UnauthorizedToken invalid or expired
GraphQL Error: ForbiddenAPI key lacks write permissions – create new key with write access in Admin UI
Upload failed: 413File too large (>10MB)
Timeout after 30sIncrease WIKIJS_TIMEOUT=60000
Cannot read properties of undefined (reading 'map')Fixed in V3.1 – always include tags: [] in update mutations

⚠️ API Key Permissions

Wiki.js API keys have per-key permissions, not per-group permissions.

JWT ClaimMeaning
--------------------
api:1API Key ID 1 – may have different permissions than Key 2
grp:1Group ID 1 – does NOT determine write access

If update returns "Forbidden":

  1. Open Wiki.js Admin UI
  2. Go to API Keys
  3. Create new key with write permissions or edit existing key
  4. Use the new key in WIKIJS_TOKEN

📚 Wiki.js API Reference

  • GraphQL Schema: {WIKIJS_URL}/graphql-playground
  • REST Upload: POST {WIKIJS_URL}/u
  • Static Assets: GET {WIKIJS_URL}/f/:hash/:filename

Version: 3.0 | Status: All-encompassing | Replaces: wiki-js-v2

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-07 07:47 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,082 📥 810,928
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,379 📥 320,526
ai-agent

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,227 📥 267,916