微算力 · API 导航与自营网关
API 接入 EN
未登录登录
📚

Wiki.js 专业命令行管理工具

wikijs · vv1.4.0
专业技能 安全 A 级 作者 hopyky 公开目录收录
1.1k 下载 512 安装 2.6k 收藏 40k 浏览

简介

基于 GraphQL 的 Wiki.js 专业 CLI 工具,提供批量管理、备份恢复与内容分析功能,助力企业知识库高效运维。

原始描述

Command-line tool to manage Wiki.js content, pages, assets, templates, and backups via its GraphQL API with search, update, sync, and analysis functions.

通过你的 Agent 添加

点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。

或者手动安装

Claude Code~/.claude/skills/wikijs/
Codex CLI~/.codex/skills/wikijs/
DeepSeek Harness~/.agents/skills/wikijs/

包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可; 目录名不用换,也不要把包直接解压到 skills 根目录。 技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。

中文使用说明 来自收录源

概览

Wiki.js Skill 是一款功能强大的命令行界面(CLI)工具,它通过 Wiki.js 平台自带的 GraphQL API,将常见的网页管理操作转化为高效的终端命令。作为一款由社区开发者维护的开源工具(v1.4),它覆盖了从页面创建、编辑、搜索到系统分析、备份与恢复的完整生命周期,旨在为技术用户和团队提供一个无需离开终端即可深度管理知识库的“遥控器”。

核心功能与优点

该 Skill 最大的优势在于全面性与高度的自动化能力。它不仅提供了基本的读写操作(create, get, update),更集结了一系列专业分析工具,如检查断链 (check-links)、查找孤立页面 (orphans) 和重复内容 (duplicates),这使其超越了简单的管理助手,成为一个知识库健康度诊断工具。其批量操作 (bulk-create, sync) 和模板功能允许用户快速从本地 Markdown 文件构建或同步大型文档结构,极大地提升了内容迁移和批量整理的效率。此外,交互式 Shell (shell) 和实时监控 (watch) 模式,为高频使用的管理员提供了流畅的操作体验。

潜在局限性与风险

尽管功能强大,该工具仍存在一些局限性。首先,它完全依赖于 Wiki.js 的 GraphQL API,这意味着其性能与可用性直接受限于目标 Wiki.js 服务器的版本兼容性与响应速度。安全报告指出,其 GraphQL 查询构建采用字符串内联而非标准的变量绑定,虽有 JSON.stringify 转义,但在处理特殊字符时仍存在潜在的边缘情况风险。对于非技术用户而言,命令行界面存在较高的学习曲线。另外,作为社区驱动的 T3 级别项目,其长期维护、功能更新以及安全漏洞修复的响应速度,相较于大型企业支持的项目存在一定的不确定性。

适用人群

此工具非常适合系统管理员、DevOps 工程师和技术文档撰写者,他们需要将 Wiki 管理集成到自动化流水线、CI/CD 流程或本地开发环境中。同时,任何管理大规模 Wiki.js 实例的团队,特别是需要定期进行内容审计、清洗无效链接和重复页面的内容管理团队,都会发现其分析功能极具价值。

安全与风险提示

根据安全审计报告,该 Skill(安全等级 A,来源可信度 T3)的代码结构规范,具备多层输入验证和完整的 GraphQL 注入防护,无后门或数据外泄风险。主要风险集中在配置层面:示例配置使用了不安全的 HTTP 明文协议,若用户在部署时未切换到 HTTPS,可能导致 API Token 和 Wiki 内容在传输中被截获。用户在使用前应仔细审查其依赖项,并确保遵循安全配置实践。

技能正文

Wiki.js Skill v1.4

A complete CLI for managing Wiki.js via the GraphQL API.

Quick Start

# Install
npm install && npm link

# Configure
cp config/wikijs.example.json ~/.config/wikijs.json
# Edit with your Wiki.js URL and API token

# Test connection
wikijs health

Commands Reference

Reading

Command Description
wikijs list List all pages
wikijs search "query" Search pages
wikijs get <id-or-path> Read a page
wikijs info <id-or-path> Show page metadata
wikijs grep "pattern" Search within content
wikijs tree Display page hierarchy

Writing

Command Description
wikijs create <path> <title> Create a page
wikijs create ... --template doc Create from template
wikijs update <id> Update a page
wikijs move <id> <new-path> Move a page
wikijs delete <id> Delete a page

Tags

Command Description
wikijs tags List all tags
wikijs tag <id> add <tag> Add a tag
wikijs tag <id> remove <tag> Remove a tag

Backup & Restore

Command Description
wikijs backup Create backup
wikijs restore-backup <file> Restore from backup
wikijs export <dir> Export to files

Versions

Command Description
wikijs versions <id> Show history
wikijs revert <id> <version> Restore version
wikijs diff <id> Compare versions

Assets

Command Description
wikijs images List assets
wikijs upload <file> Upload asset
wikijs delete-image <id> Delete asset

Bulk Operations

Command Description
wikijs bulk-create <folder> Create from files
wikijs bulk-update <folder> Update from files
wikijs sync Sync to local
wikijs sync --watch Watch mode

Analysis

Command Description
wikijs tree Page hierarchy tree
wikijs check-links Find broken links
wikijs stats Show statistics
wikijs lint <file> Lint markdown file
wikijs lint --id <id> Lint wiki page
wikijs orphans Find pages with no incoming links
wikijs duplicates Find similar/duplicate content
wikijs toc <id> Generate table of contents
wikijs validate <id> Validate page content
wikijs validate --all Validate all pages
wikijs spellcheck <id> Check spelling

Content Operations

Command Description
wikijs clone <id> <path> Duplicate a page
wikijs replace "old" "new" Search/replace across pages
wikijs sitemap Generate XML sitemap

Interactive

Command Description
wikijs shell Interactive shell mode
wikijs watch <id> Watch page for changes

Templates

Command Description
wikijs template list List templates
wikijs template show <name> Show template
wikijs template create <name> Create template
wikijs template delete <name> Delete template

System

Command Description
wikijs health Check connection
wikijs cache clear Clear cache
wikijs completion bash Shell completion

Global Options

Option Description
-v, --verbose Verbose output
-d, --debug Debug output
--no-color Disable colors
--rate-limit <ms> API rate limiting

Common Options

Option Description
--format json|table Output format
--limit <n> Limit results
--force Skip confirmations
--locale <locale> Specify locale
--dry-run Preview changes

Examples

# Create page with template
wikijs template create doc --content "# {{title}}\n\n{{date}}"
wikijs create "/docs/api" "API Docs" --template doc

# Find broken links in docs section
wikijs check-links --path "/docs"

# Bulk import with rate limiting
wikijs --rate-limit 500 bulk-create ./pages --path-prefix "/imported"

# Watch mode for continuous sync
wikijs sync --output ~/wiki-mirror --watch --interval 60

# Debug API issues
wikijs --debug list

# Clone a page
wikijs clone 42 "/docs/new-page" --with-tags

# Find orphan pages (no incoming links)
wikijs orphans

# Search and replace across wiki
wikijs replace "oldterm" "newterm" --path "/docs" --dry-run

# Generate table of contents
wikijs toc 42 --format markdown

# Find duplicate content
wikijs duplicates --threshold 80

# Generate sitemap for SEO
wikijs sitemap --output sitemap.xml

# Interactive shell mode
wikijs shell

# Watch a page for changes
wikijs watch "/docs/api" --interval 60

# Spell check a page
wikijs spellcheck 42 --lang en --ignore "API,CLI,GraphQL"

# Validate all pages
wikijs validate --all --format json

Integration Notes

  • All commands return exit code 0 on success, 1 on failure
  • Use --format json for machine-readable output
  • Delete operations prompt for confirmation unless --force is used
  • Escape sequences (\n, \t) are interpreted in --content strings
  • Templates support placeholders: {{title}}, {{path}}, {{date}}

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

标签

docsproductivityautomationcontent-mediadevelopment-engineering

同类 Skill